diff --git a/ext/opcache/tests/preload.inc b/ext/opcache/tests/preload.inc index c470cc2555f..91603d459f3 100644 --- a/ext/opcache/tests/preload.inc +++ b/ext/opcache/tests/preload.inc @@ -5,4 +5,20 @@ function f1() { if (isset($rt)) { function f2() { } -} \ No newline at end of file +} + +interface a { + function foo(); + function bar(); +} +interface b { + function foo(); +} + +abstract class c { + function bar() { } +} + +class x extends c implements a, b { + function foo() { } +} diff --git a/ext/opcache/tests/preload_002.phpt b/ext/opcache/tests/preload_002.phpt new file mode 100644 index 00000000000..38c3e8af685 --- /dev/null +++ b/ext/opcache/tests/preload_002.phpt @@ -0,0 +1,19 @@ +--TEST-- +Preloading prototypes +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.optimization_level=-1 +opcache.preload={PWD}/preload.inc +--SKIPIF-- + +--FILE-- +getPrototype()->class); +vaR_dump((new ReflectionMethod('x', 'bar'))->getPrototype()->class); +?> +OK +--EXPECT-- +string(1) "b" +string(1) "a" +OK