3v4l.org

run code in 300+ PHP versions simultaneously
<?php ########### SIMULATE DATABASE INSERTED DATA ############ $apple = new stdClass; $apple->id = 1; $apple->name = "Apple"; $banana = new stdClass; $banana->id = 2; $banana->name = "Banana"; $carrot = new stdClass; $carrot->id = 3; $carrot->name = "Carrot"; $dill = new stdClass; $dill->id = 4; $dill->name = "Dill"; $egg = new stdClass; $egg->id = 5; $egg->name = "Egg"; $fred = new stdClass; $fred->id = 6; $fred->name = "Fred"; $goat = new stdClass; $goat->id = 7; $goat->name = "Goat"; $harry = new stdClass; $harry->id = 8; $harry->name = "Harry"; $obj_array[] = $harry; $igloo = new stdClass; $igloo->id = 9; $igloo->name = "Igloo"; $jason = new stdClass; $jason->id = 10; $jason->name = "Jason"; $klaus = new stdClass; $klaus->id = 11; $klaus->name = "Klaus"; $apple->link = array($banana, $egg); $banana->link = array($carrot); $carrot->link = array($apple, $banana, $carrot); $dill->link = array($apple, $egg); $egg->link = array($fred); $fred->link = array($goat); $goat->link = array($goat, $harry); $igloo->link = array($banana, $egg); $jason->link = array($apple, $egg, $harry); $klaus->link = array($apple, $egg); ################### END OF DATABASE INSERTS ############## function processObjNetwork(stdClass $rootObj){ $linkedObjects = array(); $process = function(stdClass $obj) use(&$linkedObjects, &$process){ if(isset($linkedObjects[$obj->id])) return; else $linkedObjects[$obj->id] = $obj; if(empty($obj->link)) return; foreach($obj->link as $child) $process($child); }; $process($rootObj); return $linkedObjects; } $linkedObjects = processObjNetwork($apple); foreach($linkedObjects as $obj) echo "$obj->name \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.3.110.0060.00320.94
8.3.100.0080.00024.06
8.3.90.0120.00626.77
8.3.80.0100.00018.30
8.3.70.0040.02216.75
8.3.60.0120.00318.43
8.3.50.0050.01016.67
8.3.40.0000.01818.82
8.3.30.0040.01118.76
8.3.20.0040.00420.38
8.3.10.0000.01019.21
8.3.00.0040.00422.00
8.2.230.0060.00322.58
8.2.220.0030.00537.54
8.2.210.0100.00326.77
8.2.200.0030.00616.88
8.2.190.0120.00616.75
8.2.180.0100.01025.92
8.2.170.0130.01019.08
8.2.160.0100.00322.96
8.2.150.0080.00025.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0000.00819.09
8.2.110.0000.00922.25
8.2.100.0080.00418.02
8.2.90.0000.00820.07
8.2.80.0040.00420.67
8.2.70.0040.00418.16
8.2.60.0030.00618.22
8.2.50.0040.00418.10
8.2.40.0030.00621.25
8.2.30.0050.00319.50
8.2.20.0060.00318.07
8.2.10.0000.00818.24
8.2.00.0040.00418.07
8.1.290.0060.00330.84
8.1.280.0040.01125.92
8.1.270.0080.00023.99
8.1.260.0060.00326.35
8.1.250.0070.00028.09
8.1.240.0090.00019.39
8.1.230.0060.00621.18
8.1.220.0040.00417.78
8.1.210.0060.00319.16
8.1.200.0090.00017.38
8.1.190.0090.00017.48
8.1.180.0030.00618.10
8.1.170.0030.00618.66
8.1.160.0000.00818.91
8.1.150.0030.00520.33
8.1.140.0000.00819.63
8.1.130.0070.00017.54
8.1.120.0000.00717.61
8.1.110.0060.00317.50
8.1.100.0030.00617.43
8.1.90.0060.00317.55
8.1.80.0050.00317.45
8.1.70.0030.00317.45
8.1.60.0030.00717.55
8.1.50.0030.00617.60
8.1.40.0040.00417.58
8.1.30.0080.00017.75
8.1.20.0030.00617.61
8.1.10.0070.00317.62
8.1.00.0040.00417.48
8.0.300.0050.00320.26
8.0.290.0000.01017.00
8.0.280.0070.00318.54
8.0.270.0050.00317.38
8.0.260.0030.00516.91
8.0.250.0000.00817.14
8.0.240.0000.00817.14
8.0.230.0000.00717.06
8.0.220.0000.00816.87
8.0.210.0040.00416.99
8.0.200.0030.00317.13
8.0.190.0040.00416.97
8.0.180.0040.00417.01
8.0.170.0000.00717.11
8.0.160.0040.00317.03
8.0.150.0030.00316.93
8.0.140.0050.00316.91
8.0.130.0000.00613.41
8.0.120.0070.00016.97
8.0.110.0070.00016.89
8.0.100.0000.00717.02
8.0.90.0000.00716.88
8.0.80.0090.00617.06
8.0.70.0070.00017.02
8.0.60.0000.00817.06
8.0.50.0050.00217.01
8.0.30.0110.00817.13
8.0.20.0100.01017.44
8.0.10.0030.00516.97
8.0.00.0070.01017.00
7.4.330.0000.00515.55
7.4.320.0030.00316.65
7.4.300.0000.00616.57
7.4.290.0000.00716.57
7.4.280.0070.00016.58
7.4.270.0090.00016.71
7.4.260.0050.00216.57
7.4.250.0080.00016.53
7.4.240.0040.00416.68
7.4.230.0000.00716.38
7.4.220.0160.00216.60
7.4.210.0100.00616.53
7.4.200.0000.00816.67
7.4.160.0060.01316.58
7.4.150.0100.00717.40
7.4.140.0080.01117.86
7.4.130.0120.00616.41
7.4.120.0090.00916.52
7.4.110.0040.01316.55
7.4.100.0090.01516.71
7.4.90.0060.01016.62
7.4.80.0180.00019.39
7.4.70.0070.01516.41
7.4.60.0090.00816.66
7.4.50.0030.01016.52
7.4.40.0140.00316.57
7.4.30.0120.00616.49
7.4.10.0030.01415.07
7.4.00.0100.00815.10
7.3.330.0000.00813.32
7.3.320.0030.00313.37
7.3.310.0000.00816.45
7.3.300.0040.00416.41
7.3.290.0060.01016.38
7.3.280.0100.00616.42
7.3.270.0030.01417.40
7.3.260.0060.01216.45
7.3.250.0090.01216.47
7.3.240.0070.01016.54
7.3.230.0060.01116.68
7.3.210.0040.01216.34
7.3.200.0080.00816.65
7.3.190.0070.01016.41
7.3.180.0100.01016.57
7.3.170.0100.01016.48
7.3.160.0080.00816.44
7.3.130.0060.01315.03
7.3.120.0030.00914.96
7.3.110.0060.01314.95
7.3.100.0070.00714.89
7.3.90.0130.00314.95
7.3.80.0060.00614.87
7.3.70.0000.00914.80
7.3.60.0070.00715.04
7.3.50.0090.00614.82
7.3.40.0050.00514.81
7.3.30.0080.00414.86
7.3.20.0100.00616.65
7.3.10.0090.00716.57
7.3.00.0130.00516.54
7.2.330.0130.01316.85
7.2.320.0070.01016.71
7.2.310.0190.00016.85
7.2.300.0090.00916.78
7.2.290.0000.01616.64
7.2.260.0040.01214.70
7.2.250.0080.01115.27
7.2.240.0070.00715.30
7.2.230.0030.01215.00
7.2.220.0030.01015.14
7.2.210.0040.01114.80
7.2.200.0030.01015.22
7.2.190.0070.00415.21
7.2.180.0000.01314.86
7.2.170.0030.01215.30
7.2.160.0060.00915.05
7.2.150.0140.00017.05
7.2.140.0000.01817.17
7.2.130.0110.00516.76
7.2.120.0100.00416.84
7.2.110.0120.00516.63
7.2.100.0080.01216.80
7.2.90.0080.01216.94
7.2.80.0050.01116.76
7.2.70.0140.01016.64
7.2.60.0060.01017.06
7.2.50.0140.00716.65
7.2.40.0130.00716.71
7.2.30.0090.00916.83
7.2.20.0140.01016.80
7.2.10.0150.00816.65
7.2.00.0100.01116.80
7.1.330.0040.01115.75
7.1.320.0070.01015.71
7.1.310.0060.00615.91
7.1.300.0060.00915.67
7.1.290.0040.01115.70
7.1.280.0070.00315.81
7.1.270.0150.00015.86
7.1.260.0000.01515.54
7.1.250.0080.00615.72
7.1.240.0080.00815.79
7.1.230.0060.00615.91
7.1.220.0060.00915.61
7.1.210.0000.01015.70
7.1.200.0040.00815.80
7.1.190.0000.01315.84
7.1.180.0060.00915.83
7.1.170.0040.00715.99
7.1.160.0030.01015.77
7.1.150.0090.00615.58
7.1.140.0070.01115.76
7.1.130.0030.00615.90
7.1.120.0000.01215.76
7.1.110.0070.00715.59
7.1.100.0130.00015.59
7.1.90.0000.00915.63
7.1.80.0160.01116.91
7.1.70.0120.00915.82
7.1.60.0180.00625.46
7.1.50.0120.00825.23
7.1.40.0190.01324.15
7.1.30.0230.01324.29
7.1.20.0170.00924.09
7.1.10.0110.00815.24
7.1.00.0140.00515.24
7.0.330.0070.00715.27
7.0.320.0070.00415.46
7.0.310.0120.00315.39
7.0.300.0040.00415.46
7.0.290.0040.01115.43
7.0.280.0090.00615.32
7.0.270.0050.00515.18
7.0.260.0100.00715.50
7.0.250.0030.01315.61
7.0.240.0100.00315.61
7.0.230.0040.00815.26
7.0.220.0070.01015.19
7.0.210.0030.00915.26
7.0.200.0060.00816.09
7.0.190.0080.00816.17
7.0.180.0080.00715.88
7.0.170.0090.00615.95
7.0.160.0070.01314.78
7.0.150.0150.00514.90
7.0.140.0080.01114.97
7.0.130.0120.00715.11
7.0.120.0110.00116.15
7.0.110.0030.01015.80
7.0.100.0100.00715.05
7.0.90.0100.00815.12
7.0.80.0090.00915.05
7.0.70.0050.00715.93
7.0.60.0150.00215.01
7.0.50.0140.00515.19
7.0.40.0080.01114.11
7.0.30.0090.00914.17
7.0.20.0050.01113.98
7.0.10.0070.01014.19
7.0.00.0050.00815.00
5.6.400.0030.01014.36
5.6.390.0040.01114.59
5.6.380.0060.00614.65
5.6.370.0060.00914.46
5.6.360.0030.01014.63
5.6.350.0000.00914.44
5.6.340.0040.01514.34
5.6.330.0030.00914.19
5.6.320.0080.00814.59
5.6.310.0110.00614.63
5.6.300.0070.00314.43
5.6.290.0100.00314.81
5.6.280.0070.00714.63
5.6.270.0030.01314.48
5.6.260.0040.00414.50
5.6.250.0030.00914.34
5.6.240.0040.00414.34
5.6.230.0030.01314.58
5.6.220.0000.01414.46
5.6.210.0060.00914.40
5.6.200.0030.01014.47
5.6.190.0090.00914.45
5.6.180.0080.00314.41
5.6.170.0060.00614.63
5.6.160.0000.01314.46
5.6.150.0030.00714.38
5.6.140.0100.00314.84
5.6.130.0000.00914.33
5.6.120.0030.00814.31
5.6.110.0030.01014.42
5.6.100.0060.00314.25
5.6.90.0030.01014.66
5.6.80.0060.00914.47
5.6.70.0030.01014.41
5.6.60.0100.00314.30
5.6.50.0070.00714.59
5.6.40.0060.00614.22
5.6.30.0060.01014.12
5.6.20.0060.00314.32
5.6.10.0030.01014.56
5.6.00.0030.01214.40

preferences:
60.8 ms | 403 KiB | 5 Q