3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test_cases = array( "abc.txt" => '.', "https://3v4l.org/?foo" => '?', "https://3v4l.org/#bar" => '#', $_SERVER['PATH'] => ':', "PHP 8.3.8" => ' ', "192.168.1.1" => '.', "foo\nbar" => "\n", "snake_case" => '_', ); foreach ($test_cases as $string => $char) { if (strtok($string,$char)==pathinfo($string, PATHINFO_FILENAME)) { echo "\n\nSUCCESS: {$string} => {$char}"; } else { $string = str_replace("\n","\\n",$string); $char = str_replace("\n","\\n",$char); echo "\n\nFAILED: {$string} => {$char}"; echo "\n- strtok(): " . strtok($string,$char); echo "\n- pathinfo(): " . pathinfo($string, PATHINFO_FILENAME); }; }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.140.0060.01220.69
8.3.130.0030.00618.28
8.3.120.0110.00718.77
8.3.110.0060.00320.94
8.3.100.0060.00324.06
8.3.90.0050.00326.77
8.3.80.0160.00730.84
8.3.70.0000.00830.84
8.3.50.0070.01430.84
8.2.250.0090.00918.44
8.2.240.0090.00618.70
8.2.230.0080.00022.58
8.2.220.0060.00337.54
8.2.210.0120.00626.77
8.2.200.0120.00630.84
8.2.190.0150.00330.84
8.1.300.0120.00617.81
8.1.290.0100.01030.84

preferences:
13.72 ms | 403 KiB | 5 Q