Skip to content

Commit f2faf7e

Browse files
committed
zend_empty_string was added in php 7.2
1 parent 3818048 commit f2faf7e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

zend/classimpl.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,11 @@ zend_result ClassImpl::getClosure(ZEND_OBJECT_OR_ZVAL object, zend_class_entry *
311311
function->arg_flags[1] = 0;
312312
function->arg_flags[2] = 0;
313313
function->fn_flags = ZEND_ACC_CALL_VIA_HANDLER;
314+
#if PHP_VERSION_ID < 70200
315+
zend_string *zend_empty_string = zend_string_alloc(sizeof("")-1, 1);
316+
ZSTR_VAL(zend_empty_string)[0] = '\0';
317+
ZSTR_LEN(zend_empty_string) = 0;
318+
#endif
314319
function->function_name = zend_empty_string; // should not be null, as this is free'ed by zend when doing exception handling
315320
function->scope = *entry_ptr;
316321
function->prototype = nullptr;

0 commit comments

Comments
 (0)