Skip to content

Commit fe359cf

Browse files
committed
Fix undefined function error message
This got fixed on 7.3, but the implementation is slightly different on master and the new test was failing.
1 parent 31375c5 commit fe359cf

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

Zend/zend_vm_def.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -784,16 +784,10 @@ ZEND_VM_COLD_HELPER(zend_undefined_function_helper, ANY, ANY)
784784
{
785785
USE_OPLINE
786786
zval *function_name;
787-
char *name;
788787

789788
SAVE_OPLINE();
790789
function_name = RT_CONSTANT(opline, opline->op2);
791-
if (opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME) {
792-
name = Z_STRVAL_P(function_name + 2);
793-
} else {
794-
name = Z_STRVAL_P(function_name);
795-
}
796-
zend_throw_error(NULL, "Call to undefined function %s()", name);
790+
zend_throw_error(NULL, "Call to undefined function %s()", Z_STRVAL_P(function_name));
797791
HANDLE_EXCEPTION();
798792
}
799793

Zend/zend_vm_execute.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -474,16 +474,10 @@ static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_un
474474
{
475475
USE_OPLINE
476476
zval *function_name;
477-
char *name;
478477

479478
SAVE_OPLINE();
480479
function_name = RT_CONSTANT(opline, opline->op2);
481-
if (opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME) {
482-
name = Z_STRVAL_P(function_name + 2);
483-
} else {
484-
name = Z_STRVAL_P(function_name);
485-
}
486-
zend_throw_error(NULL, "Call to undefined function %s()", name);
480+
zend_throw_error(NULL, "Call to undefined function %s()", Z_STRVAL_P(function_name));
487481
HANDLE_EXCEPTION();
488482
}
489483

0 commit comments

Comments
 (0)