File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -218,13 +218,13 @@ static zend_string *validate_nodiscard(
218218{
219219 ZEND_ASSERT (CG (in_compilation ));
220220 const zend_string * prop_info_name = CG (context ).active_property_info_name ;
221- if (prop_info_name == NULL ) {
222- zend_op_array * op_array = CG (active_op_array );
223- op_array -> fn_flags |= ZEND_ACC_NODISCARD ;
224- return NULL ;
221+ if (prop_info_name != NULL ) {
222+ // Applied to a hook
223+ return ZSTR_INIT_LITERAL ("#[\\NoDiscard] is not supported for property hooks" , 0 );
225224 }
226- // Applied to a hook
227- return ZSTR_INIT_LITERAL ("#[\\NoDiscard] is not supported for property hooks" , 0 );
225+ zend_op_array * op_array = CG (active_op_array );
226+ op_array -> fn_flags |= ZEND_ACC_NODISCARD ;
227+ return NULL ;
228228}
229229
230230ZEND_METHOD (NoDiscard , __construct )
You can’t perform that action at this time.
0 commit comments