diff options
| -rw-r--r-- | NEWS | 2 | ||||
| -rw-r--r-- | Zend/tests/bug41640.phpt | 15 | ||||
| -rw-r--r-- | Zend/zend_builtin_functions.c | 2 |
3 files changed, 18 insertions, 1 deletions
@@ -19,6 +19,8 @@ PHP NEWS - Fixed money_format() not to accept multiple %i or %n tokens. (Stas, Ilia) - Fixed PECL bug #11216 (crash in ZipArchive::addEmptyDir when a directory already exists). (Pierre) +- Fixed bug #41640 (get_class_vars produces error on class constants). + (Johannes) - Fixed bug #41630 (segfault when an invalid color index is present in the image data). (Reported by Elliot <wccoder@gmail dot com>) (Pierre) - Fixed bug #41608 (segfault on a weird code with objects and switch()). diff --git a/Zend/tests/bug41640.phpt b/Zend/tests/bug41640.phpt new file mode 100644 index 0000000000..c859d90850 --- /dev/null +++ b/Zend/tests/bug41640.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #41640 (get_class_vars produces error on class constants) +--FILE-- +<?php +class foo { + const FOO = 1; + public $x = self::FOO; +} + +var_dump(get_class_vars("foo")); +--EXPECT-- +array(1) { + ["x"]=> + int(1) +} diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 0ce917d327..785709f51b 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -770,8 +770,8 @@ ZEND_FUNCTION(get_class_vars) RETURN_FALSE; } else { array_init(return_value); - add_class_vars(*pce, &(*pce)->default_properties, return_value TSRMLS_CC); zend_update_class_constants(*pce TSRMLS_CC); + add_class_vars(*pce, &(*pce)->default_properties, return_value TSRMLS_CC); add_class_vars(*pce, CE_STATIC_MEMBERS(*pce), return_value TSRMLS_CC); } } |
