exception_009.phpt 674 B

1234567891011121314151617181920212223242526272829303132
  1. --TEST--
  2. Testing exception properties
  3. --FILE--
  4. <?php
  5. class my_file
  6. {
  7. public function __toString()
  8. {
  9. return "somebuildfilename" ;
  10. }
  11. }
  12. class my_exception extends exception
  13. {
  14. public function __construct()
  15. {
  16. $this->message = new stdclass ;
  17. $this->file = new my_file ;
  18. $this->line = "12" ;
  19. }
  20. }
  21. throw new my_exception;
  22. ?>
  23. --EXPECT--
  24. Fatal error: Uncaught Error: Object of class stdClass could not be converted to string in [no active file]:0
  25. Stack trace:
  26. #0 [internal function]: Exception->__toString()
  27. #1 {main}
  28. thrown in [no active file] on line 0