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.5.20.0110.00720.00
8.5.10.0110.00816.79
8.5.00.0050.00421.91
8.4.170.0120.01023.99
8.4.160.0100.01123.68
8.4.150.0020.00114.05
8.4.140.0160.00617.84
8.4.130.0110.00618.06
8.4.120.0120.00824.42
8.4.110.0060.00319.07
8.4.100.0090.00517.77
8.4.90.0130.00818.95
8.4.80.0040.00417.96
8.4.70.0070.00317.66
8.4.60.0090.01217.61
8.4.50.0120.00818.95
8.4.40.0100.00718.46
8.4.30.0130.01018.79
8.4.20.0150.00621.05
8.4.10.0040.01519.41
8.3.300.0150.00520.57
8.3.290.0110.00920.88
8.3.280.0070.01318.38
8.3.270.0110.00916.62
8.3.260.0060.00316.37
8.3.250.0060.00719.10
8.3.240.0140.00617.09
8.3.230.0030.00716.57
8.3.220.0040.00319.04
8.3.210.0070.01016.66
8.3.200.0050.00516.63
8.3.190.0090.00616.43
8.3.180.0060.00616.62
8.3.170.0040.01420.66
8.3.160.0100.01018.35
8.3.150.0120.00617.20
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.300.0140.01118.09
8.2.290.0060.00920.39
8.2.280.0040.00518.51
8.2.270.0070.01117.38
8.2.260.0090.00616.86
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.340.0100.01317.64
8.1.330.0130.00621.82
8.1.320.0090.01016.11
8.1.310.0040.00418.15
8.1.300.0120.00617.81
8.1.290.0100.01030.84

preferences:
76.02 ms | 403 KiB | 5 Q