Skip to content

Commit a2ba970

Browse files
committed
Added test
1 parent b67e283 commit a2ba970

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

ext/opcache/tests/preload.inc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
function f1() {
3+
}
4+
5+
if (isset($rt)) {
6+
function f2() {
7+
}
8+
}

ext/opcache/tests/preload_001.phpt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--TEST--
2+
Preloading basic test
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(function_exists("f1"));
13+
var_dump(function_exists("f2"));
14+
15+
$rt = true;
16+
include(__DIR__ . "/preload.inc");
17+
var_dump(function_exists("f2"));
18+
?>
19+
OK
20+
--EXPECTF--
21+
bool(true)
22+
bool(false)
23+
bool(true)
24+
OK

0 commit comments

Comments
 (0)