File tree 2 files changed +21
-0
lines changed
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Uninitialized run-time cache when resolving default values
3
+ --FILE--
4
+ <?php
5
+
6
+ class Test {
7
+ public static function method ($ a = FOO , $ b = 1 ) {
8
+ echo "a = $ a, b = $ b \n" ;
9
+ }
10
+ }
11
+
12
+ define ('FOO ' , 42 );
13
+ call_user_func (['Test ' , 'method ' ], b: 0 );
14
+
15
+ ?>
16
+ --EXPECT--
17
+ a = 42, b = 0
Original file line number Diff line number Diff line change @@ -4464,6 +4464,10 @@ ZEND_API zend_result ZEND_FASTCALL zend_handle_undef_args(zend_execute_data *cal
4464
4464
if (EXPECTED (opline -> opcode == ZEND_RECV_INIT )) {
4465
4465
zval * default_value = RT_CONSTANT (opline , opline -> op2 );
4466
4466
if (Z_OPT_TYPE_P (default_value ) == IS_CONSTANT_AST ) {
4467
+ if (UNEXPECTED (!RUN_TIME_CACHE (op_array ))) {
4468
+ init_func_run_time_cache (op_array );
4469
+ }
4470
+
4467
4471
void * run_time_cache = RUN_TIME_CACHE (op_array );
4468
4472
zval * cache_val =
4469
4473
(zval * ) ((char * ) run_time_cache + Z_CACHE_SLOT_P (default_value ));
You can’t perform that action at this time.
0 commit comments