tostring_002.phpt 370 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. ZE2 __toString() in __destruct
  3. --SKIPIF--
  4. <?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
  5. --FILE--
  6. <?php
  7. class Test
  8. {
  9. function __toString()
  10. {
  11. return "Hello\n";
  12. }
  13. function __destruct()
  14. {
  15. echo $this;
  16. }
  17. }
  18. $o = new Test;
  19. $o = NULL;
  20. $o = new Test;
  21. ?>
  22. ====DONE====
  23. --EXPECTF--
  24. Hello
  25. ====DONE====
  26. Hello