From 1351bc4e86cbf2375bef99c8f068b7e8bc7788a6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Johannes=20Schl=C3=BCter?= Date: Sat, 9 Jun 2007 08:38:44 +0000 Subject: [PATCH] Fix #41640 (get_class_vars produces error on class constants) --- NEWS | 2 ++ Zend/tests/bug41640.phpt | 15 +++++++++++++++ Zend/zend_builtin_functions.c | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 Zend/tests/bug41640.phpt diff --git a/NEWS b/NEWS index dd632c5718..7f299024ff 100644 --- a/NEWS +++ b/NEWS @@ -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 ) (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-- + + 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); } } -- 2.50.1