Skip to content

Commit 7a20781

Browse files
committed
Added test
1 parent 4a57b5d commit 7a20781

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

ext/opcache/tests/preload.inc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,18 @@ abstract class c {
2222
class x extends c implements a, b {
2323
function foo() { }
2424
}
25+
26+
trait T1 {
27+
static function foo() {
28+
var_dump(__METHOD__);
29+
}
30+
}
31+
trait T2 {
32+
use T1;
33+
static function bar() {
34+
var_dump(__METHOD__);
35+
}
36+
}
37+
class Y {
38+
use T2;
39+
}

ext/opcache/tests/preload_003.phpt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
Preloading classes linked with traits
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+
Y::foo();
13+
Y::bar();
14+
?>
15+
OK
16+
--EXPECT--
17+
string(7) "T1::foo"
18+
string(7) "T2::bar"
19+
OK

0 commit comments

Comments
 (0)