summaryrefslogtreecommitdiff
path: root/ext/opcache/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ext/opcache/tests')
-rw-r--r--ext/opcache/tests/preload_012.phpt14
-rw-r--r--ext/opcache/tests/preload_const_autoload.inc7
-rw-r--r--ext/opcache/tests/preload_const_autoload_2.inc5
3 files changed, 26 insertions, 0 deletions
diff --git a/ext/opcache/tests/preload_012.phpt b/ext/opcache/tests/preload_012.phpt
new file mode 100644
index 0000000000..0883064ff4
--- /dev/null
+++ b/ext/opcache/tests/preload_012.phpt
@@ -0,0 +1,14 @@
+--TEST--
+No autoloading during constant resolution
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.preload={PWD}/preload_const_autoload.inc
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+===DONE===
+--EXPECTF--
+Warning: Can't preload class Test with unresolved initializer for constant C in %s on line %d
+===DONE===
diff --git a/ext/opcache/tests/preload_const_autoload.inc b/ext/opcache/tests/preload_const_autoload.inc
new file mode 100644
index 0000000000..b9634de49a
--- /dev/null
+++ b/ext/opcache/tests/preload_const_autoload.inc
@@ -0,0 +1,7 @@
+<?php
+
+spl_autoload_register(function($class) {
+ var_dump($class);
+ new Abc;
+});
+opcache_compile_file('preload_const_autoload_2.inc');
diff --git a/ext/opcache/tests/preload_const_autoload_2.inc b/ext/opcache/tests/preload_const_autoload_2.inc
new file mode 100644
index 0000000000..9367902adf
--- /dev/null
+++ b/ext/opcache/tests/preload_const_autoload_2.inc
@@ -0,0 +1,5 @@
+<?php
+
+class Test {
+ const C = Foo::BAR;
+}