Skip to content

Commit

Permalink
Merge pull request #517 from robocoder/zend-empty-string-patch
Browse files Browse the repository at this point in the history
zend_empty_string was added in php 7.2
  • Loading branch information
EmielBruijntjes authored Nov 22, 2023
2 parents 3818048 + f2faf7e commit d2dc9b7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions zend/classimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,11 @@ zend_result ClassImpl::getClosure(ZEND_OBJECT_OR_ZVAL object, zend_class_entry *
function->arg_flags[1] = 0;
function->arg_flags[2] = 0;
function->fn_flags = ZEND_ACC_CALL_VIA_HANDLER;
#if PHP_VERSION_ID < 70200
zend_string *zend_empty_string = zend_string_alloc(sizeof("")-1, 1);
ZSTR_VAL(zend_empty_string)[0] = '\0';
ZSTR_LEN(zend_empty_string) = 0;
#endif
function->function_name = zend_empty_string; // should not be null, as this is free'ed by zend when doing exception handling
function->scope = *entry_ptr;
function->prototype = nullptr;
Expand Down

0 comments on commit d2dc9b7

Please sign in to comment.