xref: /php-src/Zend/tests/bug75218.phpt (revision d04917c7)
1--TEST--
2Bug #75218: Change remaining uncatchable fatal errors for parsing into ParseError
3--FILE--
4<?php
5
6function try_eval($code) {
7    try {
8        eval($code);
9    } catch (CompileError $e) {
10        echo $e->getMessage(), "\n";
11    }
12}
13
14try_eval('if (false) {class C { final final function foo($fff) {}}}');
15try_eval('if (false) {class C { private protected $x; }}');
16try_eval('if (true) { __HALT_COMPILER(); }');
17try_eval('declare(encoding=[]);');
18
19?>
20--EXPECT--
21Multiple final modifiers are not allowed
22Multiple access type modifiers are not allowed
23__HALT_COMPILER() can only be used from the outermost scope
24Encoding must be a literal
25