@@ -809,6 +809,13 @@ ZEND_API zval *zend_std_read_property(zval *object, zval *member, int type, void
809
809
}
810
810
/* }}} */
811
811
812
+ static zend_always_inline zend_bool property_uses_strict_types () {
813
+ zend_execute_data * execute_data = EG (current_execute_data );
814
+ return execute_data
815
+ && execute_data -> func
816
+ && ZEND_CALL_USES_STRICT_TYPES (EG (current_execute_data ));
817
+ }
818
+
812
819
ZEND_API zval * zend_std_write_property (zval * object , zval * member , zval * value , void * * cache_slot ) /* {{{ */
813
820
{
814
821
zend_object * zobj ;
@@ -833,7 +840,7 @@ ZEND_API zval *zend_std_write_property(zval *object, zval *member, zval *value,
833
840
834
841
if (UNEXPECTED (prop_info )) {
835
842
ZVAL_COPY_VALUE (& tmp , value );
836
- if (UNEXPECTED (!zend_verify_property_type (prop_info , & tmp , EG ( current_execute_data ) && ZEND_CALL_USES_STRICT_TYPES ( EG ( current_execute_data ) )))) {
843
+ if (UNEXPECTED (!zend_verify_property_type (prop_info , & tmp , property_uses_strict_types ( )))) {
837
844
Z_TRY_DELREF_P (value );
838
845
variable_ptr = & EG (error_zval );
839
846
goto exit ;
@@ -842,7 +849,7 @@ ZEND_API zval *zend_std_write_property(zval *object, zval *member, zval *value,
842
849
}
843
850
844
851
found :
845
- zend_assign_to_variable (variable_ptr , value , IS_TMP_VAR , EG ( current_execute_data ) && ZEND_CALL_USES_STRICT_TYPES ( EG ( current_execute_data ) ));
852
+ zend_assign_to_variable (variable_ptr , value , IS_TMP_VAR , property_uses_strict_types ( ));
846
853
goto exit ;
847
854
}
848
855
if (Z_PROP_FLAG_P (variable_ptr ) == IS_PROP_UNINIT ) {
@@ -898,7 +905,7 @@ ZEND_API zval *zend_std_write_property(zval *object, zval *member, zval *value,
898
905
899
906
if (UNEXPECTED (prop_info )) {
900
907
ZVAL_COPY_VALUE (& tmp , value );
901
- if (UNEXPECTED (!zend_verify_property_type (prop_info , & tmp , ZEND_CALL_USES_STRICT_TYPES ( EG ( current_execute_data ) )))) {
908
+ if (UNEXPECTED (!zend_verify_property_type (prop_info , & tmp , property_uses_strict_types ( )))) {
902
909
zval_ptr_dtor (value );
903
910
goto exit ;
904
911
}
0 commit comments