3v4l.org

run code in 300+ PHP versions simultaneously
<?php $obj = new class { /** @var \PHPStan\Parser\Parser */ private $parser; /** @var \PHPStan\Parser\FunctionCallStatementFinder */ private $functionCallStatementFinder; public function create(\PHPStan\Reflection\ClassReflection $declaringClass, \ReflectionMethod $reflection) : \PHPStan\Reflection\Php\PhpMethodReflection { return new \PHPStan\Reflection\Php\PhpMethodReflection($declaringClass, $reflection, $this->parser, $this->functionCallStatementFinder, true); } }; $obj2 = new class { /** @var \PHPStan\Parser\Parser */ private $parser; /** @var \PHPStan\Parser\FunctionCallStatementFinder */ private $functionCallStatementFinder; public function create(\PHPStan\Reflection\ClassReflection $declaringClass, \ReflectionMethod $reflection) : \PHPStan\Reflection\Php\PhpMethodReflection { return new \PHPStan\Reflection\Php\PhpMethodReflection($declaringClass, $reflection, $this->parser, $this->functionCallStatementFinder, true); } }; var_dump((new \ReflectionClass($obj))->getName()); var_dump((new \ReflectionClass($obj2))->getName());
Output for 7.4.3 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
string(29) "class@anonymous/in/VCcUU:3$0" string(30) "class@anonymous/in/VCcUU:14$1"
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 string(29) "class@anonymous/in/VCcUU:3$0" string(30) "class@anonymous/in/VCcUU:14$1"
Output for 7.4.0
string(39) "class@anonymous/in/VCcUU0x7f46f48736fc" string(39) "class@anonymous/in/VCcUU0x7f46f48738f5"
Output for 7.3.33
string(39) "class@anonymous/in/VCcUU0x7f9a1a18c1fc" string(39) "class@anonymous/in/VCcUU0x7f9a1a18c3f5"
Output for 7.3.32
string(39) "class@anonymous/in/VCcUU0x7f907fb2c1fc" string(39) "class@anonymous/in/VCcUU0x7f907fb2c3f5"
Output for 7.3.31
string(39) "class@anonymous/in/VCcUU0x7f3cc0f551fc" string(39) "class@anonymous/in/VCcUU0x7f3cc0f553f5"
Output for 7.3.30
string(39) "class@anonymous/in/VCcUU0x7f250354f1fc" string(39) "class@anonymous/in/VCcUU0x7f250354f3f5"
Output for 7.3.29
string(39) "class@anonymous/in/VCcUU0x7f3fbd68d1fc" string(39) "class@anonymous/in/VCcUU0x7f3fbd68d3f5"
Output for 7.3.28
string(39) "class@anonymous/in/VCcUU0x7f077f3571fc" string(39) "class@anonymous/in/VCcUU0x7f077f3573f5"
Output for 7.3.27
string(39) "class@anonymous/in/VCcUU0x7fee7f49b1fc" string(39) "class@anonymous/in/VCcUU0x7fee7f49b3f5"
Output for 7.3.26
string(39) "class@anonymous/in/VCcUU0x7f06ded261fc" string(39) "class@anonymous/in/VCcUU0x7f06ded263f5"
Output for 7.3.25
string(39) "class@anonymous/in/VCcUU0x7ff621e4c1fc" string(39) "class@anonymous/in/VCcUU0x7ff621e4c3f5"
Output for 7.3.24
string(39) "class@anonymous/in/VCcUU0x7fa6a72f11fc" string(39) "class@anonymous/in/VCcUU0x7fa6a72f13f5"
Output for 7.3.23
string(39) "class@anonymous/in/VCcUU0x7fae4948f1fc" string(39) "class@anonymous/in/VCcUU0x7fae4948f3f5"
Output for 7.3.21
string(39) "class@anonymous/in/VCcUU0x7faa02b371fc" string(39) "class@anonymous/in/VCcUU0x7faa02b373f5"
Output for 7.3.20
string(39) "class@anonymous/in/VCcUU0x7f34836f91fc" string(39) "class@anonymous/in/VCcUU0x7f34836f93f5"
Output for 7.3.19
string(39) "class@anonymous/in/VCcUU0x7f98434241fc" string(39) "class@anonymous/in/VCcUU0x7f98434243f5"
Output for 7.3.18
string(39) "class@anonymous/in/VCcUU0x7f02071d01fc" string(39) "class@anonymous/in/VCcUU0x7f02071d03f5"
Output for 7.3.17
string(39) "class@anonymous/in/VCcUU0x7fe98d48d1fc" string(39) "class@anonymous/in/VCcUU0x7fe98d48d3f5"
Output for 7.3.16
string(39) "class@anonymous/in/VCcUU0x7fde9ac601fc" string(39) "class@anonymous/in/VCcUU0x7fde9ac603f5"
Output for 7.2.33
string(39) "class@anonymous/in/VCcUU0x7fcfe41461fc" string(39) "class@anonymous/in/VCcUU0x7fcfe41463f5"
Output for 7.2.32
string(39) "class@anonymous/in/VCcUU0x7f16d494c1fc" string(39) "class@anonymous/in/VCcUU0x7f16d494c3f5"
Output for 7.2.31
string(39) "class@anonymous/in/VCcUU0x7f498aa541fc" string(39) "class@anonymous/in/VCcUU0x7f498aa543f5"
Output for 7.2.30
string(39) "class@anonymous/in/VCcUU0x7fe674c7a1fc" string(39) "class@anonymous/in/VCcUU0x7fe674c7a3f5"
Output for 7.2.29
string(39) "class@anonymous/in/VCcUU0x7f01541401fc" string(39) "class@anonymous/in/VCcUU0x7f01541403f5"
Output for 7.2.6
string(39) "class@anonymous/in/VCcUU0x7f6f2c8961fc" string(39) "class@anonymous/in/VCcUU0x7f6f2c8963f5"
Output for 7.2.0
string(39) "class@anonymous/in/VCcUU0x7f2982de31fc" string(39) "class@anonymous/in/VCcUU0x7f2982de33f5"
Output for 7.1.20
string(39) "class@anonymous/in/VCcUU0x7f89a1aef1fc" string(39) "class@anonymous/in/VCcUU0x7f89a1aef3f5"
Output for 7.1.10
string(39) "class@anonymous/in/VCcUU0x7f80650311fc" string(39) "class@anonymous/in/VCcUU0x7f80650313f5"
Output for 7.1.7
string(39) "class@anonymous/in/VCcUU0x7f385a8351fc" string(39) "class@anonymous/in/VCcUU0x7f385a8353f5"
Output for 7.1.6
string(39) "class@anonymous/in/VCcUU0x7f530c6651fc" string(39) "class@anonymous/in/VCcUU0x7f530c6653f5"
Output for 7.1.5
string(39) "class@anonymous/in/VCcUU0x7f05ae3461fc" string(39) "class@anonymous/in/VCcUU0x7f05ae3463f5"
Output for 7.1.0
string(39) "class@anonymous/in/VCcUU0x7f8049e821fc" string(39) "class@anonymous/in/VCcUU0x7f8049e823f5"
Output for 7.0.20
string(39) "class@anonymous/in/VCcUU0x7f1e0b7421fc" string(39) "class@anonymous/in/VCcUU0x7f1e0b7423f5"
Output for 7.0.6
string(39) "class@anonymous/in/VCcUU0x7f91ecf061fc" string(39) "class@anonymous/in/VCcUU0x7f91ecf063f5"
Output for 7.0.5
string(39) "class@anonymous/in/VCcUU0x7f4dd31cc1fc" string(39) "class@anonymous/in/VCcUU0x7f4dd31cc3f5"
Output for 7.0.4
string(39) "class@anonymous/in/VCcUU0x7f4cf3bf71fc" string(39) "class@anonymous/in/VCcUU0x7f4cf3bf73f5"
Output for 7.0.3
string(39) "class@anonymous/in/VCcUU0x7fb5579171fc" string(39) "class@anonymous/in/VCcUU0x7fb5579173f5"
Output for 7.0.2
string(39) "class@anonymous/in/VCcUU0x7f2880fa01fc" string(39) "class@anonymous/in/VCcUU0x7f2880fa03f5"
Output for 7.0.1
string(39) "class@anonymous/in/VCcUU0x7f488f53f1fc" string(39) "class@anonymous/in/VCcUU0x7f488f53f3f5"
Output for 7.0.0
string(39) "class@anonymous/in/VCcUU0x7f8cfc8031fc" string(39) "class@anonymous/in/VCcUU0x7f8cfc8033f5"
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/VCcUU on line 3
Process exited with code 255.

preferences:
182.02 ms | 402 KiB | 183 Q