3v4l.org

run code in 300+ PHP versions simultaneously
<?php $obj = (object) [ 'foo' => 'bar', 'foo2' => 'bar2' ]; $coll = collect($obj); var_dump($coll[0]); // returns object // but what about... // $coll->foo // Or dump($coll[0]) .. // The end goal is object in ... do collection stuff on it ... object out. // This is not possible without ->toArray and then (object) on that array.

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.10.0120.00816.63
8.5.00.0120.01020.08
8.4.150.0020.00114.05
8.4.140.0090.01217.77
8.4.130.0070.00219.72
8.4.120.0120.01024.18
8.4.110.0110.00922.68
8.4.100.0120.00918.57
8.4.90.0130.00718.84
8.4.80.0080.00318.93
8.4.70.0110.00820.88
8.4.60.0110.01018.95
8.4.50.0030.00518.80
8.4.40.0080.00019.36
8.4.30.0160.00318.48
8.4.20.0040.00420.85
8.4.10.0090.00017.83
8.3.280.0120.00718.26
8.3.270.0110.00816.60
8.3.260.0080.01216.54
8.3.250.0110.00718.75
8.3.240.0100.00917.10
8.3.230.0040.00416.81
8.3.220.0120.00619.04
8.3.210.0040.00416.79
8.3.200.0050.00416.55
8.3.190.0110.00918.75
8.3.180.0100.01117.05
8.3.170.0060.01220.74
8.3.160.0040.01517.16
8.3.150.0140.00716.96
8.3.140.0140.00316.65
8.3.130.0140.00318.45
8.3.120.0060.01020.77
8.3.110.0030.00620.94
8.3.100.0130.00616.61
8.3.90.0040.00416.66
8.3.80.0000.00917.97
8.3.70.0060.00918.31
8.3.60.0120.00618.56
8.3.50.0110.00816.63
8.3.40.0080.01218.84
8.3.30.0090.00618.81
8.3.20.0000.00721.73
8.3.10.0080.00022.10
8.3.00.0070.00022.44
8.2.290.0110.00820.70
8.2.280.0130.00718.54
8.2.270.0110.00417.03
8.2.260.0040.01516.86
8.2.250.0040.00418.62
8.2.240.0060.00319.09
8.2.230.0050.00322.58
8.2.220.0090.00024.06
8.2.210.0170.00026.77
8.2.200.0080.00018.62
8.2.190.0000.01516.75
8.2.180.0040.01118.54
8.2.170.0150.00022.96
8.2.160.0110.00722.03
8.2.150.0060.00324.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0000.00826.16
8.2.110.0070.00320.52
8.2.100.0060.00617.91
8.2.90.0050.00319.38
8.2.80.0040.00417.97
8.2.70.0030.00618.04
8.2.60.0000.00818.05
8.2.50.0000.00818.10
8.2.40.0080.00419.21
8.2.30.0000.00719.19
8.2.20.0040.00418.06
8.2.10.0000.00719.28
8.2.00.0000.00819.20
8.1.330.0110.00721.76
8.1.320.0110.01016.37
8.1.310.0070.01116.68
8.1.300.0030.01620.11
8.1.290.0090.00018.88
8.1.280.0180.00325.92
8.1.270.0050.00322.19
8.1.260.0000.00726.35
8.1.250.0070.00028.09
8.1.240.0030.00624.02
8.1.230.0040.00718.95
8.1.220.0000.00817.74
8.1.210.0080.00020.91
8.1.200.0090.00017.35
8.1.190.0040.00417.35
8.1.180.0040.00718.10
8.1.170.0000.00818.50
8.1.160.0040.00419.02
8.1.150.0030.00618.87
8.1.140.0000.00720.77
8.1.130.0040.00420.00
8.1.120.0070.00017.30
8.1.110.0040.00417.37
8.1.100.0080.00017.37
8.1.90.0000.00817.32
8.1.80.0040.00417.33
8.1.70.0040.00417.32
8.1.60.0060.00917.57
8.1.50.0040.00417.55
8.1.40.0000.00817.44
8.1.30.0040.00417.52
8.1.20.0040.00417.59
8.1.10.0030.00517.58
8.1.00.0050.00317.53
8.0.300.0000.00719.79
8.0.290.0090.00016.75
8.0.280.0080.00018.45
8.0.270.0070.00017.25
8.0.260.0050.00220.10
8.0.250.0070.00016.88
8.0.240.0030.00316.90
8.0.230.0000.00716.85
8.0.220.0030.00316.92
8.0.210.0080.00016.88
8.0.200.0030.00316.92
8.0.190.0080.00016.93
8.0.180.0050.00216.83
8.0.170.0090.00316.80
8.0.160.0040.00416.91
8.0.150.0000.00716.86
8.0.140.0000.00816.87
8.0.130.0030.00313.25
8.0.120.0000.00816.73
8.0.110.0000.00816.73
8.0.100.0040.00416.89
8.0.90.0040.00416.70
8.0.80.0070.01116.80
8.0.70.0040.00417.01
8.0.60.0050.00216.96
8.0.50.0030.00516.90
8.0.30.0040.01416.92
8.0.20.0070.01416.84
8.0.10.0030.00516.99
8.0.00.0040.01416.86
7.4.330.0000.00616.82
7.4.320.0000.00616.57
7.4.300.0000.00716.58
7.4.290.0030.00516.39
7.4.280.0000.00916.55
7.4.270.0050.00216.65
7.4.260.0070.00013.26
7.4.250.0030.00616.48
7.4.240.0020.00516.49
7.4.230.0000.00716.30
7.4.220.0030.00416.50
7.4.210.0080.00816.54
7.4.200.0070.00016.39
7.4.130.0120.00616.64
7.4.120.0110.01016.48
7.4.110.0070.01316.49
7.4.100.0060.01716.70
7.4.90.0090.00916.45
7.4.80.0110.00619.39
7.4.70.0100.00716.36
7.4.60.0060.01016.46
7.4.50.0150.00316.55
7.4.40.0080.00916.43
7.4.00.0050.01014.97
7.3.330.0070.00016.08
7.3.320.0030.00313.16
7.3.310.0000.00716.22
7.3.300.0000.00716.17
7.3.290.0070.00016.29
7.3.280.0070.01316.27
7.3.260.0110.00816.34
7.3.240.0080.00816.38
7.3.230.0040.01416.42
7.3.210.0090.00916.52
7.3.200.0130.00716.16
7.3.190.0040.01216.49
7.3.180.0030.01516.21
7.3.170.0090.00616.28
7.3.160.0000.01616.43
7.3.120.0100.01014.55
7.3.110.0090.00914.79
7.3.100.0130.00314.60
7.3.90.0100.00315.06
7.3.80.0110.00514.86
7.3.70.0090.00714.68
7.3.60.0100.00614.64
7.3.50.0080.00814.74
7.3.40.0060.01014.81
7.3.30.0060.00814.65
7.3.20.0040.01116.66
7.3.10.0090.00816.49
7.3.00.0070.00816.56
7.2.330.0110.00716.58
7.2.320.0100.00716.68
7.2.310.0130.00716.72
7.2.300.0100.00616.30
7.2.290.0070.01016.59
7.2.250.0060.00915.04
7.2.240.0030.01314.79
7.2.230.0090.00914.91
7.2.220.0050.00515.14
7.2.210.0090.00915.14
7.2.200.0080.00815.09
7.2.190.0120.00514.90
7.2.180.0110.00515.02
7.2.170.0080.00614.84
7.2.160.0040.01814.99
7.2.150.0170.00016.75
7.2.140.0100.01016.70
7.2.130.0070.01316.57
7.2.120.0060.01316.84
7.2.110.0130.00716.80
7.2.100.0130.00616.63
7.2.90.0070.01516.86
7.2.80.0070.01416.88
7.2.70.0100.01016.73
7.2.60.0070.01316.61
7.2.50.0070.01016.74
7.2.40.0030.01416.81
7.2.30.0060.00916.96
7.2.20.0000.01616.77
7.2.10.0000.01716.89
7.2.00.0150.00016.48
7.1.330.0040.01115.58
7.1.320.0060.00615.89
7.1.310.0040.01015.77
7.1.300.0070.00815.67
7.1.290.0000.01615.75
7.1.280.0080.00715.53
7.1.270.0130.00315.57
7.1.260.0030.01015.54
7.1.250.0030.01515.70

preferences:
38.51 ms | 403 KiB | 5 Q