@@ -2788,14 +2788,16 @@ static zend_op *zend_delayed_compile_prop(znode *result, zend_ast *ast, uint32_t
2788
2788
zend_emit_op (& obj_node , ZEND_FETCH_THIS , NULL , NULL );
2789
2789
}
2790
2790
CG (active_op_array )-> fn_flags |= ZEND_ACC_USES_THIS ;
2791
+
2792
+ /* We will throw if $this doesn't exist, so there's no need to emit a JMP_NULL
2793
+ * check for a nullsafe access. */
2791
2794
} else {
2792
2795
zend_short_circuiting_mark_inner (obj_ast );
2793
2796
opline = zend_delayed_compile_var (& obj_node , obj_ast , type , 0 );
2794
2797
zend_separate_if_call_and_write (& obj_node , obj_ast , type );
2795
- }
2796
-
2797
- if (nullsafe ) {
2798
- zend_emit_jmp_null (& obj_node );
2798
+ if (nullsafe ) {
2799
+ zend_emit_jmp_null (& obj_node );
2800
+ }
2799
2801
}
2800
2802
2801
2803
zend_compile_expr (& prop_node , prop_ast );
@@ -4347,13 +4349,15 @@ void zend_compile_method_call(znode *result, zend_ast *ast, uint32_t type) /* {{
4347
4349
zend_emit_op (& obj_node , ZEND_FETCH_THIS , NULL , NULL );
4348
4350
}
4349
4351
CG (active_op_array )-> fn_flags |= ZEND_ACC_USES_THIS ;
4352
+
4353
+ /* We will throw if $this doesn't exist, so there's no need to emit a JMP_NULL
4354
+ * check for a nullsafe access. */
4350
4355
} else {
4351
4356
zend_short_circuiting_mark_inner (obj_ast );
4352
4357
zend_compile_expr (& obj_node , obj_ast );
4353
- }
4354
-
4355
- if (nullsafe ) {
4356
- zend_emit_jmp_null (& obj_node );
4358
+ if (nullsafe ) {
4359
+ zend_emit_jmp_null (& obj_node );
4360
+ }
4357
4361
}
4358
4362
4359
4363
zend_compile_expr (& method_node , method_ast );
0 commit comments