1--TEST--
2Test strval() function : usage variations  - error conditions
3--FILE--
4<?php
5echo "*** Testing strval() : error conditions ***\n";
6
7error_reporting(E_ALL ^ E_NOTICE);
8
9class MyClass
10{
11    // no toString() method defined
12}
13
14// Testing strval with a object which has no toString() method
15echo "\n-- Testing strval() function with object which has not toString() method  --\n";
16try {
17    var_dump( strval(new MyClass()) );
18} catch (Error $e) {
19    echo $e->getMessage(), "\n";
20}
21
22?>
23--EXPECT--
24*** Testing strval() : error conditions ***
25
26-- Testing strval() function with object which has not toString() method  --
27Object of class MyClass could not be converted to string
28