php-src/Zend/tests/non_well_formed_param_exception.phpt
Nikita Popov 21148679d1 Handle "non well formed" exception during ZPP
Previously if the "non well formed" notice was converted into an
exception we'd still end up executing the function.

Also drop the now unnecessary EG(exception) checks in the engine.

Additionally remote a bogus exception in zend_is_callable: It
should only be writing to error, but not directly throwing.
2019-10-08 17:17:49 +02:00

23 lines
460 B
PHP

--TEST--
A "non well formed" notice converted to exception should result in a ZPP failure
--FILE--
<?php
set_error_handler(function($_, $msg) {
throw new Exception($msg);
}, E_NOTICE);
try {
wordwrap("foo", "123foo", "");
} catch (Exception $e) {
echo $e, "\n";
}
?>
--EXPECTF--
Exception: A non well formed numeric value encountered in %s:%d
Stack trace:
#0 [internal function]: {closure}(%s)
#1 %s(%d): wordwrap('foo', '123foo', '')
#2 {main}