@@ -1058,13 +1058,25 @@ static int do_cli(int argc, char **argv) /* {{{ */
10581058 }
10591059
10601060 ZVAL_STRING (& arg , reflection_what );
1061- object_init_ex (& ref , pce );
10621061
10631062 memset (& execute_data , 0 , sizeof (zend_execute_data ));
10641063 execute_data .func = (zend_function * ) & zend_pass_function ;
10651064 EG (current_execute_data ) = & execute_data ;
1066- zend_call_known_instance_method_with_1_params (
1067- pce -> constructor , Z_OBJ (ref ), NULL , & arg );
1065+ // Avoid deprecation warnings from ReflectionMethod::__construct()
1066+ // with one argument
1067+ if (pce == reflection_method_ptr ) {
1068+ zend_function * create_from_method = zend_hash_str_find_ptr (
1069+ & (pce -> function_table ),
1070+ "createfrommethodname" ,
1071+ strlen ( "createFromMethodName" )
1072+ );
1073+ zend_call_known_function (
1074+ create_from_method , NULL , pce , & ref , 1 , & arg , NULL );
1075+ } else {
1076+ object_init_ex (& ref , pce );
1077+ zend_call_known_instance_method_with_1_params (
1078+ pce -> constructor , Z_OBJ (ref ), NULL , & arg );
1079+ }
10681080
10691081 if (EG (exception )) {
10701082 zval rv ;
0 commit comments