summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/zend_compile.c10
-rw-r--r--Zend/zend_compile.h3
2 files changed, 11 insertions, 2 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 3adcc55f4e..46c057e4f2 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -3563,6 +3563,14 @@ int zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_l
return FAILURE;
}
+ if (zend_string_equals_literal(lcname, "assert")) {
+ return zend_compile_assert(result, args, lcname, fbc);
+ }
+
+ if (CG(compiler_options) & ZEND_COMPILE_NO_BUILTINS) {
+ return FAILURE;
+ }
+
if (zend_string_equals_literal(lcname, "strlen")) {
return zend_compile_func_strlen(result, args);
} else if (zend_string_equals_literal(lcname, "is_null")) {
@@ -3597,8 +3605,6 @@ int zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_l
return zend_compile_func_cufa(result, args, lcname);
} else if (zend_string_equals_literal(lcname, "call_user_func")) {
return zend_compile_func_cuf(result, args, lcname);
- } else if (zend_string_equals_literal(lcname, "assert")) {
- return zend_compile_assert(result, args, lcname, fbc);
} else {
return FAILURE;
}
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index f716dc51ff..f52d22a384 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -1019,6 +1019,9 @@ END_EXTERN_C()
/* force IS_OBJ_USE_GUARDS for all classes */
#define ZEND_COMPILE_GUARDS (1<<9)
+/* disable builtin special case function calls */
+#define ZEND_COMPILE_NO_BUILTINS (1<<10)
+
/* The default value for CG(compiler_options) */
#define ZEND_COMPILE_DEFAULT ZEND_COMPILE_HANDLE_OP_ARRAY