4545use const PHP_MAJOR_VERSION ;
4646use const PHP_MINOR_VERSION ;
4747use const PHP_VERSION ;
48+ use const PHP_VERSION_ID ;
4849
4950/** @group callmap */
5051class InternalCallMapHandlerTest extends TestCase
@@ -78,8 +79,8 @@ class InternalCallMapHandlerTest extends TestCase
7879 'array_multisort ' ,
7980 'datefmt_create ' => ['8.0 ' ],
8081 'fiber::start ' ,
81- 'get_class ' => ['8.3 ' ],
82- 'get_parent_class ' => ['8.3 ' ],
82+ 'get_class ' => ['8.3 ' , ' 8.4 ' ],
83+ 'get_parent_class ' => ['8.3 ' , ' 8.4 ' ],
8384 'imagefilledpolygon ' ,
8485 'imagegd ' ,
8586 'imagegd2 ' ,
@@ -97,7 +98,7 @@ class InternalCallMapHandlerTest extends TestCase
9798 'mailparse_msg_get_structure ' ,
9899 'mailparse_msg_parse ' ,
99100 'mailparse_stream_encode ' ,
100- 'mb_check_encoding ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
101+ 'mb_check_encoding ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
101102 'memcached::cas ' , // memcached 3.2.0 has incorrect reflection
102103 'memcached::casbykey ' , // memcached 3.2.0 has incorrect reflection
103104 'oauth::fetch ' ,
@@ -175,60 +176,60 @@ class InternalCallMapHandlerTest extends TestCase
175176 * @var array<int|string, string|list<string>>
176177 */
177178 private static array $ ignoredReturnTypeOnlyFunctions = [
178- 'appenditerator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
179- 'appenditerator::getiteratorindex ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
180- 'cachingiterator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
181- 'callbackfilteriterator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
179+ 'appenditerator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
180+ 'appenditerator::getiteratorindex ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
181+ 'cachingiterator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
182+ 'callbackfilteriterator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
182183 'curl_multi_getcontent ' ,
183- 'datetime::add ' => ['8.1 ' , '8.2 ' , '8.3 ' ], // DateTime does not contain static
184- 'datetime::modify ' => ['8.1 ' , '8.2 ' , '8.3 ' ], // DateTime does not contain static
185- 'datetime::createfromformat ' => ['8.1 ' , '8.2 ' , '8.3 ' ], // DateTime does not contain static
184+ 'datetime::add ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ], // DateTime does not contain static
185+ 'datetime::modify ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ], // DateTime does not contain static
186+ 'datetime::createfromformat ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ], // DateTime does not contain static
186187 'datetime::createfromimmutable ' => ['8.1 ' ],
187188 'datetime::createfrominterface ' ,
188- 'datetime::setdate ' => ['8.1 ' , '8.2 ' , '8.3 ' ], // DateTime does not contain static
189- 'datetime::setisodate ' => ['8.1 ' , '8.2 ' , '8.3 ' ], // DateTime does not contain static
190- 'datetime::settime ' => ['8.1 ' , '8.2 ' , '8.3 ' ], // DateTime does not contain static
191- 'datetime::settimestamp ' => ['8.1 ' , '8.2 ' , '8.3 ' ], // DateTime does not contain static
192- 'datetime::settimezone ' => ['8.1 ' , '8.2 ' , '8.3 ' ], // DateTime does not contain static
193- 'datetime::sub ' => ['8.1 ' , '8.2 ' , '8.3 ' ], // DateTime does not contain static
189+ 'datetime::setdate ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ], // DateTime does not contain static
190+ 'datetime::setisodate ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ], // DateTime does not contain static
191+ 'datetime::settime ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ], // DateTime does not contain static
192+ 'datetime::settimestamp ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ], // DateTime does not contain static
193+ 'datetime::settimezone ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ], // DateTime does not contain static
194+ 'datetime::sub ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ], // DateTime does not contain static
194195 'datetimeimmutable::createfrominterface ' ,
195196 'fiber::getcurrent ' ,
196- 'filteriterator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
197+ 'filteriterator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
197198 'get_cfg_var ' , // Ignore array return type
198- 'infiniteiterator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
199- 'iteratoriterator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
200- 'limititerator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
201- 'locale::getallvariants ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
202- 'locale::getkeywords ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
203- 'locale::getprimarylanguage ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
204- 'locale::getregion ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
205- 'locale::getscript ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
206- 'locale::parselocale ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
207- 'messageformatter::create ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
208- 'multipleiterator::current ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
209- 'mysqli::get_charset ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
210- 'mysqli_stmt::get_warnings ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
199+ 'infiniteiterator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
200+ 'iteratoriterator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
201+ 'limititerator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
202+ 'locale::getallvariants ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
203+ 'locale::getkeywords ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
204+ 'locale::getprimarylanguage ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
205+ 'locale::getregion ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
206+ 'locale::getscript ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
207+ 'locale::parselocale ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
208+ 'messageformatter::create ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
209+ 'multipleiterator::current ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
210+ 'mysqli::get_charset ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
211+ 'mysqli_stmt::get_warnings ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
211212 'mysqli_stmt_get_warnings ' ,
212213 'mysqli_stmt_insert_id ' ,
213- 'norewinditerator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
214+ 'norewinditerator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
214215 'passthru ' ,
215- 'recursivecachingiterator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
216- 'recursivecallbackfilteriterator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
217- 'recursivefilteriterator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
218- 'recursiveregexiterator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
216+ 'recursivecachingiterator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
217+ 'recursivecallbackfilteriterator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
218+ 'recursivefilteriterator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
219+ 'recursiveregexiterator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
219220 'reflectionclass::getstaticproperties ' => ['8.1 ' , '8.2 ' ],
220- 'reflectionclass::newinstanceargs ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
221- 'reflectionfunction::getclosurescopeclass ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
222- 'reflectionfunction::getclosurethis ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
223- 'reflectionmethod::getclosurescopeclass ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
224- 'reflectionmethod::getclosurethis ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
221+ 'reflectionclass::newinstanceargs ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
222+ 'reflectionfunction::getclosurescopeclass ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
223+ 'reflectionfunction::getclosurethis ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
224+ 'reflectionmethod::getclosurescopeclass ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
225+ 'reflectionmethod::getclosurethis ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
225226 'reflectionobject::getstaticproperties ' => ['8.1 ' , '8.2 ' ],
226- 'reflectionobject::newinstanceargs ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
227- 'regexiterator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
227+ 'reflectionobject::newinstanceargs ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
228+ 'regexiterator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
228229 'register_shutdown_function ' => ['8.0 ' , '8.1 ' ],
229- 'splfileobject::fscanf ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
230- 'spltempfileobject::fscanf ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
231- 'xsltprocessor::transformtoxml ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
230+ 'splfileobject::fscanf ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
231+ 'spltempfileobject::fscanf ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
232+ 'xsltprocessor::transformtoxml ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
232233 ];
233234
234235 /**
@@ -519,7 +520,12 @@ private function getReflectionFunction(string $functionName): ?ReflectionFunctio
519520 {
520521 try {
521522 if (strpos ($ functionName , ':: ' ) !== false ) {
522- return new ReflectionMethod ($ functionName );
523+ if (PHP_VERSION_ID < 8_03_00 ) {
524+ [$ className , , $ methodName ] = explode (': ' , $ functionName , 3 );
525+ return new ReflectionMethod ($ className , $ methodName );
526+ }
527+
528+ return ReflectionMethod::createFromMethodName ($ functionName );
523529 }
524530
525531 /** @var callable-string $functionName */
0 commit comments