@@ -1042,13 +1042,25 @@ static int do_cli(int argc, char **argv) /* {{{ */
10421042 }
10431043
10441044 ZVAL_STRING (& arg , reflection_what );
1045- object_init_ex (& ref , pce );
10461045
10471046 memset (& execute_data , 0 , sizeof (zend_execute_data ));
10481047 execute_data .func = (zend_function * ) & zend_pass_function ;
10491048 EG (current_execute_data ) = & execute_data ;
1050- zend_call_known_instance_method_with_1_params (
1051- pce -> constructor , Z_OBJ (ref ), NULL , & arg );
1049+ // Avoid deprecation warnings from ReflectionMethod::__construct()
1050+ // with one argument
1051+ if (pce == reflection_method_ptr ) {
1052+ zend_function * create_from_method = zend_hash_str_find_ptr (
1053+ & (pce -> function_table ),
1054+ "createfrommethodname" ,
1055+ strlen ( "createFromMethodName" )
1056+ );
1057+ zend_call_known_function (
1058+ create_from_method , NULL , pce , & ref , 1 , & arg , NULL );
1059+ } else {
1060+ object_init_ex (& ref , pce );
1061+ zend_call_known_instance_method_with_1_params (
1062+ pce -> constructor , Z_OBJ (ref ), NULL , & arg );
1063+ }
10521064
10531065 if (EG (exception )) {
10541066 zval rv ;
0 commit comments