3v4l.org

run code in 300+ PHP versions simultaneously
<?php $o1 = new stdClass; $o2 = new stdClass; $o3 = new stdClass; $o1->active = false; $o2->active = true; $o3->active = true; $products = [$o1, $o2, $o3]; for($i=0, $max=count($products); $i < $max; $i++) { if (!($products[$i]->active)) { unset($products[$i]); } } print_r($products); // reindex: $improvedProducts = array_values($products); print_r($improvedProducts);

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.0110.00824.05
8.4.110.0120.00819.62
8.4.100.0060.00317.85
8.4.90.0080.00218.93
8.4.80.0110.00717.73
8.4.70.0120.00917.77
8.4.60.0110.01018.71
8.4.50.0120.00722.36
8.4.40.0040.00417.70
8.4.30.0130.00319.50
8.4.20.0030.00619.73
8.4.10.0150.00617.55
8.3.250.0120.00719.18
8.3.240.0100.00917.17
8.3.230.0110.00816.48
8.3.220.0140.00417.23
8.3.210.0090.00416.63
8.3.200.0020.00616.80
8.3.190.0090.00617.09
8.3.180.0050.00618.67
8.3.170.0080.00017.19
8.3.160.0140.00418.57
8.3.150.0070.01116.62
8.3.140.0060.00316.46
8.3.130.0060.00916.96
8.3.120.0040.00718.86
8.3.110.0080.00020.94
8.3.100.0060.00324.06
8.3.90.0080.00026.77
8.3.80.0060.00319.36
8.3.70.0080.00818.55
8.3.60.0130.00618.31
8.3.50.0120.00217.57
8.3.40.0140.00418.59
8.3.30.0120.00318.89
8.3.20.0050.00221.76
8.3.10.0040.00423.65
8.3.00.0080.00021.26
8.2.290.0050.00420.72
8.2.280.0150.00518.21
8.2.270.0080.01116.94
8.2.260.0080.00318.82
8.2.250.0030.00618.36
8.2.240.0110.00317.07
8.2.230.0000.00822.58
8.2.220.0040.00437.54
8.2.210.0090.00526.77
8.2.200.0060.00318.88
8.2.190.0160.00316.58
8.2.180.0070.00718.05
8.2.170.0000.01419.04
8.2.160.0000.01322.96
8.2.150.0170.00025.66
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0000.00721.19
8.2.110.0000.01020.99
8.2.100.0040.00817.85
8.2.90.0000.00818.03
8.2.80.0030.00519.16
8.2.70.0050.00317.93
8.2.60.0040.00417.63
8.2.50.0040.00418.22
8.2.40.0040.00422.33
8.2.30.0000.00719.57
8.2.20.0040.00418.20
8.2.10.0000.00717.68
8.2.00.0000.00718.13
8.1.330.0110.00921.88
8.1.320.0120.00815.93
8.1.310.0110.00718.35
8.1.300.0120.00418.54
8.1.290.0060.00330.84
8.1.280.0110.00825.92
8.1.270.0000.00823.95
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0060.00321.29
8.1.230.0070.00420.83
8.1.220.0000.00817.74
8.1.210.0000.00918.77
8.1.200.0000.00817.35
8.1.190.0040.00417.35
8.1.180.0000.00718.10
8.1.170.0000.00918.53
8.1.160.0040.00418.96
8.1.150.0000.00720.29
8.1.140.0060.00317.59
8.1.130.0000.00618.95
8.1.120.0030.00817.46
8.1.110.0040.00417.42
8.1.100.0040.00417.42
8.1.90.0040.00417.37
8.1.80.0050.00317.45
8.1.70.0000.00717.40
8.1.60.0080.00017.55
8.1.50.0000.00717.41
8.1.40.0040.00417.49
8.1.30.0040.00717.60
8.1.20.0050.00217.69
8.1.10.0040.00417.57
8.1.00.0000.00817.47
8.0.300.0000.00820.16
8.0.290.0040.00416.63
8.0.280.0070.00018.43
8.0.270.0030.00316.73
8.0.260.0030.00316.83
8.0.250.0030.00316.98
8.0.240.0040.00416.99
8.0.230.0030.00316.95
8.0.220.0050.00216.84
8.0.210.0000.00716.93
8.0.200.0060.00016.86
8.0.190.0000.00717.05
8.0.180.0000.00716.94
8.0.170.0040.00416.93
8.0.160.0050.00316.80
8.0.150.0000.00716.85
8.0.140.0000.00716.86
8.0.130.0000.00613.39
8.0.120.0050.00316.78
8.0.110.0000.00716.87
8.0.100.0080.00016.91
8.0.90.0050.00316.87
8.0.80.0110.00616.84
8.0.70.0070.00016.73
8.0.60.0040.00416.70
8.0.50.0000.00716.94
8.0.30.0110.00617.07
8.0.20.0070.01317.28
8.0.10.0120.00417.03
8.0.00.0080.01116.94
7.4.330.0060.00015.55
7.4.320.0000.00616.42
7.4.300.0030.00316.54
7.4.290.0070.00016.61
7.4.280.0000.00816.47
7.4.270.0000.00716.46
7.4.260.0070.00016.55
7.4.250.0000.01016.63
7.4.240.0020.00516.59
7.4.230.0030.00316.50
7.4.220.0090.00016.71
7.4.210.0060.01216.46
7.4.200.0070.00016.60
7.4.160.0110.00616.53
7.4.150.0090.00916.57
7.4.140.0110.00717.64
7.4.130.0130.00316.51
7.4.120.0130.00616.50
7.4.110.0110.00616.46
7.4.100.0080.00916.49
7.4.90.0100.00916.57
7.4.80.0100.00717.48
7.4.70.0140.00816.52
7.4.60.0090.01016.45
7.4.50.0070.01216.51
7.4.40.0060.01116.46
7.4.30.0090.00816.45
7.4.20.0060.00916.56
7.4.10.0070.00916.52
7.4.00.0040.01216.10
7.3.330.0000.00513.16
7.3.320.0000.00613.13
7.3.310.0050.00216.43
7.3.300.0000.00616.18
7.3.290.0000.00716.15
7.3.280.0070.01116.29
7.3.270.0180.00016.25
7.3.260.0100.00716.42
7.3.250.0090.00816.34
7.3.240.0100.00716.34
7.3.230.0070.00916.41
7.3.220.0050.01116.38
7.3.210.0030.01216.39
7.3.200.0080.00716.40
7.3.190.0080.00916.38
7.3.180.0120.00516.39
7.3.170.0050.01116.29
7.3.160.0080.00916.46
7.3.150.0100.00616.42
7.3.140.0080.00816.35
7.3.130.0090.00916.44
7.3.120.0080.00816.34
7.3.110.0070.01016.33
7.3.100.0090.00916.32
7.3.90.0070.01116.38
7.3.80.0080.00816.29
7.3.70.0120.00716.46
7.3.60.0100.00716.41
7.3.50.0130.00316.32
7.3.40.0090.00816.33
7.3.30.0100.00716.28
7.3.20.0140.01016.44
7.3.10.0130.00916.39
7.3.00.0090.01016.39
7.2.340.0120.00316.50
7.2.330.0120.00516.47
7.2.320.0070.01116.43
7.2.310.0070.00916.46
7.2.300.0100.01016.52
7.2.290.0090.00816.51
7.2.280.0050.01116.47
7.2.270.0070.01016.44
7.2.260.0090.00716.56
7.2.250.0130.00516.55
7.2.240.0070.01016.51
7.2.230.0040.01216.44
7.2.220.0060.00916.41
7.2.210.0100.00616.53
7.2.200.0080.01016.57
7.2.190.0100.01016.57
7.2.180.0100.00816.50
7.2.170.0050.01316.55
7.2.160.0080.00916.63
7.2.150.0090.01016.56
7.2.140.0080.01016.56
7.2.130.0210.00716.63
7.2.120.0070.01016.55
7.2.110.0090.01216.73
7.2.100.0090.01116.73
7.2.90.0100.00516.52
7.2.80.0050.01316.56
7.2.70.0110.01016.62
7.2.60.0120.00616.63
7.2.50.0090.00816.65
7.2.40.0120.00816.61
7.2.30.0140.00817.01
7.2.20.0120.01217.05
7.2.10.0130.01016.93
7.2.00.0190.00816.90
7.1.330.0200.00615.59
7.1.320.0160.01015.49
7.1.310.0210.00515.58
7.1.300.0250.00615.50
7.1.290.0140.01015.49
7.1.280.0200.00615.41
7.1.270.0160.00915.52
7.1.260.0160.00915.49
7.1.250.0310.00915.44
7.1.240.0160.01015.46
7.1.230.0220.00415.39
7.1.220.0130.01315.52
7.1.210.0170.00715.42
7.1.200.0130.00915.58
7.1.190.0120.01315.59
7.1.180.0110.01215.46
7.1.170.0390.00915.47
7.1.160.0160.00715.42
7.1.150.0150.01515.87
7.1.140.0190.01115.73
7.1.130.0230.00915.83
7.1.120.0170.01215.81
7.1.110.0150.01215.68
7.1.100.0300.01215.52
7.1.90.0160.00815.56
7.1.80.0180.00915.58
7.1.70.0190.00715.28
7.1.60.0190.01219.83
7.1.50.0200.01219.74
7.1.40.0210.01219.76
7.1.30.0240.00819.73
7.1.20.0260.01219.82
7.1.10.0160.01115.30
7.1.00.0290.00615.27
7.0.330.0210.00415.05
7.0.320.0150.01115.10
7.0.310.0180.00815.09
7.0.300.0160.00915.14
7.0.290.0150.01315.03
7.0.280.0300.01215.05
7.0.270.0120.01315.13
7.0.260.0180.00815.13
7.0.250.0190.00815.20
7.0.240.0160.00915.22
7.0.230.0140.01015.07
7.0.220.0160.00715.12
7.0.210.0150.01115.13
7.0.200.0140.01415.21
7.0.190.0190.00815.18
7.0.180.0180.01315.21
7.0.170.0160.00915.12
7.0.160.0220.01015.19
7.0.150.0150.01015.13
7.0.140.0180.00815.24
7.0.130.0140.01015.29
7.0.120.0170.00815.22
7.0.110.0140.01215.21
7.0.100.0210.01015.14
7.0.90.0220.00915.00
7.0.80.0210.00915.12
7.0.70.0230.00915.18
7.0.60.0120.01415.13
7.0.50.0240.00715.15
7.0.40.0220.00515.10
7.0.30.0170.00915.12
7.0.20.0160.01015.04
7.0.10.0170.00815.17
7.0.00.0180.00815.14
5.6.400.0170.01415.84
5.6.390.0180.00815.84
5.6.380.0160.00916.00
5.6.370.0160.01015.97
5.6.360.0190.00815.99
5.6.350.0140.01515.95
5.6.340.0180.00815.83
5.6.330.0170.00916.00
5.6.320.0150.00915.94
5.6.310.0170.01015.93
5.6.300.0150.01315.91
5.6.290.0160.01115.91
5.6.280.0170.01115.92
5.6.270.0100.01715.88
5.6.260.0170.01215.80
5.6.250.0150.01115.92
5.6.240.0160.00915.84
5.6.230.0170.01115.89
5.6.220.0190.00915.96
5.6.210.0150.01115.88
5.6.200.0200.00715.95
5.6.190.0200.00815.88
5.6.180.0190.00915.87
5.6.170.0150.01215.89
5.6.160.0130.01415.97
5.6.150.0180.00715.93
5.6.140.0160.01115.86
5.6.130.0160.01616.00
5.6.120.0150.01315.92
5.6.110.0160.01015.91
5.6.100.0160.00915.81
5.6.90.0170.01015.93
5.6.80.0120.01215.82
5.6.70.0180.00715.94
5.6.60.0140.01115.90
5.6.50.0140.01215.86
5.6.40.0160.01115.99
5.6.30.0160.01115.79
5.6.20.0120.01615.94
5.6.10.0200.00715.86
5.6.00.0150.01415.77
5.5.380.0180.01215.82
5.5.370.0210.00815.92
5.5.360.0140.01415.95
5.5.350.0200.00715.89
5.5.340.0140.01415.91
5.5.330.0150.01415.74
5.5.320.0140.01215.93
5.5.310.0180.00815.86
5.5.300.0150.01215.86
5.5.290.0180.01015.88
5.5.280.0170.00915.91
5.5.270.0150.01215.90
5.5.260.0190.01015.82
5.5.250.0140.01315.96
5.5.240.0170.00915.91
5.5.230.0200.00815.86
5.5.220.0140.01215.86
5.5.210.0130.01115.90
5.5.200.0160.00915.85
5.5.190.0170.01015.74
5.5.180.0270.00515.83
5.5.170.0160.01315.69
5.5.160.0160.01315.85
5.5.150.0200.00815.77
5.5.140.0170.00915.88
5.5.130.0150.01315.75
5.5.120.0110.01315.66
5.5.110.0150.01315.69
5.5.100.0160.00715.81
5.5.90.0160.00915.75
5.5.80.0150.01115.72
5.5.70.0150.01115.91
5.5.60.0180.00815.81
5.5.50.0210.00815.82
5.5.40.0230.00615.75
5.5.30.0140.01315.81
5.5.20.0120.01715.76
5.5.10.0150.01415.71
5.5.00.0200.00915.74
5.4.450.0150.00912.86
5.4.440.0100.00712.78
5.4.430.0100.00912.79
5.4.420.0100.01012.90
5.4.410.0150.00512.91
5.4.400.0130.00612.79
5.4.390.0140.00612.82
5.4.380.0120.00712.73
5.4.370.0130.00712.77
5.4.360.0130.01012.79
5.4.350.0110.01112.82
5.4.340.0120.01412.81
5.4.330.0120.00912.83
5.4.320.0140.00812.79
5.4.310.0120.01012.82
5.4.300.0090.01212.80
5.4.290.0120.00912.78
5.4.280.0140.00812.82
5.4.270.0140.00612.75
5.4.260.0110.00912.75
5.4.250.0120.00812.79
5.4.240.0090.01212.81
5.4.230.0140.00712.77
5.4.220.0150.00812.71
5.4.210.0120.01012.70
5.4.200.0160.00812.73
5.4.190.0170.00612.71
5.4.180.0130.01012.74
5.4.170.0120.01012.74
5.4.160.0110.00912.75
5.4.150.0180.00312.76
5.4.140.0120.00812.80
5.4.130.0150.00812.78
5.4.120.0140.00712.84
5.4.110.0140.00812.84
5.4.100.0160.00512.80
5.4.90.0120.00812.84
5.4.80.0100.00912.88
5.4.70.0140.00612.83
5.4.60.0150.00312.84
5.4.50.0150.00612.79
5.4.40.0140.00612.84
5.4.30.0140.00512.87
5.4.20.0100.00912.87
5.4.10.0130.00612.79
5.4.00.0110.00812.71
5.3.290.0150.01012.86
5.3.280.0130.01112.84
5.3.270.0120.01212.76
5.3.260.0160.00512.74
5.3.250.0130.00812.87
5.3.240.0150.01012.68
5.3.230.0140.01012.74
5.3.220.0190.00412.83
5.3.210.0140.00912.71
5.3.200.0120.00912.70
5.3.190.0150.00812.81
5.3.180.0110.00912.92
5.3.170.0160.00712.93
5.3.160.0170.00512.92
5.3.150.0110.01112.97
5.3.140.0140.00812.88
5.3.130.0130.01012.95
5.3.120.0140.00812.96
5.3.110.0130.01012.86
5.3.100.0180.00712.86
5.3.90.0130.00812.88
5.3.80.0110.00712.81
5.3.70.0110.01112.79
5.3.60.0140.00812.82
5.3.50.0100.01112.85
5.3.40.0130.01012.80
5.3.30.0150.00712.77
5.3.20.0120.00712.73
5.3.10.0130.00912.65
5.3.00.0160.00712.63
5.2.170.0140.00412.24
5.2.160.0120.00612.22
5.2.150.0070.01012.21
5.2.140.0100.00912.13
5.2.130.0110.00812.14
5.2.120.0060.01112.16
5.2.110.0130.00612.21
5.2.100.0120.00712.17
5.2.90.0110.00712.19
5.2.80.0060.01212.13
5.2.70.0070.01112.16
5.2.60.0090.00912.11
5.2.50.0120.01012.22
5.2.40.0130.00612.15
5.2.30.0100.00712.13
5.2.20.0100.00612.07
5.2.10.0100.00712.08
5.2.00.0120.00512.04
5.1.60.0080.00912.03
5.1.50.0100.00712.03
5.1.40.0110.00412.03
5.1.30.0070.00912.03
5.1.20.0100.00612.03
5.1.10.0120.00512.03
5.1.00.0080.00612.03
5.0.50.0100.00412.03
5.0.40.0080.00512.03
5.0.30.0070.00612.03
5.0.20.0110.00212.03
5.0.10.0090.00412.03
5.0.00.0030.00912.03
4.4.90.0090.00112.03
4.4.80.0070.00312.03
4.4.70.0060.00212.03
4.4.60.0030.00512.03
4.4.50.0060.00412.03
4.4.40.0060.00412.03
4.4.30.0030.00512.03
4.4.20.0070.00212.03
4.4.10.0070.00212.03
4.4.00.0060.00312.03
4.3.110.0040.00412.03
4.3.100.0070.00112.03
4.3.90.0070.00212.03
4.3.80.0070.00112.03
4.3.70.0060.00312.03
4.3.60.0050.00312.03
4.3.50.0040.00512.03
4.3.40.0060.00212.03
4.3.30.0020.00612.03
4.3.20.0060.00212.03
4.3.10.0050.00312.03
4.3.00.0030.00512.03

preferences:
35.19 ms | 403 KiB | 5 Q