All pastes #215556 Raw Edit

Someone

public text v1 · immutable
#215556 ·published 2006-10-22 18:06 UTC
rendered paste body
<?php

class test
{
   private $_prop;

   public function __construct()
   {
      $this->_prop['a'] = "String 1\n";
      $this->_prop['b'] = "String 2\n";
   }

   public function __get($name)
   {
      if($name == 'a')
         return $this->b;
      if($name == 'b')
         return $this->a;
   }
}

$obj = new test();
echo $obj->a;

?>

====

$ php test.php
Notice: Undefined property:  test::$a in test.php on line 18