3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = '8000000'; $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.0.30.0250.00616.82
8.0.20.0220.00816.87
8.0.10.0060.01216.89
8.0.00.0210.01016.91
7.4.160.0210.00516.39
7.4.150.0140.00616.49
7.4.140.0520.01216.43
7.4.130.0140.00716.41
7.4.120.0160.00616.36
7.4.110.0110.01116.55
7.4.100.0230.00916.56
7.4.90.0080.01216.58
7.4.80.0210.00516.23
7.4.70.0130.00916.41
7.4.60.0170.00616.38
7.4.50.0120.01716.26
7.4.40.0120.01216.40
7.4.30.0140.01316.41
7.4.20.0220.00316.39
7.4.10.0040.01816.37
7.4.00.0240.01216.45
7.3.280.0410.00616.05
7.3.270.0140.00316.07
7.3.260.0150.01816.16
7.3.250.0160.00516.19
7.3.240.0210.00316.02
7.3.230.0160.00416.06
7.3.220.0220.01116.11
7.3.210.0150.00716.11
7.3.200.0100.01516.15
7.3.190.0190.00316.05
7.3.180.0120.00816.29
7.3.170.0160.01116.08
7.3.160.0140.01415.91
7.3.150.0120.01216.04
7.3.140.0150.00616.18
7.3.130.0150.01216.08
7.3.120.0170.01016.10
7.3.110.0230.00816.00
7.3.100.0160.00316.10
7.3.90.0160.01016.34
7.3.80.0370.00916.02
7.3.70.0170.01416.26
7.3.60.0250.00716.41
7.3.50.0190.00516.37
7.3.40.0130.00816.34
7.3.30.0200.00316.27
7.3.20.0310.00916.26
7.3.10.0200.00616.25
7.3.00.0110.01116.25