3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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());
based on 3P0q4
Output for 7.2.0
string(39) "class@anonymous/in/VCcUU0x7f2982de31fc" string(39) "class@anonymous/in/VCcUU0x7f2982de33f5"
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.4.11 - 5.6.28
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/VCcUU on line 3
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_CLASS in /in/VCcUU on line 3
Process exited with code 255.