Skip to content

Commit

Permalink
Ensure that mocking exit/die works as before
Browse files Browse the repository at this point in the history
  • Loading branch information
cmb69 committed Nov 24, 2024
1 parent 1f7939a commit 8af6a49
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions uopz.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,12 @@ static PHP_FUNCTION(uopz_set_return)
return;
}

#ifndef ZEND_EXIT
if (clazz == NULL && zend_string_equals_literal_ci(function, "exit")) {
RETURN_TRUE;
}
#endif

RETURN_BOOL(uopz_set_return(clazz, function, variable, execute));
} /* }}} */

Expand All @@ -296,6 +302,12 @@ static PHP_FUNCTION(uopz_unset_return)
return;
}

#ifndef ZEND_EXIT
if (clazz == NULL && zend_string_equals_literal_ci(function, "exit")) {
RETURN_FALSE;
}
#endif

RETURN_BOOL(uopz_unset_return(clazz, function));
} /* }}} */

Expand Down

0 comments on commit 8af6a49

Please sign in to comment.