3v4l.org

run code in 500+ PHP versions simultaneously
<?php namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector\Fixture; final class SkipDefaultNumericStringParamInt { public function go(int $value = '1') { $this->execute($value); } private function execute(int $value) { echo $value; } } $obj = new SkipDefaultNumericStringParamInt(); $obj->go();
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.24, 8.2.0 - 8.2.11, 8.3.5
Fatal error: Cannot use string as default value for parameter $value of type int in /in/50JON on line 7
Process exited with code 255.

preferences:
53.43 ms | 774 KiB | 3 Q