Skip to content

Commit 6592706

Browse files
committed
Fix comparison in case of constant NULL as default value
Fixes "Fatal error: Default value for parameters with a class type hint can only be NULL in ext/phar/phar.php on line 1120" whie creating phar.phar
1 parent ae7e663 commit 6592706

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Zend/zend_compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5293,7 +5293,7 @@ void zend_compile_params(zend_ast *ast TSRMLS_DC) {
52935293
zend_bool has_null_default = default_ast
52945294
&& (Z_TYPE(default_node.u.constant) == IS_NULL
52955295
|| (Z_TYPE(default_node.u.constant) == IS_CONSTANT
5296-
&& strcasecmp(Z_STRVAL(default_node.u.constant), "NULL"))
5296+
&& strcasecmp(Z_STRVAL(default_node.u.constant), "NULL") == 0)
52975297
|| Z_TYPE(default_node.u.constant) == IS_CONSTANT_AST); // ???
52985298

52995299
op_array->fn_flags |= ZEND_ACC_HAS_TYPE_HINTS;

0 commit comments

Comments
 (0)