From 659270634039cadbd877b6c9c5ad36bb81950654 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Johannes=20Schl=C3=BCter?= Date: Fri, 29 Aug 2014 01:34:46 +0200 Subject: [PATCH] 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 --- Zend/zend_compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index ed95d7eb62..63ca671d93 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -5293,7 +5293,7 @@ void zend_compile_params(zend_ast *ast TSRMLS_DC) { zend_bool has_null_default = default_ast && (Z_TYPE(default_node.u.constant) == IS_NULL || (Z_TYPE(default_node.u.constant) == IS_CONSTANT - && strcasecmp(Z_STRVAL(default_node.u.constant), "NULL")) + && strcasecmp(Z_STRVAL(default_node.u.constant), "NULL") == 0) || Z_TYPE(default_node.u.constant) == IS_CONSTANT_AST); // ??? op_array->fn_flags |= ZEND_ACC_HAS_TYPE_HINTS; -- 2.40.0