Skip to content

Commit 68c4f99

Browse files
committed
Added test
1 parent 38ab7ef commit 68c4f99

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

ext/opcache/tests/preload.inc

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,20 @@ function f1() {
55
if (isset($rt)) {
66
function f2() {
77
}
8-
}
8+
}
9+
10+
interface a {
11+
function foo();
12+
function bar();
13+
}
14+
interface b {
15+
function foo();
16+
}
17+
18+
abstract class c {
19+
function bar() { }
20+
}
21+
22+
class x extends c implements a, b {
23+
function foo() { }
24+
}

ext/opcache/tests/preload_002.phpt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
Preloading prototypes
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.optimization_level=-1
7+
opcache.preload={PWD}/preload.inc
8+
--SKIPIF--
9+
<?php require_once('skipif.inc'); ?>
10+
--FILE--
11+
<?php
12+
var_dump((new ReflectionMethod('x', 'foo'))->getPrototype()->class);
13+
vaR_dump((new ReflectionMethod('x', 'bar'))->getPrototype()->class);
14+
?>
15+
OK
16+
--EXPECT--
17+
string(1) "b"
18+
string(1) "a"
19+
OK

0 commit comments

Comments
 (0)