3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); $a = [1233=>true]; /** * @param array<int, bool> $a */ function a(array $a): void { $l = (string) array_key_last($a); !function_exists('\PHPStan\dumpType')?:\PHPStan\dumpType($l); $s = substr($l, 0, 2); !function_exists('\PHPStan\dumpType')?:\PHPStan\dumpType($s); if ($s === '') { ; } else { var_dump($s); } } a($a);

preferences:
106.07 ms | 480 KiB | 5 Q