3v4l.org

run code in 300+ PHP versions simultaneously
<?php $menu_slug = "pens-and-pencils"; $menu_title = "Pens and Pencils"; $tests = 10000; $loop = $tests; $a = hrtime(1); while ($loop > 0 ) { base_convert( substr( md5( $menu_slug . $menu_title ), -4 ), 16, 10 ) * 0.00001; $loop--; } var_dump( hrtime(1) - $a ); $loop = $tests; $a = hrtime(1); while ($loop > 0 ) { substr( base_convert( md5( $menu_slug . $menu_title ), 16, 10 ), -5 ) * 0.00001; $loop--; } var_dump( hrtime(1) - $a );

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.4.130.0100.02920.51
8.4.120.0070.02620.56
8.4.110.0110.03219.00
8.4.100.0100.03217.84
8.4.90.0120.03420.59
8.4.80.0120.04218.76
8.4.70.0070.03118.93
8.4.60.0090.05120.45
8.4.50.0110.04718.92
8.4.40.0030.04222.43
8.4.30.0070.02720.53
8.4.20.0140.05117.82
8.4.10.0030.03022.22
8.3.260.0110.02416.62
8.3.250.0160.03418.84
8.3.240.0100.02716.21
8.3.230.0050.01916.91
8.3.220.0080.02418.97
8.3.210.0060.03316.68
8.3.200.0080.02916.88
8.3.190.0040.02817.25
8.3.180.0110.03816.67
8.3.170.0000.03317.36
8.3.160.0070.05218.17
8.3.150.0030.05418.98
8.3.140.0070.07020.76
8.3.130.0120.02118.56
8.3.120.0030.03120.56
8.3.110.0070.02616.50
8.3.100.0000.03424.06
8.3.90.0070.03326.77
8.3.80.0070.04316.50
8.3.70.0100.05218.43
8.3.60.0130.07118.43
8.3.50.0130.06320.20
8.3.40.0030.05719.14
8.3.30.0140.04819.37
8.3.20.0070.02524.18
8.3.10.0060.02624.66
8.3.00.0060.02926.16
8.2.290.0130.02516.32
8.2.280.0110.04418.30
8.2.270.0140.05816.91
8.2.260.0070.02616.93
8.2.250.0060.02816.78
8.2.240.0030.03116.92
8.2.230.0070.02720.94
8.2.220.0030.03237.54
8.2.210.0160.04526.77
8.2.200.0100.03216.38
8.2.190.0160.04516.58
8.2.180.0100.05225.92
8.2.170.0100.05219.22
8.2.160.0100.05222.96
8.2.150.0030.03125.66
8.2.140.0030.02924.66
8.2.130.0100.02326.16
8.2.120.0060.02620.07
8.2.110.0060.02820.63
8.2.100.0070.02920.58
8.1.330.0120.04015.98
8.1.320.0120.03716.13
8.1.310.0070.06316.77
8.1.300.0000.03519.54
8.1.290.0030.03630.84
8.1.280.0100.05525.92
8.1.270.0030.03023.99
8.1.260.0070.03026.35
8.1.250.0000.03328.09
8.1.240.0100.02718.54
8.1.230.0030.03320.23
8.1.50.0050.04017.55
7.4.290.0030.04216.62
7.3.330.0070.04416.45

preferences:
79.29 ms | 403 KiB | 5 Q