From 68c4f99e23695e74eafa43097ecab62392bad3ee Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 30 Oct 2018 16:25:14 +0300 Subject: [PATCH] Added test --- ext/opcache/tests/preload.inc | 18 +++++++++++++++++- ext/opcache/tests/preload_002.phpt | 19 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 ext/opcache/tests/preload_002.phpt 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