3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Item { private $id; private $name; function __construct(int $id, string $name) { $this->id = $id; $this->name = $name; } public function __get($prop) { return $this->$prop; } } $itemList = [ new Item(1, "Item 1"), new Item(2, "Item 2"), new Item(3, "Item 3"), new Item(4, "Item 4") ]; echo implode(',', array_map(fn($obj) => $obj->id, $itemList)); echo "\n---\n"; echo array_reduce( $itemList, fn($result, $obj) => $result . ($result ? ',' : '') . $obj->id );

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.00924.19
8.4.110.0120.01220.41
8.4.100.0140.00718.82
8.4.90.0130.00722.26
8.4.80.0090.01118.75
8.4.70.0060.00317.81
8.4.60.0150.00718.66
8.4.50.0120.00919.29
8.4.40.0180.00617.72
8.4.30.0160.00318.91
8.4.20.0060.00617.90
8.4.10.0060.00319.42
8.3.250.0110.00918.74
8.3.240.0120.00717.35
8.3.230.0120.00716.75
8.3.220.0040.00418.83
8.3.210.0140.00416.44
8.3.200.0040.00616.52
8.3.190.0130.00616.72
8.3.180.0110.00820.98
8.3.170.0130.00718.92
8.3.160.0150.00418.30
8.3.150.0120.00619.27
8.3.140.0150.00016.50
8.3.130.0040.00418.57
8.3.120.0150.00020.89
8.3.110.0120.00620.94
8.3.100.0050.00524.06
8.3.90.0080.00826.77
8.3.80.0060.00616.63
8.3.70.0100.01016.48
8.3.60.0060.00916.75
8.3.50.0090.00916.75
8.3.40.0000.01521.98
8.3.30.0040.01119.42
8.3.20.0040.00424.18
8.3.10.0080.00024.66
8.3.00.0040.00426.16
8.2.290.0120.00720.59
8.2.280.0110.00922.41
8.2.270.0040.00417.38
8.2.260.0000.00818.99
8.2.250.0000.01616.81
8.2.240.0070.00319.17
8.2.230.0060.00322.58
8.2.220.0060.00337.54
8.2.210.0070.01126.77
8.2.200.0110.00016.63
8.2.190.0070.01116.58
8.2.180.0040.01516.50
8.2.170.0040.01122.96
8.2.160.0040.01122.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0030.00717.38
8.2.110.0140.00722.11
8.2.100.0180.00320.58
8.2.90.0070.01520.70
8.2.80.0180.00320.48
8.2.70.0040.01820.48
8.2.60.0150.00620.32
8.2.50.0110.00820.55
8.2.40.0120.00920.39
8.2.30.0070.01020.55
8.2.20.0060.01020.50
8.2.10.0000.00920.38
8.2.00.0150.00620.62
8.1.330.0090.00921.92
8.1.320.0120.00716.50
8.1.310.0070.01118.62
8.1.300.0090.00619.56
8.1.290.0040.00818.88
8.1.280.0120.00325.92
8.1.270.0040.01124.66
8.1.260.0030.00626.35
8.1.250.0040.00428.09
8.1.240.0100.01020.35
8.1.230.0170.00320.22
8.1.220.0070.00320.23
8.1.210.0100.00721.70
8.1.200.0030.00620.29
8.1.190.0090.00920.21
8.1.180.0100.00720.34
8.1.170.0070.00420.18
8.1.160.0070.01420.70
8.1.150.0080.01120.41
8.1.140.0070.00320.34
8.1.130.0160.00620.35
8.1.120.0090.00920.47
8.1.110.0140.00320.33
8.1.100.0070.00320.46
8.1.90.0120.00920.45
8.1.80.0080.01220.41
8.1.70.0070.00320.51
8.1.60.0090.00020.46
8.1.50.0120.00920.39
8.1.40.0110.01120.46
8.1.30.0170.00320.60
8.1.20.0110.00420.66
8.1.10.0030.01720.52
8.1.00.0100.00020.47
8.0.300.0030.00619.73
8.0.290.0120.00019.59
8.0.280.0130.00719.68
8.0.270.0090.00019.80
8.0.260.0030.00619.77
8.0.250.0090.00619.63
8.0.240.0090.00019.71
8.0.230.0070.00719.59
8.0.220.0090.00017.83
8.0.210.0130.00317.86
8.0.200.0090.00017.84
8.0.190.0110.00817.88
8.0.180.0160.00017.96
8.0.170.0090.00017.87
8.0.160.0060.00318.01
8.0.150.0060.00317.80
8.0.140.0110.00717.84
8.0.130.0040.00819.76
8.0.120.0060.00319.76
8.0.110.0130.00719.93
8.0.100.0190.00019.74
8.0.90.0110.00419.75
8.0.80.0130.00319.69
8.0.70.0090.00019.74
8.0.60.0090.00019.73
8.0.50.0130.00319.62
8.0.30.0070.00719.62
8.0.20.0090.00019.87
8.0.10.0110.00419.82

preferences:
61.77 ms | 403 KiB | 5 Q