bug7515.phpt 411 B

123456789101112131415161718192021222324252627282930313233
  1. --TEST--
  2. Bug #7515 (weird & invisible referencing of objects)
  3. --FILE--
  4. <?php
  5. class obj {
  6. function method() {}
  7. }
  8. $o = new stdClass;
  9. $o->root = new obj();
  10. ob_start();
  11. var_dump($o);
  12. $x=ob_get_contents();
  13. ob_end_clean();
  14. $o->root->method();
  15. ob_start();
  16. var_dump($o);
  17. $y=ob_get_contents();
  18. ob_end_clean();
  19. if ($x == $y) {
  20. print "success";
  21. } else {
  22. print "failure
  23. x=$x
  24. y=$y
  25. ";
  26. }
  27. ?>
  28. --EXPECT--
  29. success