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