tostring_002.phpt 290 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. ZE2 __toString() in __destruct
  3. --FILE--
  4. <?php
  5. class Test
  6. {
  7. function __toString()
  8. {
  9. return "Hello\n";
  10. }
  11. function __destruct()
  12. {
  13. echo $this;
  14. }
  15. }
  16. $o = new Test;
  17. $o = NULL;
  18. $o = new Test;
  19. ?>
  20. ====DONE====
  21. --EXPECT--
  22. Hello
  23. ====DONE====
  24. Hello