TypePHP 编译器
https://swoole.com/aot/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
761 B
31 lines
761 B
--TEST--
|
|
Test strval() function : usage variations - error conditions
|
|
--SKIPIF--
|
|
<?php
|
|
echo 'skip AOT requires all executable code be in functions';
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
echo "*** Testing strval() : error conditions ***\n";
|
|
|
|
error_reporting(E_ALL ^ E_NOTICE);
|
|
|
|
class MyClass
|
|
{
|
|
// no toString() method defined
|
|
}
|
|
|
|
// Testing strval with a object which has no toString() method
|
|
echo "\n-- Testing strval() function with object which has not toString() method --\n";
|
|
try {
|
|
var_dump( strval(new MyClass()) );
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
*** Testing strval() : error conditions ***
|
|
|
|
-- Testing strval() function with object which has not toString() method --
|
|
Object of class MyClass could not be converted to string
|
|
|