xref: /PHP-7.4/ext/opcache/tests/bug78014.phpt (revision 59c3ddab)
1--TEST--
2Bug #78014 (Preloaded classes may depend on non-preloaded classes due to unresolved consts)
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.optimization_level=-1
7opcache.preload={PWD}/preload_bug78014.inc
8--SKIPIF--
9<?php
10require_once('skipif.inc');
11if (PHP_OS_FAMILY == 'Windows') die('skip Preloading is not supported on Windows');
12?>
13--FILE--
14<?php
15class B extends A {
16    function foo(): int { return 24; }
17}
18$c = new C;
19var_dump($c->foo());
20?>
21--EXPECTF--
22Warning: Can't preload unlinked class C: Parent with unresolved initializers B in %s on line %d
23
24Warning: Can't preload class B with unresolved initializer for constant X in %s on line %d
25
26Fatal error: Uncaught Error: Class 'C' not found in %sbug78014.php:5
27Stack trace:
28#0 {main}
29  thrown in %sbug78014.php on line 5
30