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)); $cnt = 0; foreach($products as $pkey=>$pobj) { foreach($carts as $ckey=>$carray) { if(isset($carray['chemID']) && $carray['chemID']==$pobj['chemID']) { if(isset($carray['catID']) && $carray['catID']==$pobj['catID']) { $cnt++; } } } } echo $cnt;

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.0120.00916.63
8.3.50.0090.00921.98
8.3.40.0040.01119.05
8.3.30.0030.01018.84
8.3.20.0040.00420.21
8.3.10.0030.00523.48
8.3.00.0040.00419.51
8.2.180.0170.00316.73
8.2.170.0090.00622.96
8.2.160.0080.00620.39
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0080.00017.63
8.2.120.0000.00726.35
8.2.110.0030.00622.25
8.2.100.0060.00617.93
8.2.90.0040.00419.17
8.2.80.0050.00317.97
8.2.70.0050.00517.75
8.2.60.0040.00418.05
8.2.50.0040.00418.07
8.2.40.0040.00419.38
8.2.30.0030.00420.60
8.2.20.0030.00617.69
8.2.10.0060.00318.27
8.2.00.0000.00718.16
8.1.280.0140.00725.92
8.1.270.0040.00723.76
8.1.260.0080.00028.09
8.1.250.0050.00328.09
8.1.240.0040.00422.54
8.1.230.0080.00317.79
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0060.00317.25
8.1.190.0060.00317.36
8.1.180.0000.00818.10
8.1.170.0050.00318.78
8.1.160.0040.00422.09
8.1.150.0070.00018.82
8.1.140.0000.00919.50
8.1.130.0030.00317.65
8.1.120.0040.00417.53
8.1.110.0000.00817.43
8.1.100.0030.00617.52
8.1.90.0040.00417.48
8.1.80.0050.00217.46
8.1.70.0080.00017.39
8.1.60.0060.00317.57
8.1.50.0080.00017.46
8.1.40.0060.00317.41
8.1.30.0030.00717.60
8.1.20.0000.00717.59
8.1.10.0040.00417.43
8.1.00.0000.00817.40
8.0.300.0080.00018.84
8.0.290.0040.00416.75
8.0.280.0030.00318.33
8.0.270.0050.00317.18
8.0.260.0020.00517.27
8.0.250.0070.00017.08
8.0.240.0030.00817.02
8.0.230.0000.00716.99
8.0.220.0020.00516.87
8.0.210.0050.00316.82
8.0.200.0000.00616.91
8.0.190.0000.00816.97
8.0.180.0000.00817.00
8.0.170.0030.00516.88
8.0.160.0070.00017.01
8.0.150.0000.00716.81
8.0.140.0030.00516.92
8.0.130.0060.00013.40
8.0.120.0030.00516.86
8.0.110.0040.00417.00
8.0.100.0000.00717.03
8.0.90.0070.00016.91
8.0.80.0100.00716.89
8.0.70.0080.00016.80
8.0.60.0080.00017.08
8.0.50.0000.00816.95
8.0.30.0130.00717.06
8.0.20.0150.00417.42
8.0.10.0000.00716.93
8.0.00.0100.00916.73
7.4.330.0000.00516.89
7.4.320.0030.00316.43
7.4.300.0030.00316.53
7.4.290.0030.00316.53
7.4.280.0040.00416.57
7.4.270.0030.00316.51
7.4.260.0070.00016.68
7.4.250.0000.00716.54
7.4.240.0070.00016.53
7.4.230.0000.00716.51
7.4.220.0030.01716.55
7.4.210.0040.01016.55
7.4.200.0070.00016.42
7.4.160.0120.00616.47
7.4.150.0120.00417.40
7.4.140.0100.01017.86
7.4.130.0150.00616.43
7.4.120.0100.00816.64
7.4.110.0150.00316.56
7.4.100.0150.00616.40
7.4.90.0200.00016.71
7.4.80.0080.00819.39
7.4.70.0130.00616.54
7.4.60.0070.01016.60
7.4.50.0140.00016.59
7.4.40.0040.01716.50
7.4.30.0070.01016.57
7.4.00.0070.01015.06
7.3.330.0050.00213.32
7.3.320.0030.00313.46
7.3.310.0000.00716.40
7.3.300.0070.00016.31
7.3.290.0030.00316.25
7.3.280.0100.00616.37
7.3.270.0100.01017.40
7.3.260.0160.00616.63
7.3.240.0130.00716.57
7.3.230.0210.00016.43
7.3.210.0070.01016.46
7.3.200.0060.01016.41
7.3.190.0120.00916.32
7.3.180.0060.01016.67
7.3.170.0080.00816.54
7.3.160.0050.01116.49
7.3.120.0030.01315.09
7.3.110.0090.00914.66
7.3.100.0140.00414.70
7.3.90.0000.01514.98
7.3.80.0030.01414.93
7.3.70.0040.00414.74
7.3.60.0120.00314.54
7.3.50.0040.01214.62
7.3.40.0140.00014.97
7.3.30.0060.00614.73
7.3.20.0040.00816.73
7.3.10.0030.01116.59
7.3.00.0090.00316.65
7.2.330.0120.00616.73
7.2.320.0060.01616.74
7.2.310.0060.01016.63
7.2.300.0090.00916.73
7.2.290.0070.01016.64
7.2.250.0090.00915.24
7.2.240.0120.00615.29
7.2.230.0090.00615.11
7.2.220.0070.00715.07
7.2.210.0100.00715.10
7.2.200.0090.00015.02
7.2.190.0000.01615.04
7.2.180.0030.01415.15
7.2.170.0030.01415.10
7.2.160.0030.00615.10
7.2.150.0060.01117.08
7.2.140.0060.00917.08
7.2.130.0030.01016.93
7.2.120.0040.01016.94
7.2.110.0030.01216.86
7.2.100.0080.00517.01
7.2.90.0070.00617.07
7.2.80.0070.00616.92
7.2.70.0060.00816.94
7.2.60.0050.00916.95
7.2.50.0050.00716.92
7.2.40.0070.00417.00
7.2.30.0030.00816.92
7.2.20.0080.00716.99
7.2.10.0020.00816.83
7.2.00.0060.00917.51
7.1.330.0090.00615.84
7.1.320.0030.01415.66
7.1.310.0100.00715.57
7.1.300.0090.00615.99
7.1.290.0050.00815.82
7.1.280.0060.00316.04
7.1.270.0080.00815.50
7.1.260.0040.01115.61
7.1.250.0050.01116.00
7.1.240.0000.01015.72
7.1.230.0000.01415.90
7.1.220.0030.00715.70
7.1.210.0030.00815.79
7.1.200.0010.01115.75
7.1.190.0050.00715.88
7.1.180.0060.00815.60
7.1.170.0110.00515.81
7.1.160.0020.01015.78
7.1.150.0060.00715.83
7.1.140.0050.01015.94
7.1.130.0040.00515.71
7.1.120.0070.01015.88
7.1.110.0050.01015.80
7.1.100.0050.00716.59
7.1.90.0030.01015.74
7.1.80.0020.00915.88
7.1.70.0040.00516.35
7.1.60.0080.01017.09
7.1.50.0070.00716.25
7.1.40.0040.00915.87
7.1.30.0070.00715.92
7.1.20.0040.01115.92
7.1.10.0070.00715.78
7.1.00.0040.03018.02
7.0.330.0070.00715.18
7.0.320.0110.00315.51
7.0.310.0050.01015.43
7.0.300.0080.00415.46
7.0.290.0050.00615.42
7.0.280.0060.00615.14
7.0.270.0080.00615.50
7.0.260.0040.01015.40
7.0.250.0050.01215.57
7.0.240.0040.00815.46
7.0.230.0050.00615.38
7.0.220.0080.00715.49
7.0.210.0050.00715.38
7.0.200.0210.00615.16
7.0.190.0070.00715.41
7.0.180.0020.01015.35
7.0.170.0040.00715.59
7.0.160.0100.00315.35
7.0.150.0070.00515.50
7.0.140.0050.00615.49
7.0.130.0070.00815.46
7.0.120.0020.01415.59
7.0.110.0050.00715.33
7.0.100.0060.00815.46
7.0.90.0080.00415.51
7.0.80.0080.00515.45
7.0.70.0050.00815.42
7.0.60.0100.02916.93
7.0.50.0050.01916.33
7.0.40.0050.02015.70
7.0.30.0110.03115.79
7.0.20.0150.02815.63
7.0.10.0100.03015.74
7.0.00.0030.02315.74
5.6.400.0000.01214.42
5.6.390.0060.00614.63
5.6.380.0070.00814.35
5.6.370.0070.00614.38
5.6.360.0070.00514.55
5.6.350.0100.00314.45
5.6.340.0050.00414.37
5.6.330.0080.00714.49
5.6.320.0070.00714.45
5.6.310.0060.01014.38
5.6.300.0050.00714.56
5.6.290.0030.01014.59
5.6.280.0020.03016.69
5.6.270.0020.01114.51
5.6.260.0030.01114.63
5.6.250.0060.00314.53
5.6.240.0070.00714.53
5.6.230.0030.01114.55
5.6.220.0060.00514.42
5.6.210.0060.03216.45
5.6.200.0070.03015.67
5.6.190.0030.03516.46
5.6.180.0080.01916.39
5.6.170.0100.01716.51
5.6.160.0060.03516.57
5.6.150.0020.02215.61
5.6.140.0050.01815.51
5.6.130.0080.02915.76
5.6.120.0110.02316.57
5.6.110.0070.02816.71
5.6.100.0050.02316.71
5.6.90.0040.02016.66
5.6.80.0040.01616.38
5.6.70.0050.00714.30
5.6.60.0050.00714.20
5.6.50.0030.01214.21
5.6.40.0050.01014.29
5.6.30.0070.00514.47
5.6.20.0050.00714.41
5.6.10.0030.01014.25
5.6.00.0050.00414.35
5.5.380.0050.00512.71
5.5.370.0020.01012.83
5.5.360.0050.00612.97
5.5.350.0100.01715.23
5.5.340.0060.02314.54
5.5.330.0080.02315.20
5.5.320.0050.02015.41
5.5.310.0120.03115.28
5.5.300.0030.02014.68
5.5.290.0060.02114.51
5.5.280.0080.01815.40
5.5.270.0030.02915.58
5.5.260.0060.03515.47
5.5.250.0030.03315.49
5.5.240.0120.02215.22
5.5.230.0030.00812.90
5.5.220.0080.00512.61
5.5.210.0020.01012.80
5.5.200.0030.00712.70
5.5.190.0060.00512.68
5.5.180.0060.00412.95
5.5.170.0000.01212.83
5.5.160.0000.01212.60
5.5.150.0020.01212.71
5.5.140.0090.00612.83
5.5.130.0030.00912.75
5.5.120.0050.00912.75
5.5.110.0030.00812.97
5.5.100.0070.00612.77
5.5.90.0060.00512.80
5.5.80.0060.00612.74
5.5.70.0020.00912.88
5.5.60.0050.00512.78
5.5.50.0030.00912.92
5.5.40.0090.00412.69
5.5.30.0050.00612.90
5.5.20.0050.00512.84
5.5.10.0060.00812.84
5.5.00.0060.00212.60

preferences:
77.12 ms | 401 KiB | 5 Q