xref: /PHP-7.4/ext/reflection/tests/bug74454.phpt (revision 6c4e2079)
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===DONE===
17--EXPECT--
18ParseError: syntax error, unexpected 'if' (T_IF), expecting function (T_FUNCTION) or const (T_CONST)
19===DONE===
20