Permalink
2 comments
on commit
sign in to comment.
Browse files
Implemented the RFC `Support Class Constant Visibility`.
Squashed commit of the following: commit f11ca0e Author: Dmitry Stogov <[email protected]> Date: Tue Dec 8 12:38:42 2015 +0300 Fixed test expectation commit 211f873 Author: Dmitry Stogov <[email protected]> Date: Tue Dec 8 12:28:38 2015 +0300 Embed zend_class_constant.flags into zend_class_constants.value.u2.access_flags commit 51deab8 Author: Dmitry Stogov <[email protected]> Date: Mon Dec 7 11:18:55 2015 +0300 Fixed issues found by Nikita commit 544dbd5 Author: Dmitry Stogov <[email protected]> Date: Sat Dec 5 02:41:05 2015 +0300 Refactored immplementation of https://wiki.php.net/rfc/class_const_visibility @reeze created an RFC here and I emailed internals here and didn't get any responses positive/negative.
- Loading branch information...
Showing
with
1,143 additions
and 126 deletions.
- +38 −4 Zend/zend_API.c
- +1 −0 Zend/zend_API.h
- +1 −1 Zend/zend_ast.h
- +28 −13 Zend/zend_compile.c
- +6 −0 Zend/zend_compile.h
- +23 −4 Zend/zend_constants.c
- +1 −0 Zend/zend_constants.h
- +38 −36 Zend/zend_inheritance.c
- +4 −4 Zend/zend_language_parser.y
- +22 −2 Zend/zend_opcode.c
- +4 −0 Zend/zend_types.h
- +7 −4 Zend/zend_vm_def.h
- +29 −20 Zend/zend_vm_execute.h
- +5 −3 ext/opcache/Optimizer/pass1_5.c
- +9 −2 ext/opcache/zend_accelerator_util_funcs.c
- +44 −2 ext/opcache/zend_file_cache.c
- +34 −1 ext/opcache/zend_persist.c
- +16 −1 ext/opcache/zend_persist_calc.c
- +334 −14 ext/reflection/php_reflection.c
- +2 −2 ext/reflection/tests/017.phpt
- +194 −0 ext/reflection/tests/ReflectionClassConstant_basic1.phpt
- +17 −4 ext/reflection/tests/ReflectionClass_toString_001.phpt
- +8 −3 ext/reflection/tests/ReflectionExtension_getClasses_basic.phpt
- +5 −5 ext/reflection/tests/bug29986.phpt
- +1 −1 ext/reflection/tests/bug45765.phpt
- +34 −0 tests/classes/constants_comments_001.phpt
- +23 −0 tests/classes/constants_visibility_001.phpt
- +30 −0 tests/classes/constants_visibility_002.phpt
- +30 −0 tests/classes/constants_visibility_003.phpt
- +28 −0 tests/classes/constants_visibility_004.phpt
- +10 −0 tests/classes/constants_visibility_005.phpt
- +11 −0 tests/classes/constants_visibility_006.phpt
- +10 −0 tests/classes/constants_visibility_007.phpt
- +16 −0 tests/classes/constants_visibility_error_001.phpt
- +16 −0 tests/classes/constants_visibility_error_002.phpt
- +16 −0 tests/classes/constants_visibility_error_003.phpt
- +16 −0 tests/classes/constants_visibility_error_004.phpt
- +12 −0 tests/classes/interface_constant_inheritance_005.phpt
- +10 −0 tests/classes/interface_constant_inheritance_006.phpt
- +10 −0 tests/classes/interface_constant_inheritance_007.phpt
Oops, something went wrong.
a75c195Hi, while playing with this (and other) new feature(s), I've noticed a bug in
ReflectionClassConstant::getValue(). When constant contains an expression referencing another constant, the result is incorrect.The output of this code is
UNKNOWN:0. If you swap the order of X and Y (so that Y is defined sooner), value is correct. Uncommenting the call to getConstants() also fixes the issue.(I'll report it on bugs.php.net eventually, later when I have more time.)
a75c195@Majkl578 Yeah, there's a couple of "update constant" operations missing in the new code. I'm on it.