File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,7 @@ static zend_function *scalar_objects_get_indirection_func(
159
159
ind -> fn .handler = scalar_objects_indirection_func ;
160
160
ind -> fn .scope = ce ;
161
161
ind -> fn .fn_flags = ZEND_ACC_CALL_VIA_HANDLER | (fbc -> common .fn_flags & keep_flags );
162
+ ind -> fn .fn_flags |= ZEND_ACC_USER_ARG_INFO ;
162
163
ind -> fn .num_args = fbc -> common .num_args - 1 ;
163
164
ind -> fn .required_num_args = fbc -> common .required_num_args - 1 ;
164
165
#if PHP_VERSION_ID >= 80000
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Named parameters
3
+ --SKIPIF--
4
+ <?php
5
+ if (PHP_VERSION_ID < 80000 ) die ('skip For PHP >= 8.0 only ' );
6
+ ?>
7
+ --FILE--
8
+ <?php
9
+
10
+ register_primitive_type_handler ('string ' , 'StringHandler ' );
11
+
12
+ class StringHandler {
13
+ public static function test ($ self , $ prefix = '' , $ suffix = '' ) {
14
+ return $ prefix . $ self . $ suffix ;
15
+ }
16
+ }
17
+
18
+ $ string = "Test " ;
19
+ var_dump ($ string ->test (prefix: "P " ));
20
+ var_dump ($ string ->test (suffix: "S " ));
21
+ var_dump ($ string ->test (prefix: "P " , suffix: "S " ));
22
+ var_dump ($ string ->test (suffix: "S " , prefix: "P " ));
23
+
24
+ ?>
25
+ --EXPECT--
26
+ string(5) "PTest"
27
+ string(5) "TestS"
28
+ string(6) "PTestS"
29
+ string(6) "PTestS"
You can’t perform that action at this time.
0 commit comments