3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startTime = $this->microtime_float(); for ($i = 0; $i < $runCount; $i++) { if ($i == -1) { } elseif ($i == -2) { } else if ($i == -3) { } } $time = $this->microtime_float() - $startTime; echo str_pad("If/Else", 27) . " : " . number_format($time, 3) . " sec.\n"; return $time;
Output for 8.3.0 - 8.3.29, 8.4.1 - 8.4.16, 8.5.0 - 8.5.1
Fatal error: Uncaught Error: Using $this when not in object context in /in/LnR66:3 Stack trace: #0 {main} thrown in /in/LnR66 on line 3
Process exited with code 255.

preferences:
54.88 ms | 406 KiB | 5 Q