how to use php’s magic function inside another function

    this can be done like this
    <?php
    class Foo {

      public function
    __isset($name) {
        echo
    "Foo:__isset($name) invoked\n";

        return
    'bar'===$name;
      }

      public function
    __get($name) {
        echo
    "Foo:__get($name) invoked\n";
        return
    'lalala';
      }
    }

    $foo = new Foo;
    var_dump(empty($foo->dummy));
    var_dump(empty($foo->bar));
    ?>
    5
    Average: 5 (1 vote)