3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace foo; const N = 100_000_000; function without_backslash() { $start = \hrtime(true); $tmp = []; for($i = 0; $i < 10000; $i++) { $tmp[] = strtoupper("test" . $i); } $stop = \hrtime(true); \printf("Without backslash: %f s\n", ($stop - $start)/1e9); } function with_backslash() { $start = \hrtime(true); $tmp = []; for($i = 0; $i < 10000; $i++) { $tmp[] = \strtoupper("test" . $i); } $stop = \hrtime(true); \printf("With backslash: %f s\n", ($stop - $start)/1e9); } without_backslash(); with_backslash(); printf("\n"); without_backslash(); with_backslash(); printf("\n"); without_backslash(); with_backslash(); printf("\n"); without_backslash(); with_backslash(); printf("\n");

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.120.0100.00821.38
8.4.110.0110.02019.29
8.4.100.0120.01818.21
8.4.90.0130.01318.45
8.4.80.0160.01318.43
8.4.70.0170.01618.41
8.4.60.0170.01518.17
8.4.50.0040.00919.57
8.4.40.0100.02318.34
8.4.30.0070.01821.02
8.4.20.0130.02018.52
8.4.10.0040.01224.12
8.3.250.0100.01819.66
8.3.240.0120.01619.51
8.3.230.0140.01417.14
8.3.220.0040.00721.44
8.3.210.0090.01217.13
8.3.200.0080.02317.05
8.3.190.0090.02318.22
8.3.180.0080.02117.57
8.3.170.0030.02620.98
8.3.160.0160.01319.98
8.3.150.0030.01020.67
8.3.140.0000.01317.95
8.3.130.0060.00618.66
8.3.120.0090.00619.72
8.3.110.0030.02319.03
8.3.100.0000.01317.24
8.3.90.0080.02326.77
8.3.80.0120.00618.05
8.3.70.0230.01317.13
8.3.60.0070.01718.41
8.3.50.0120.02218.17
8.3.40.0100.01322.36
8.3.30.0030.02019.84
8.3.20.0030.01024.18
8.3.10.0050.00824.66
8.3.00.0030.00926.16
8.2.290.0120.01719.39
8.2.280.0130.01817.04
8.2.270.0030.02618.69
8.2.260.0070.02318.32
8.2.250.0100.01417.19
8.2.240.0030.00919.34
8.2.230.0000.01420.94
8.2.220.0000.01424.06
8.2.210.0080.00826.77
8.2.200.0100.00717.25
8.2.190.0100.02417.13
8.2.180.0070.01718.38
8.2.170.0130.02019.39
8.2.160.0160.00622.96
8.2.150.0060.00625.66
8.2.140.0000.01224.66
8.2.130.0060.00626.16
8.2.120.0030.00919.89
8.2.110.0030.01421.19
8.2.100.0070.01418.53
8.1.330.0090.01817.07
8.1.320.0080.02417.12
8.1.310.0090.02117.49
8.1.300.0070.02017.78
8.1.290.0040.01130.84
8.1.280.0120.01525.92
8.1.270.0000.01324.66
8.1.260.0080.00426.35
8.1.250.0030.01028.09
8.1.240.0070.01020.73
8.1.230.0050.01421.15

preferences:
33.46 ms | 403 KiB | 5 Q