summaryrefslogtreecommitdiff
path: root/ext/standard/assert.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/assert.c')
-rw-r--r--ext/standard/assert.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/ext/standard/assert.c b/ext/standard/assert.c
index 36f717085a..b88dbf80fb 100644
--- a/ext/standard/assert.c
+++ b/ext/standard/assert.c
@@ -114,16 +114,6 @@ PHP_MSHUTDOWN_FUNCTION(assert)
return SUCCESS;
}
-PHP_RINIT_FUNCTION(assert)
-{
- if (ASSERTG(cb)) {
- MAKE_STD_ZVAL(ASSERTG(callback));
- ZVAL_STRING(ASSERTG(callback), ASSERTG(cb), 1);
- }
-
- return SUCCESS;
-}
-
PHP_RSHUTDOWN_FUNCTION(assert)
{
if (ASSERTG(callback)) {
@@ -197,6 +187,11 @@ PHP_FUNCTION(assert)
RETURN_TRUE;
}
+ if (!ASSERTG(callback) && ASSERTG(cb)) {
+ MAKE_STD_ZVAL(ASSERTG(callback));
+ ZVAL_STRING(ASSERTG(callback), ASSERTG(cb), 1);
+ }
+
if (ASSERTG(callback)) {
zval *args[3];
zval *retval;
@@ -293,6 +288,8 @@ PHP_FUNCTION(assert_options)
case ASSERT_CALLBACK:
if (ASSERTG(callback) != NULL) {
RETVAL_ZVAL(ASSERTG(callback), 1, 0);
+ } else if (ASSERTG(cb)) {
+ RETVAL_STRING(ASSERTG(cb), 1);
} else {
RETVAL_NULL();
}