Skip to content

Commit

Permalink
Added test
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Oct 30, 2018
1 parent 38ab7ef commit 68c4f99
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
18 changes: 17 additions & 1 deletion ext/opcache/tests/preload.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,20 @@ function f1() {
if (isset($rt)) {
function f2() {
}
}
}

interface a {
function foo();
function bar();
}
interface b {
function foo();
}

abstract class c {
function bar() { }
}

class x extends c implements a, b {
function foo() { }
}
19 changes: 19 additions & 0 deletions ext/opcache/tests/preload_002.phpt
Original file line number Diff line number Diff line change
@@ -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--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
var_dump((new ReflectionMethod('x', 'foo'))->getPrototype()->class);
vaR_dump((new ReflectionMethod('x', 'bar'))->getPrototype()->class);
?>
OK
--EXPECT--
string(1) "b"
string(1) "a"
OK

0 comments on commit 68c4f99

Please sign in to comment.