mirror of
https://github.com/php/php-src.git
synced 2024-12-15 21:05:51 +08:00
21 lines
291 B
Plaintext
21 lines
291 B
Plaintext
|
--TEST--
|
||
|
Testing indirect method call and exceptions
|
||
|
--FILE--
|
||
|
<?php
|
||
|
|
||
|
class foo {
|
||
|
public function __construct() {
|
||
|
throw new Exception('foobar');
|
||
|
}
|
||
|
}
|
||
|
|
||
|
try {
|
||
|
$X = (new foo)->Inexistent(3);
|
||
|
} catch (Exception $e) {
|
||
|
var_dump($e->getMessage()); // foobar
|
||
|
}
|
||
|
|
||
|
?>
|
||
|
--EXPECT--
|
||
|
string(6) "foobar"
|