mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
The VM assumes that an exception must be handled when the AST evaluation returns FAILURE. However, the comparison functions always return SUCCESS even if an exception happened. This can be fixed in zend_ast_evaluate_inner() or we can make is_smaller_function() etc check for the exception. I chose the former to avoid impact or API breaks. Perhaps in the future the comparison functions should either return void or return whether an exception happened, as to be not misleading. Closes GH-18589.
21 lines
298 B
PHP
21 lines
298 B
PHP
--TEST--
|
|
OSS-Fuzz #418106144
|
|
--FILE--
|
|
<?php
|
|
|
|
class Foo {
|
|
function __toString(){}
|
|
}
|
|
function test($y=new Foo>''){
|
|
var_dump();
|
|
}
|
|
try {
|
|
test();
|
|
} catch (TypeError $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
Foo::__toString(): Return value must be of type string, none returned
|