3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = '0x8000000'; $data = substr($data, 2); //remove the 0x prefix from the string $data = str_replace(' ', '', $data); //remove the spaces from the string //$data is now '11210031' echo 'the product number is ' . $data[0] . "\n"; if ($data[1] == 1) { echo "this is a new product\n"; } else if ($data[1] == 2) { echo "this is a used product\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.3.40.0150.00418.66
8.3.30.0110.00418.84
8.3.20.0080.00024.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.170.0070.01118.79
8.2.160.0130.00022.96
8.2.150.0070.00025.66
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00426.35
8.2.110.0030.00622.08
8.2.100.0090.00317.91
8.2.90.0080.00017.63
8.2.80.0000.00818.96
8.2.70.0040.00717.93
8.2.60.0040.00418.22
8.2.50.0040.00418.10
8.2.40.0040.00421.14
8.2.30.0060.00619.35
8.2.20.0000.00818.21
8.2.10.0040.00419.21
8.2.00.0050.00219.18
8.1.270.0000.00724.66
8.1.260.0100.01028.09
8.1.250.0040.00428.09
8.1.240.0030.00622.46
8.1.230.0080.00317.70
8.1.220.0040.00417.78
8.1.210.0040.00418.77
8.1.200.0000.00817.22
8.1.190.0060.00317.22
8.1.180.0000.00918.10
8.1.170.0050.00318.37
8.1.160.0000.00820.73
8.1.150.0070.00018.86
8.1.140.0000.00718.88
8.1.130.0030.00320.13
8.1.120.0000.00817.35
8.1.110.0040.00717.35
8.1.100.0000.00717.48
8.1.90.0050.00217.46
8.1.80.0060.00317.41
8.1.70.0000.00717.45
8.1.60.0090.00317.50
8.1.50.0070.00417.40
8.1.40.0050.00317.36
8.1.30.0000.00817.63
8.1.20.0040.00417.63
8.1.10.0040.00417.43
8.1.00.0000.00817.45
8.0.300.0000.00718.77
8.0.290.0030.00616.63
8.0.280.0050.00318.43
8.0.270.0000.00816.73
8.0.260.0030.00318.43
8.0.250.0040.00416.86
8.0.240.0000.00716.98
8.0.230.0030.00316.94
8.0.220.0000.00816.91
8.0.210.0000.00716.80
8.0.200.0030.00316.81
8.0.190.0050.00317.01
8.0.180.0000.00716.80
8.0.170.0060.00316.84
8.0.160.0030.00516.89
8.0.150.0000.00816.80
8.0.140.0030.00316.76
8.0.130.0030.00313.33
8.0.120.0040.00416.86
8.0.110.0000.00716.82
8.0.100.0020.00516.75
8.0.90.0040.00417.00
8.0.80.0070.01416.91
8.0.70.0080.00016.91
8.0.60.0040.00416.67
8.0.50.0040.00416.95
8.0.30.0270.01016.80
8.0.20.0250.00816.87
8.0.10.0290.00616.98
8.0.00.0250.01016.93
7.4.330.0030.00315.55
7.4.320.0030.00316.43
7.4.300.0000.00616.51
7.4.290.0040.00416.54
7.4.280.0080.00016.48
7.4.270.0030.00316.52
7.4.260.0030.00313.25
7.4.250.0070.00016.48
7.4.240.0050.00316.48
7.4.230.0040.00416.39
7.4.220.0020.00516.64
7.4.210.0040.01016.46
7.4.200.0000.00716.25
7.4.160.0260.00416.59
7.4.150.0220.00816.44
7.4.140.0270.00816.40
7.4.130.0210.01116.34
7.4.120.0190.01116.39
7.4.110.0250.00916.34
7.4.100.0270.00816.38
7.4.90.0270.01616.47
7.4.80.0190.01316.47
7.4.70.0190.00816.37
7.4.60.0260.01016.24
7.4.50.0260.00316.30
7.4.40.0180.00916.29
7.4.30.0170.01116.37
7.4.20.0220.00616.29
7.4.10.0190.00716.34
7.4.00.0220.00716.41
7.3.330.0040.00416.25
7.3.320.0060.00013.14
7.3.310.0050.00216.29
7.3.300.0030.00316.25
7.3.290.0030.01316.25
7.3.280.0140.01416.08
7.3.270.0200.00816.13
7.3.260.0190.01116.16
7.3.250.0200.00916.14
7.3.240.0140.01416.07
7.3.230.0210.01016.15
7.3.220.0400.00316.14
7.3.210.0270.00916.13
7.3.200.0250.00516.11
7.3.190.0200.00816.07
7.3.180.0230.00816.17
7.3.170.0190.00916.09
7.3.160.0200.00716.09
7.3.150.0300.00616.12
7.3.140.0200.01016.06
7.3.130.0230.00716.07
7.3.120.0240.00516.14
7.3.110.0250.00316.06
7.3.100.0170.01416.06
7.3.90.0170.01116.28
7.3.80.0220.00716.12
7.3.70.0190.00816.22
7.3.60.0200.00716.31
7.3.50.0290.00716.30
7.3.40.0210.01116.26
7.3.30.0370.01116.31
7.3.20.0230.00616.27
7.3.10.0200.00916.24
7.3.00.0200.00816.29

preferences:
40.98 ms | 400 KiB | 5 Q