summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.h
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-03-20 16:04:04 +0300
committerDmitry Stogov <dmitry@zend.com>2015-03-20 16:04:04 +0300
commit59356126664584e0a67128acad161f8bd86381fa (patch)
tree65c26e29d8d953ef34217ecc09745dcdc3abc0f2 /Zend/zend_compile.h
parent44669e8f418708a3107fd797892d4e4e0aca1116 (diff)
downloadphp-git-59356126664584e0a67128acad161f8bd86381fa.tar.gz
Improved type hinting:
EX_PREV_USES_STRICT_TYPES() and family changed/renamed to fit with other macros Optimized zend_verify_internal_arg_type() and family (they don't need "strict" argument anymore) Standerd ZPP is called from VM only for weak type check or strict exception (int -> double) Fixed ZEND_RECV_VARIADIC Fixed ZEND_STRLEN TODO: should we accept IS_NULL for non-nullable arguments?
Diffstat (limited to 'Zend/zend_compile.h')
-rw-r--r--Zend/zend_compile.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index cedd5d6808..c53833f149 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -462,9 +462,19 @@ struct _zend_execute_data {
#define EX_CALL_KIND() ZEND_CALL_KIND(execute_data)
#define EX_NUM_ARGS() ZEND_CALL_NUM_ARGS(execute_data)
-#define EX_USES_STRICT_TYPES() _EX_USES_STRICT_TYPES(EG(current_execute_data))
-#define EX_PREV_USES_STRICT_TYPES() _EX_USES_STRICT_TYPES(EG(current_execute_data)->prev_execute_data)
-#define _EX_USES_STRICT_TYPES(ex_data) ((ex_data) && (ex_data)->func && ZEND_USER_CODE((ex_data)->func->type) && ((ex_data)->func->op_array.fn_flags & ZEND_ACC_STRICT_TYPES) ? 1 : 0)
+#define ZEND_CALL_USES_STRICT_TYPES(call) \
+ (((call)->func->common.fn_flags & ZEND_ACC_STRICT_TYPES) != 0)
+
+#define EX_USES_STRICT_TYPES() \
+ ZEND_CALL_USES_STRICT_TYPES(execute_data)
+
+#define ZEND_ARG_USES_STRICT_TYPES() \
+ (EG(current_execute_data)->prev_execute_data && \
+ EG(current_execute_data)->prev_execute_data->func && \
+ ZEND_CALL_USES_STRICT_TYPES(EG(current_execute_data)->prev_execute_data))
+
+#define ZEND_RET_USES_STRICT_TYPES() \
+ ZEND_CALL_USES_STRICT_TYPES(EG(current_execute_data))
#define EX_VAR(n) ZEND_CALL_VAR(execute_data, n)
#define EX_VAR_NUM(n) ZEND_CALL_VAR_NUM(execute_data, n)