com php-src: Fix comparison in case of constant NULL as default value: Zend/zend_compile.c
| From: | Johannes Schlüter | Date: | Thu, 28 Aug 2014 23:34:46 +0000 |
| Subject: | com php-src: Fix comparison in case of constant NULL as default value: Zend/zend_compile.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81277@lists.php.net to get a copy of this message | ||
Commit: 659270634039cadbd877b6c9c5ad36bb81950654
Author: Johannes Schlüter <johannes@php.net> Fri, 29 Aug 2014 01:34:46 +0200
Parents: ae7e663330b241bf7906551f9e801223aa067dbf
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=659270634039cadbd877b6c9c5ad36bb81950654
Log:
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
Changed paths:
M Zend/zend_compile.c
Diff:
diff --git a/Zend/zend_compile.c b/Zend/zend_compile..c
index ed95d7e..63ca671 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;