@@ -691,6 +691,13 @@ ZEND_API zval *zend_std_read_property(zend_object *zobj, zend_string *name, int
691
691
}
692
692
/* }}} */
693
693
694
+ static zend_always_inline zend_bool property_uses_strict_types () {
695
+ zend_execute_data * execute_data = EG (current_execute_data );
696
+ return execute_data
697
+ && execute_data -> func
698
+ && ZEND_CALL_USES_STRICT_TYPES (EG (current_execute_data ));
699
+ }
700
+
694
701
ZEND_API zval * zend_std_write_property (zend_object * zobj , zend_string * name , zval * value , void * * cache_slot ) /* {{{ */
695
702
{
696
703
zval * variable_ptr , tmp ;
@@ -707,7 +714,7 @@ ZEND_API zval *zend_std_write_property(zend_object *zobj, zend_string *name, zva
707
714
708
715
if (UNEXPECTED (prop_info )) {
709
716
ZVAL_COPY_VALUE (& tmp , value );
710
- if (UNEXPECTED (!zend_verify_property_type (prop_info , & tmp , EG ( current_execute_data ) && ZEND_CALL_USES_STRICT_TYPES ( EG ( current_execute_data ) )))) {
717
+ if (UNEXPECTED (!zend_verify_property_type (prop_info , & tmp , property_uses_strict_types ( )))) {
711
718
Z_TRY_DELREF_P (value );
712
719
variable_ptr = & EG (error_zval );
713
720
goto exit ;
@@ -716,7 +723,7 @@ ZEND_API zval *zend_std_write_property(zend_object *zobj, zend_string *name, zva
716
723
}
717
724
718
725
found :
719
- zend_assign_to_variable (variable_ptr , value , IS_TMP_VAR , EG ( current_execute_data ) && ZEND_CALL_USES_STRICT_TYPES ( EG ( current_execute_data ) ));
726
+ zend_assign_to_variable (variable_ptr , value , IS_TMP_VAR , property_uses_strict_types ( ));
720
727
goto exit ;
721
728
}
722
729
if (Z_PROP_FLAG_P (variable_ptr ) == IS_PROP_UNINIT ) {
@@ -772,7 +779,7 @@ ZEND_API zval *zend_std_write_property(zend_object *zobj, zend_string *name, zva
772
779
773
780
if (UNEXPECTED (prop_info )) {
774
781
ZVAL_COPY_VALUE (& tmp , value );
775
- if (UNEXPECTED (!zend_verify_property_type (prop_info , & tmp , ZEND_CALL_USES_STRICT_TYPES ( EG ( current_execute_data ) )))) {
782
+ if (UNEXPECTED (!zend_verify_property_type (prop_info , & tmp , property_uses_strict_types ( )))) {
776
783
zval_ptr_dtor (value );
777
784
goto exit ;
778
785
}
0 commit comments