HosipLan

Untitled

Mar 29th, 2012
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.39 KB | None | 0 0
  1. <?php
  2.  
  3. require_once 'Nette/loader.php';
  4. Nette\Diagnostics\Debugger::enable();
  5. Nette\Diagnostics\Debugger::$strictMode = TRUE;
  6.  
  7.  
  8. class Foo
  9. {
  10.  
  11.     private $bar = array(1 => array());
  12.  
  13.     function &__get($name)
  14.     {
  15.         return $this->$name;
  16.     }
  17.  
  18.     function __set($name, $val)
  19.     {
  20.         $this->$name = $val;
  21.     }
  22.  
  23. }
  24.  
  25.  
  26. $foo = new Foo();
  27. dump($foo->bar);
  28.  
  29. $foo->bar[1][2] = 3;
  30. dump($foo);
Advertisement
Add Comment
Please, Sign In to add comment