3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $foo; private $bar; protected $baz; } class FooSelfHydratingProxy extends Foo { /** zero-argument constructor since this is just a helper class for hydration */ public function __construct() { } /** * the `Foo` typehint is not part of the interface - here only for the sake of readability/clearness */ public function hydrate($data, Foo $object) { $object->foo = $data['foo']; $object->bar = $data['bar']; $object->baz = $data['baz']; } /** * the `Foo` typehint is not part of the interface - here only for the sake of readability/clearness */ public function extract(Foo $object) { return array('foo' => $object->foo, 'bar' => $object->bar, 'baz' => $object->baz); } } $data = array('foo' => 1, 'bar' => 2, 'baz' => 3); $hydrator = new FooSelfHydratingProxy(); $hydrated = new Foo(); $hydrator->hydrate(array('foo' => 1, 'bar' => 2, 'baz' => 3), $hydrated); var_dump($hydrated);

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.60.0110.01117.00
8.3.50.0130.00318.40
8.3.40.0090.00618.92
8.3.30.0120.00318.79
8.3.20.0070.00020.20
8.3.10.0080.00023.58
8.3.00.0040.00420.10
8.2.180.0090.00618.41
8.2.170.0070.00722.96
8.2.160.0070.00720.23
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0050.00521.14
8.2.120.0000.00826.35
8.2.110.0070.00321.13
8.2.100.0060.00619.20
8.2.90.0040.00417.75
8.2.80.0000.00817.97
8.2.70.0000.00817.92
8.2.60.0030.00618.22
8.2.50.0040.00418.10
8.2.40.0000.00822.15
8.2.30.0040.00420.62
8.2.20.0040.00417.68
8.2.10.0040.00418.11
8.2.00.0070.00018.11
8.1.280.0060.00925.92
8.1.270.0070.00720.24
8.1.260.0040.00428.09
8.1.250.0070.00028.09
8.1.240.0090.00021.21
8.1.230.0040.00819.22
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0120.00017.13
8.1.190.0030.00517.35
8.1.180.0040.00418.10
8.1.170.0030.00618.47
8.1.160.0000.00820.59
8.1.150.0040.00418.74
8.1.140.0000.00819.43
8.1.130.0000.00717.64
8.1.120.0040.00417.42
8.1.110.0040.00417.44
8.1.100.0020.00517.39
8.1.90.0040.00417.31
8.1.80.0000.00817.28
8.1.70.0000.00817.36
8.1.60.0040.00417.51
8.1.50.0000.00917.43
8.1.40.0080.00017.53
8.1.30.0050.00317.49
8.1.20.0050.00317.63
8.1.10.0050.00317.47
8.1.00.0040.00417.52
8.0.300.0040.00419.77
8.0.290.0050.00316.75
8.0.280.0080.00018.44
8.0.270.0040.00417.11
8.0.260.0000.00617.12
8.0.250.0030.00516.91
8.0.240.0000.00816.97
8.0.230.0000.00816.95
8.0.220.0030.00316.83
8.0.210.0000.00716.95
8.0.200.0080.00016.82
8.0.190.0040.00416.87
8.0.180.0000.00716.91
8.0.170.0000.00716.92
8.0.160.0030.00316.95
8.0.150.0070.00016.80
8.0.140.0000.00816.73
8.0.130.0000.00513.32
8.0.120.0040.00416.74
8.0.110.0050.00316.92
8.0.100.0040.00416.95
8.0.90.0000.00716.86
8.0.80.0060.01016.78
8.0.70.0040.00416.79
8.0.60.0050.00216.77
8.0.50.0020.00516.77
8.0.30.0120.00717.05
8.0.20.0110.00917.40
8.0.10.0040.00416.99
8.0.00.0140.00816.66
7.4.330.0050.00016.77
7.4.320.0040.00416.34
7.4.300.0060.00316.61
7.4.290.0070.00016.55
7.4.280.0030.00616.48
7.4.270.0070.00016.52
7.4.260.0030.00316.56
7.4.250.0070.00016.40
7.4.240.0050.00216.53
7.4.230.0000.00716.62
7.4.220.0060.01316.55
7.4.210.0120.00316.58
7.4.200.0050.00216.41
7.4.160.0090.00616.64
7.4.150.0110.00817.40
7.4.140.0110.00917.86
7.4.130.0070.01216.46
7.4.120.0140.00716.58
7.4.110.0120.00616.77
7.4.100.0100.00716.55
7.4.90.0060.01516.58
7.4.80.0150.00719.39
7.4.70.0070.01516.59
7.4.60.0150.00316.66
7.4.50.0100.00316.56
7.4.40.0090.00916.64
7.4.30.0100.00616.57
7.4.00.0050.01115.13
7.3.330.0040.00213.26
7.3.320.0000.00613.23
7.3.310.0070.00016.47
7.3.300.0000.00816.30
7.3.290.0070.00816.39
7.3.280.0090.01116.37
7.3.270.0100.00617.40
7.3.260.0160.00016.68
7.3.250.0110.01016.43
7.3.240.0080.01216.41
7.3.230.0060.01316.56
7.3.210.0100.00716.39
7.3.200.0100.00616.43
7.3.190.0080.00816.25
7.3.180.0060.01016.34
7.3.170.0110.00916.30
7.3.160.0090.00916.60
7.3.120.0050.01114.60
7.3.110.0090.00514.95
7.3.100.0030.01014.60
7.3.90.0130.00414.85
7.3.80.0030.01014.91
7.3.70.0080.00614.85
7.3.60.0050.00714.73
7.3.50.0020.01114.71
7.3.40.0060.00714.79
7.3.30.0030.00714.81
7.3.20.0070.00816.46
7.3.10.0080.00516.65
7.3.00.0020.01316.67
7.2.330.0120.00616.81
7.2.320.0060.01216.35
7.2.310.0040.01216.80
7.2.300.0140.00416.37
7.2.290.0110.00716.80
7.2.250.0090.00914.88
7.2.240.0040.01115.03
7.2.230.0070.00714.86
7.2.220.0100.00514.81
7.2.210.0040.01014.94
7.2.200.0060.00514.97
7.2.190.0040.01115.01
7.2.180.0110.00514.91
7.2.170.0030.01114.93
7.2.160.0030.01014.81
7.2.150.0030.01216.98
7.2.140.0030.00916.57
7.2.130.0060.00617.01
7.2.120.0070.01116.65
7.2.110.0070.00716.81
7.2.100.0140.00016.49
7.2.90.0060.00916.94
7.2.80.0000.01016.71
7.2.70.0090.00916.73
7.2.60.0050.01216.73
7.2.50.0000.01816.77
7.2.40.0080.00816.74
7.2.30.0090.00616.49
7.2.20.0030.01017.05
7.2.10.0070.00716.50
7.2.00.0060.00918.06
7.1.330.0060.00515.80
7.1.320.0040.00915.63
7.1.310.0040.00915.73
7.1.300.0050.00615.55
7.1.290.0050.01015.73
7.1.280.0050.00915.75
7.1.270.0030.00915.57
7.1.260.0030.01015.75
7.1.250.0090.00615.83
7.1.200.0070.00715.55
7.1.100.0060.00618.40
7.1.70.0070.00516.84
7.1.60.0090.01619.13
7.1.50.0030.01917.00
7.1.00.0030.07322.41
7.0.200.0050.00216.51
7.0.60.0130.06719.98
7.0.50.0070.05017.88
7.0.40.0070.05320.11
7.0.30.0300.04720.07
7.0.20.0330.07020.16
7.0.10.0100.03720.23
7.0.00.0100.07720.22
5.6.280.0000.07321.14
5.6.210.0100.07720.56
5.6.200.0000.04718.18
5.6.190.0030.06720.41
5.6.180.0100.06720.47
5.6.170.0300.07720.50
5.6.160.0030.05020.52
5.6.150.0100.05318.25
5.6.140.0100.06318.16
5.6.130.0030.06018.17
5.6.120.0100.07721.03
5.6.110.0030.09021.03
5.6.100.0100.08021.00
5.6.90.0170.06321.01
5.6.80.0100.05720.42
5.5.350.0100.07320.47
5.5.340.0100.04317.98
5.5.330.0130.07720.27
5.5.320.0370.07720.42
5.5.310.0330.06720.51
5.5.300.0030.04018.00
5.5.290.0100.07718.08
5.5.280.0070.08020.78
5.5.270.0100.03720.78
5.5.260.0070.08720.77
5.5.250.0170.06320.71
5.5.240.0200.08020.20

preferences:
51.81 ms | 401 KiB | 5 Q