3v4l.org

run code in 300+ PHP versions simultaneously
<?php // okay I was wondering something about loops // say I wanted to get all comments from a db // that's easy with a `foreach` loop // but what if I want to get a reply for each comment in that foreach loop? // well I'd have to put a foreach loop within a foreach loop, no biggy. // but what happens if you'd want an infinite checker that checks a reply // ect. e.g: foreach($comments as $comment) { // output comment // say the nest_id is the id of a comment and the nest_id // is nested as a comment's reply // this is easy foreach($comment->nest_id as $comment_nest) { } } // basically is it possible to loop through something, // then automatically loop another time if there is a reply to a comment // and if there is a reply to that reply then automatically get that? // seems rather complicated.

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.5.30.0110.00520.21
8.5.20.0040.00320.26
8.5.10.0100.00819.86
8.5.00.0120.00820.05
8.4.180.0180.00621.94
8.4.170.0100.01320.44
8.4.160.0160.00723.93
8.4.150.0080.00516.84
8.4.140.0130.00817.41
8.4.130.0150.00618.52
8.4.120.0130.00724.43
8.4.110.0090.01120.57
8.4.100.0110.00718.96
8.4.90.0080.01122.42
8.4.80.0100.01018.74
8.4.70.0060.00418.80
8.4.60.0110.00918.91
8.4.50.0080.00918.50
8.4.40.0100.01018.99
8.4.30.0000.00817.62
8.4.20.0070.01420.26
8.4.10.0110.00019.17
8.3.300.0080.01220.96
8.3.290.0110.00920.79
8.3.280.0120.00818.43
8.3.270.0120.00816.62
8.3.260.0110.00916.54
8.3.250.0090.01018.66
8.3.240.0080.00117.15
8.3.230.0050.00316.79
8.3.220.0060.00218.94
8.3.210.0120.00816.73
8.3.200.0030.00516.47
8.3.190.0090.00817.27
8.3.180.0080.00918.78
8.3.170.0060.01318.95
8.3.160.0110.00717.22
8.3.150.0150.00416.80
8.3.140.0070.00717.16
8.3.130.0050.00518.41
8.3.120.0100.00720.60
8.3.110.0040.00420.94
8.3.100.0060.00316.59
8.3.90.0040.00426.77
8.3.80.0030.00616.75
8.3.70.0040.01416.50
8.3.60.0160.00016.75
8.3.50.0130.00821.21
8.3.40.0120.00318.38
8.3.30.0080.00618.59
8.3.20.0040.00420.73
8.3.10.0080.00021.87
8.3.00.0000.00819.13
8.2.300.0140.00622.15
8.2.290.0050.00322.35
8.2.280.0110.00818.39
8.2.270.0040.00416.79
8.2.260.0060.01216.84
8.2.250.0050.00316.49
8.2.240.0030.00617.28
8.2.230.0040.00422.58
8.2.220.0040.00424.06
8.2.210.0000.00726.77
8.2.200.0080.00316.75
8.2.190.0100.00716.63
8.2.180.0040.01118.41
8.2.170.0100.00322.96
8.2.160.0000.01419.21
8.2.150.0070.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00421.00
8.2.110.0040.00421.97
8.2.100.0080.00317.97
8.2.90.0050.00317.75
8.2.80.0060.00317.97
8.2.70.0050.00317.90
8.2.60.0040.00418.07
8.2.50.0050.00218.10
8.2.40.0040.00420.62
8.2.30.0070.00019.11
8.2.20.0000.00717.88
8.2.10.0050.00217.95
8.2.00.0000.00717.60
8.1.340.0130.00817.36
8.1.330.0100.00821.66
8.1.320.0120.00717.93
8.1.310.0060.00316.36
8.1.300.0150.00018.30
8.1.290.0040.00730.84
8.1.280.0110.00725.92
8.1.270.0070.00722.21
8.1.260.0000.00726.35
8.1.250.0050.00328.09
8.1.240.0060.00322.38
8.1.230.0170.00417.48
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0030.00617.23
8.1.190.0040.00419.89
8.1.180.0040.00418.10
8.1.170.0030.00518.66
8.1.160.0000.00818.88
8.1.150.0030.00320.30
8.1.140.0040.00419.43
8.1.130.0030.00318.87
8.1.120.0040.00417.46
8.1.110.0050.00317.38
8.1.100.0000.00917.33
8.1.90.0040.00417.27
8.1.80.0030.00417.30
8.1.70.0040.00417.40
8.1.60.0000.00817.53
8.1.50.0040.00417.42
8.1.40.0040.00417.36
8.1.30.0040.00417.58
8.1.20.0060.00317.57
8.1.10.0070.00017.37
8.1.00.0030.00617.38
8.0.300.0120.00318.77
8.0.290.0040.00416.63
8.0.280.0040.00418.39
8.0.270.0000.00717.12
8.0.260.0030.00317.20
8.0.250.0070.00016.93
8.0.240.0080.00016.91
8.0.230.0040.00416.80
8.0.220.0080.00016.96
8.0.210.0070.00016.91
8.0.200.0000.00616.97
8.0.190.0040.00416.84
8.0.180.0000.00716.84
8.0.170.0000.00716.93
8.0.160.0030.00316.97
8.0.150.0000.00716.79
8.0.140.0070.00016.84
8.0.130.0030.00313.28
8.0.120.0070.00016.98
8.0.110.0070.00016.73
8.0.100.0000.00816.68
8.0.90.0070.00016.86
8.0.80.0120.00316.89
8.0.70.0040.00416.93
8.0.60.0040.00416.97
8.0.50.0040.00416.87
8.0.30.0070.01217.11
8.0.20.0110.00817.40
8.0.10.0040.00416.82
8.0.00.0150.00316.79
7.4.330.0000.00515.55
7.4.320.0070.00016.51
7.4.300.0060.00016.52
7.4.290.0050.00216.52
7.4.280.0080.00016.55
7.4.270.0040.00416.38
7.4.260.0000.00816.33
7.4.250.0030.00616.41
7.4.240.0070.00016.34
7.4.230.0030.00316.45
7.4.220.0120.00916.55
7.4.210.0150.00016.39
7.4.200.0030.00316.48
7.4.160.0100.00616.51
7.4.150.0140.00317.40
7.4.140.0070.01017.86
7.4.130.0090.00916.54
7.4.120.0090.00816.42
7.4.110.0000.01716.25
7.4.100.0060.01216.67
7.4.90.0090.00616.19
7.4.80.0060.01116.38
7.4.70.0120.00416.44
7.4.60.0150.00616.33
7.4.50.0040.01116.45
7.4.40.0070.01016.38
7.4.30.0070.01016.52
7.4.00.0040.01115.11
7.3.330.0000.00513.00
7.3.320.0030.00313.21
7.3.310.0030.00316.41
7.3.300.0030.00316.07
7.3.290.0060.00916.30
7.3.280.0080.00816.30
7.3.270.0030.01317.40
7.3.260.0180.00416.29
7.3.250.0090.00916.39
7.3.240.0060.01516.29
7.3.230.0100.00716.28
7.3.210.0100.00716.18
7.3.200.0070.01016.25
7.3.190.0160.00416.27
7.3.180.0140.00316.35
7.3.170.0110.01116.39
7.3.160.0090.01216.32
7.2.330.0090.00916.68
7.2.320.0110.01116.57
7.2.310.0110.00616.43
7.2.300.0130.00916.59
7.2.290.0030.01316.36
7.2.60.0110.00616.83
7.2.50.0030.01016.68
7.1.200.0060.00715.61
7.1.70.0070.00316.96
7.1.60.0030.00816.82
7.1.00.1770.06020.73
7.0.200.0070.01016.72
7.0.140.0970.05720.13
7.0.130.1470.07020.37
7.0.120.0900.06020.19
7.0.110.1330.07320.12
7.0.100.0700.06320.18
7.0.90.1430.05720.31
7.0.80.0800.05020.38
7.0.70.1270.06020.21
7.0.60.0770.06020.18
7.0.50.0670.06020.18
7.0.40.0930.06020.29
7.0.30.0670.06020.19
7.0.20.0730.05720.18
7.0.10.0830.04020.34
7.0.00.1130.06720.38
5.6.290.0070.06720.82
5.6.280.0200.07020.87
5.6.270.0170.05321.07
5.6.260.0030.06720.77
5.6.250.0000.06720.81
5.6.240.0070.06320.82
5.6.230.0070.06720.96
5.6.220.0130.06020.94
5.6.210.0230.04720.82
5.6.200.0170.07320.92
5.6.190.0130.08020.77
5.6.180.0070.06720.82
5.6.170.0030.06321.09
5.6.160.0130.07321.05
5.6.150.0130.07021.05
5.6.140.0100.07021.00
5.6.130.0100.08021.02
5.6.120.0170.07721.04
5.6.110.0270.05720.98
5.6.100.0100.06320.75
5.6.90.0170.06320.86
5.6.80.0000.06020.23
5.6.70.0070.05720.22
5.6.60.0100.05720.40
5.6.50.0100.07320.46
5.6.40.0130.06720.24
5.6.30.0070.07720.22
5.6.20.0070.06320.39
5.6.10.0130.05020.38
5.6.00.0170.06320.36

preferences:
105.23 ms | 1554 KiB | 5 Q