2 Test strval() function : usage variations - error conditions
5 /* Prototype : string strval ( mixed $var )
6 * Description: Get the string value of a variable.
7 * Source code: ext/standard/string.c
10 echo "*** Testing strval() : error conditions ***\n";
12 error_reporting(E_ALL ^ E_NOTICE);
16 // no toString() method defined
19 // Testing strval with a object which has no toString() method
20 echo "\n-- Testing strval() function with object which has not toString() method --\n";
22 var_dump( strval(new MyClass()) );
24 echo $e->getMessage(), "\n";
29 *** Testing strval() : error conditions ***
31 -- Testing strval() function with object which has not toString() method --
32 Object of class MyClass could not be converted to string