mirror of
https://github.com/php/php-src.git
synced 2024-12-14 12:26:19 +08:00
21148679d1
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.
39 lines
824 B
PHP
39 lines
824 B
PHP
--TEST--
|
|
Exceptions on improper usage of $this
|
|
--FILE--
|
|
<?php
|
|
abstract class C {
|
|
abstract static function foo();
|
|
}
|
|
|
|
function foo(callable $x) {
|
|
}
|
|
|
|
try {
|
|
C::foo();
|
|
} catch (Error $e) {
|
|
echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n";
|
|
}
|
|
|
|
try {
|
|
foo("C::foo");
|
|
} catch (Error $e) {
|
|
echo "\n";
|
|
do {
|
|
echo "Exception: " . $e->getMessage() . "\n";
|
|
$e = $e->getPrevious();
|
|
} while ($e instanceof Error);
|
|
}
|
|
|
|
C::foo();
|
|
?>
|
|
--EXPECTF--
|
|
Exception: Cannot call abstract method C::foo() in %sexception_017.php on line %d
|
|
|
|
Exception: Argument 1 passed to foo() must be callable, string given, called in %s on line %d
|
|
|
|
Fatal error: Uncaught Error: Cannot call abstract method C::foo() in %sexception_017.php:%d
|
|
Stack trace:
|
|
#0 {main}
|
|
thrown in %sexception_017.php on line %d
|