bug7515.phpt 594 B

12345678910111213141516171819202122232425262728293031323334353637
  1. --TEST--
  2. Bug #7515 (weird & invisible referencing of objects)
  3. --SKIPIF--
  4. <?php if(version_compare(zend_version(), "2.0.0-dev", '<')) echo "skip Zend Engine 2 needed\n"; ?>
  5. --INI--
  6. error_reporting=2039
  7. --FILE--
  8. <?php
  9. class obj {
  10. function method() {}
  11. }
  12. $o->root=new obj();
  13. ob_start();
  14. var_dump($o);
  15. $x=ob_get_contents();
  16. ob_end_clean();
  17. $o->root->method();
  18. ob_start();
  19. var_dump($o);
  20. $y=ob_get_contents();
  21. ob_end_clean();
  22. if ($x == $y) {
  23. print "success";
  24. } else {
  25. print "failure
  26. x=$x
  27. y=$y
  28. ";
  29. }
  30. ?>
  31. --EXPECTF--
  32. Warning: Creating default object from empty value in %s on line %d
  33. success