3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class SomethingTest { public function test() {} } $reflectionClass = new ReflectionClass('SomethingTest'); foreach($reflectionClass->getMethods(null) as $method) { print "$method\n"; }
Output for 7.2.18 - 7.2.25, 7.3.5 - 7.3.33, 7.4.0, 8.0.0, 8.1.23 - 8.1.28, 8.2.10 - 8.2.19, 8.3.0 - 8.3.7
Method [ <user> public method test ] { @@ /in/bCJPA 6 - 6 }
Output for 7.3.0 - 7.3.4
Fatal error: Uncaught TypeError: ReflectionClass::getMethods() expects parameter 1 to be int, null given in /in/bCJPA:11 Stack trace: #0 /in/bCJPA(11): ReflectionClass->getMethods(NULL) #1 {main} thrown in /in/bCJPA on line 11
Process exited with code 255.
Output for 7.2.17
Fatal error: Uncaught TypeError: ReflectionClass::getMethods() expects parameter 1 to be integer, null given in /in/bCJPA:11 Stack trace: #0 /in/bCJPA(11): ReflectionClass->getMethods(NULL) #1 {main} thrown in /in/bCJPA on line 11
Process exited with code 255.

preferences:
59.14 ms | 401 KiB | 42 Q