xref: /php-src/ext/reflection/tests/bug74454.phpt (revision adfdfb2e)
1--TEST--
2Bug #74454 (Wrong exception being thrown when using ReflectionMethod)
3--FILE--
4<?php
5spl_autoload_register('load_file');
6try {
7    $x = new ReflectionMethod('A', 'b');
8} catch (\Throwable $e) {
9    echo get_class($e), ': ', $e->getMessage(), PHP_EOL;
10}
11
12function load_file() {
13    require __DIR__ . '/bug74454.inc';
14}
15?>
16--EXPECT--
17ParseError: syntax error, unexpected token "if", expecting "function"
18