indirect_method_call_001.phpt 309 B

1234567891011121314151617181920
  1. --TEST--
  2. Testing indirect method call and exceptions
  3. --FILE--
  4. <?php
  5. class foo {
  6. public function __construct() {
  7. throw new Exception('foobar');
  8. }
  9. }
  10. try {
  11. $X = (new foo)->Inexistent(3);
  12. } catch (Exception $e) {
  13. var_dump($e->getMessage()); // foobar
  14. }
  15. ?>
  16. --EXPECT--
  17. string(6) "foobar"