objects_020.phpt 313 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Accessing members of standard object through of variable variable
  3. --FILE--
  4. <?php
  5. error_reporting(E_ALL);
  6. $test = 'stdclass';
  7. $$test->a =& $$test;
  8. $$test->a->b[] = 2;
  9. var_dump($$test);
  10. ?>
  11. --EXPECTF--
  12. object(stdClass)#%d (2) {
  13. ["a"]=>
  14. *RECURSION*
  15. ["b"]=>
  16. array(1) {
  17. [0]=>
  18. int(2)
  19. }
  20. }