3v4l.org

run code in 300+ PHP versions simultaneously
<?php $products = array(); class Products { public $chemID; public $catID; } $prod1 = new Products; $prod1->chemID=1; $prod1->catID=1; array_push($products,$prod1); for($i = 1; $i < 5; $i++) { ${'prod'.$i} = new Products; ${'prod'.$i}->chemID = $i; ${'prod'.$i}->catID = $i; array_push($products,${'prod'.$i}); } $carts = (object)array(array("chemID"=> 1, "catID" => 4),array("chemID"=> 2, "catID" => 4), array("chemID"=> 1, "catID" => 1)); var_dump($carts); foreach($products as $pkey=>$pobj) { foreach($carts as $ckey=>$cvalue) { echo $ckey . ' ' .$cvalue; } }

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.60.0110.00716.63
8.3.50.0100.00821.96
8.3.40.0120.00918.84
8.3.30.0090.00618.49
8.3.20.0000.00820.21
8.3.10.0000.00823.58
8.3.00.0080.00019.25
8.2.180.0150.00318.55
8.2.170.0090.00622.96
8.2.160.0060.00920.52
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0040.00419.54
8.2.110.0060.00320.91
8.2.100.0040.00817.93
8.2.90.0050.00319.03
8.2.80.0030.00517.97
8.2.70.0040.00417.37
8.2.60.0050.00318.05
8.2.50.0060.00318.07
8.2.40.0000.00919.45
8.2.30.0050.00220.63
8.2.20.0080.00317.89
8.2.10.0080.00018.12
8.2.00.0000.00718.00
8.1.280.0070.01025.92
8.1.270.0030.00723.96
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0070.00322.60
8.1.230.0060.00617.76
8.1.220.0080.00017.74
8.1.210.0060.00318.77
8.1.200.0060.00317.48
8.1.190.0000.00817.13
8.1.180.0040.00718.10
8.1.170.0030.00518.62
8.1.160.0040.00421.99
8.1.150.0030.00618.80
8.1.140.0060.00319.64
8.1.130.0000.00717.57
8.1.120.0000.00717.43
8.1.110.0070.00017.47
8.1.100.0000.00817.53
8.1.90.0040.00417.49
8.1.80.0000.00817.51
8.1.70.0040.00417.31
8.1.60.0030.00617.58
8.1.50.0080.00017.47
8.1.40.0080.00017.40
8.1.30.0080.00317.59
8.1.20.0060.00317.54
8.1.10.0080.00017.57
8.1.00.0050.00317.53
8.0.300.0030.00518.77
8.0.290.0050.00216.88
8.0.280.0000.00818.36
8.0.270.0030.00317.30
8.0.260.0030.00317.26
8.0.250.0070.00016.98
8.0.240.0000.00916.90
8.0.230.0030.00517.02
8.0.220.0030.00516.96
8.0.210.0000.00716.99
8.0.200.0000.00617.04
8.0.190.0030.00616.91
8.0.180.0000.00716.88
8.0.170.0000.00816.88
8.0.160.0030.00516.85
8.0.150.0000.00716.98
8.0.140.0050.00316.78
8.0.130.0030.00313.45
8.0.120.0030.00516.91
8.0.110.0000.00716.86
8.0.100.0000.00816.81
8.0.90.0040.00416.98
8.0.80.0030.01616.98
8.0.70.0040.00416.85
8.0.60.0000.00716.98
8.0.50.0070.00016.79
8.0.30.0020.01617.19
8.0.20.0110.01017.40
8.0.10.0040.00417.11
8.0.00.0120.00616.82
7.4.330.0060.00015.08
7.4.320.0030.00316.61
7.4.300.0000.00616.59
7.4.290.0030.00316.52
7.4.280.0000.00716.50
7.4.270.0000.00616.52
7.4.260.0080.00016.51
7.4.250.0080.00016.43
7.4.240.0060.00116.51
7.4.230.0000.00716.39
7.4.220.0100.01416.57
7.4.210.0090.00916.43
7.4.200.0050.00216.47
7.4.160.0090.00616.66
7.4.150.0100.01017.40
7.4.140.0120.01017.86
7.4.130.0150.00416.64
7.4.120.0170.00716.46
7.4.110.0170.00616.46
7.4.100.0090.00916.59
7.4.90.0090.00916.57
7.4.80.0120.01319.39
7.4.70.0060.01216.66
7.4.60.0100.00716.48
7.4.50.0000.01916.30
7.4.40.0110.01116.57
7.4.30.0030.01316.66
7.4.10.0090.00914.70
7.4.00.0080.00814.62
7.3.330.0060.00013.09
7.3.320.0030.00313.36
7.3.310.0000.00716.29
7.3.300.0030.00316.37
7.3.290.0040.00416.24
7.3.280.0110.00716.30
7.3.270.0090.00917.40
7.3.260.0110.00716.62
7.3.250.0110.00816.31
7.3.240.0080.01116.54
7.3.230.0130.00416.40
7.3.210.0090.00916.55
7.3.200.0130.00316.70
7.3.190.0070.01016.50
7.3.180.0070.01316.42
7.3.170.0060.01116.50
7.3.160.0090.01316.41
7.3.130.0060.01214.89
7.3.120.0060.01214.69
7.3.110.0030.01614.64
7.3.100.0000.01414.65
7.3.90.0110.00314.80
7.3.80.0090.00614.91
7.3.70.0060.00914.79
7.3.60.0040.01114.67
7.3.50.0040.01114.34
7.3.40.0040.00814.49
7.3.30.0090.00614.58
7.3.20.0080.00616.67
7.3.10.0040.01116.77
7.3.00.0080.00816.37
7.2.330.0120.00616.78
7.2.320.0170.00716.70
7.2.310.0100.00816.75
7.2.300.0090.00916.90
7.2.290.0180.00016.53
7.2.260.0100.00714.79
7.2.250.0070.01115.27
7.2.240.0000.01514.97
7.2.230.0060.00914.84
7.2.220.0000.01515.25
7.2.210.0100.00314.99
7.2.200.0070.00714.95
7.2.190.0110.00814.67
7.2.180.0030.01215.15
7.2.170.0090.00615.07
7.2.160.0060.01015.05
7.2.150.0110.00416.74
7.2.140.0070.00316.96
7.2.130.0090.00616.87
7.2.120.0090.00916.93
7.2.110.0060.00916.80
7.2.100.0100.00316.88
7.2.90.0100.00616.88
7.2.80.0070.01116.91
7.2.70.0060.01317.08
7.2.60.0050.00816.80
7.2.50.0090.00616.96
7.2.40.0100.00616.95
7.2.30.0050.00816.93
7.2.20.0030.01016.80
7.2.10.0030.01217.04
7.2.00.0020.01318.18
7.1.330.0070.00715.96
7.1.320.0060.00615.71
7.1.310.0070.00715.56
7.1.300.0080.00815.70
7.1.290.0120.00415.80
7.1.280.0090.00615.69
7.1.270.0060.00915.80
7.1.260.0030.01015.75
7.1.250.0000.01415.86
7.1.240.0100.00615.98
7.1.230.0100.00315.87
7.1.220.0070.00415.66
7.1.210.0000.01315.79
7.1.200.0070.00515.70
7.1.190.0090.00915.84
7.1.180.0110.00015.94
7.1.170.0090.00015.57
7.1.160.0070.00715.89
7.1.150.0060.00315.66
7.1.140.0030.01015.63
7.1.130.0070.00415.71
7.1.120.0030.01015.59
7.1.110.0070.00715.82
7.1.100.0050.00416.91
7.1.90.0060.00915.92
7.1.80.0070.00715.70
7.1.70.0060.00516.54
7.1.60.0060.01117.55
7.1.50.0100.00516.38
7.1.40.0030.00615.57
7.1.30.0090.00415.72
7.1.20.0040.01115.77
7.1.10.0100.00015.73
7.1.00.0070.04018.97
7.0.330.0060.01015.28
7.0.320.0060.00315.45
7.0.310.0090.00315.16
7.0.300.0070.00715.43
7.0.290.0060.00315.45
7.0.280.0030.01015.43
7.0.270.0000.01415.44
7.0.260.0070.00615.45
7.0.250.0030.01415.36
7.0.240.0070.00715.36
7.0.230.0030.00715.57
7.0.220.0030.00715.45
7.0.210.0040.01115.32
7.0.200.0330.00814.88
7.0.190.0130.00015.28
7.0.180.0030.00815.22
7.0.170.0030.00715.27
7.0.160.0030.00915.52
7.0.150.0030.01315.52
7.0.140.0080.00415.41
7.0.130.0040.01115.42
7.0.120.0030.00615.29
7.0.110.0000.01115.51
7.0.100.0000.01215.56
7.0.90.0040.01215.11
7.0.80.0060.00915.53
7.0.70.0030.01015.38
7.0.60.0040.03317.72
7.0.50.0030.02216.63
7.0.40.0070.04216.66
7.0.30.0160.04116.81
7.0.20.0180.04116.74
7.0.10.0040.04216.82
7.0.00.0050.05216.69
5.6.400.0090.00614.17
5.6.390.0120.00314.27
5.6.380.0040.01114.36
5.6.370.0060.00614.58
5.6.360.0080.00414.40
5.6.350.0080.00314.07
5.6.340.0030.00714.38
5.6.330.0040.00714.55
5.6.320.0040.00814.35
5.6.310.0000.01314.50
5.6.300.0000.00814.69
5.6.290.0040.00814.63
5.6.280.0040.03817.72
5.6.270.0000.01014.33
5.6.260.0050.00514.18
5.6.250.0040.01114.31
5.6.240.0000.01314.42
5.6.230.0080.00414.51
5.6.220.0070.01014.74
5.6.210.0080.02617.50
5.6.200.0050.04816.37
5.6.190.0100.04217.41
5.6.180.0120.02617.57
5.6.170.0170.02917.39
5.6.160.0090.02717.30
5.6.150.0070.04616.20
5.6.140.0080.03516.15
5.6.130.0080.02716.34
5.6.120.0100.03517.81
5.6.110.0070.04817.63
5.6.100.0050.02717.73
5.6.90.0090.04117.71
5.6.80.0080.02217.37
5.6.70.0100.00014.40
5.6.60.0030.01314.23
5.6.50.0040.01114.48
5.6.40.0110.00714.37
5.6.30.0100.00614.22
5.6.20.0070.00714.34
5.6.10.0030.00714.43
5.6.00.0100.00714.12
5.5.380.0100.00314.40
5.5.370.0070.00714.38
5.5.360.0060.00314.29
5.5.350.0220.04217.46
5.5.340.0070.03816.26
5.5.330.0070.02817.24
5.5.320.0030.03017.28
5.5.310.0120.02117.25
5.5.300.0050.02516.18
5.5.290.0020.04016.12
5.5.280.0050.02917.59
5.5.270.0090.04017.72
5.5.260.0060.03717.38
5.5.250.0050.02817.29
5.5.240.0130.03317.04
5.5.230.0030.00614.29
5.5.220.0000.01414.10
5.5.210.0130.00314.18
5.5.200.0030.00614.16
5.5.190.0000.01214.33
5.5.180.0040.00814.29
5.5.170.0040.01114.18
5.5.160.0040.00714.06
5.5.150.0080.00014.16
5.5.140.0040.00714.41
5.5.130.0040.00714.49
5.5.120.0100.00314.17
5.5.110.0000.00914.20
5.5.100.0030.01414.34
5.5.90.0120.00314.11
5.5.80.0070.00714.17
5.5.70.0030.01014.25
5.5.60.0100.00314.35
5.5.50.0040.01114.42
5.5.40.0040.01114.58
5.5.30.0040.00714.18
5.5.20.0040.00814.18
5.5.10.0130.00014.25
5.5.00.0040.00814.23

preferences:
54.26 ms | 401 KiB | 5 Q