3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Struct { function __construct() { foreach (func_get_args() as $name) { $this->$name = null; } } function __invoke(... $values) { $obj = clone $this; foreach ($obj as $index => $name) { $obj->name = array_shift($values); } return $obj; } } $Coord = new Struct('x', 'y', 'z'); $Coord->z = 0; $c1 = $Coord(12, 45, -34); print_r($c1); $c2 = $Coord(100, -100); print_r($c2); $Person = new Struct('firstname', 'lastname'); $p1 = $Person('William', 'Wallace'); print_r($p1); $p2 = $Person('Peter', 'Griffin'); print_r($p2);

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.40.0140.00418.77
8.3.30.0070.00719.17
8.3.20.0000.00820.21
8.3.10.0000.00821.90
8.3.00.0070.00319.50
8.2.170.0070.01122.96
8.2.160.0150.00420.44
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0080.00022.10
8.2.110.0100.00720.49
8.2.100.0040.01118.09
8.2.90.0040.00419.21
8.2.80.0000.00817.97
8.2.70.0080.00017.62
8.2.60.0000.00817.93
8.2.50.0050.00318.07
8.2.40.0030.00618.09
8.2.30.0040.00417.93
8.2.20.0040.00417.63
8.2.10.0040.00418.12
8.2.00.0030.00617.55
8.1.270.0060.00323.96
8.1.260.0070.00026.35
8.1.250.0000.00728.09
8.1.240.0060.00323.72
8.1.230.0060.00619.14
8.1.220.0030.00517.74
8.1.210.0060.00318.77
8.1.200.0060.00317.35
8.1.190.0050.00317.22
8.1.180.0040.00418.10
8.1.170.0040.00418.71
8.1.160.0000.00721.97
8.1.150.0000.00718.84
8.1.140.0000.00817.50
8.1.130.0030.00317.71
8.1.120.0070.00017.36
8.1.110.0050.00217.35
8.1.100.0040.00417.51
8.1.90.0030.00417.37
8.1.80.0000.00717.32
8.1.70.0050.00317.36
8.1.60.0000.00817.43
8.1.50.0060.00317.42
8.1.40.0050.00217.42
8.1.30.0030.00617.64
8.1.20.0000.00917.63
8.1.10.0030.00617.46
8.1.00.0080.00017.54
8.0.300.0000.00718.77
8.0.290.0040.00416.63
8.0.280.0030.00318.34
8.0.270.0040.00417.26
8.0.260.0060.00017.29
8.0.250.0040.00416.93
8.0.240.0000.00716.98
8.0.230.0030.00316.95
8.0.220.0020.00516.86
8.0.210.0000.00716.76
8.0.200.0070.00016.85
8.0.190.0040.00416.93
8.0.180.0070.00016.93
8.0.170.0000.00816.88
8.0.160.0040.00416.77
8.0.150.0030.00516.80
8.0.140.0040.00416.75
8.0.130.0060.00013.30
8.0.120.0030.00516.82
8.0.110.0000.00716.78
8.0.100.0000.00716.85
8.0.90.0040.00416.98
8.0.80.0030.01616.93
8.0.70.0000.00716.73
8.0.60.0000.00716.92
8.0.50.0070.00016.94
8.0.30.0070.01216.87
8.0.20.0100.01017.40
8.0.10.0000.00716.86
8.0.00.0120.00816.62
7.4.330.0000.00615.00
7.4.320.0040.00416.64
7.4.300.0030.00316.45
7.4.290.0030.00316.52
7.4.280.0040.00416.39
7.4.270.0070.00016.58
7.4.260.0030.00316.59
7.4.250.0070.00016.45
7.4.240.0050.00216.59
7.4.230.0070.00016.38
7.4.220.0090.00916.57
7.4.210.0060.00816.61
7.4.200.0070.00016.59
7.4.160.0120.00916.45
7.4.150.0120.00917.40
7.4.140.0080.01317.86
7.4.130.0070.00916.51
7.4.120.0110.00616.51
7.4.110.0100.00616.52
7.4.100.0070.01116.42
7.4.90.0160.00716.46
7.4.80.0130.01019.39
7.4.70.0090.01516.53
7.4.60.0060.00916.38
7.4.50.0030.00316.34
7.4.40.0130.00316.38
7.4.30.0150.00616.64
7.4.00.0100.00714.79
7.3.330.0060.00013.37
7.3.320.0000.00513.18
7.3.310.0030.00316.35
7.3.300.0030.00316.23
7.3.290.0090.00616.34
7.3.280.0050.01316.35
7.3.270.0090.01617.40
7.3.260.0060.01216.32
7.3.250.0160.00216.45
7.3.240.0130.00316.67
7.3.230.0070.01316.43
7.3.210.0090.00916.47
7.3.200.0060.01619.39
7.3.190.0150.00616.43
7.3.180.0030.01316.30
7.3.170.0060.00916.36
7.3.160.0060.00916.54
7.3.120.0090.00915.12
7.3.110.0030.01414.89
7.3.100.0060.01014.92
7.3.90.0030.01614.71
7.3.80.0090.00614.84
7.3.70.0070.01014.60
7.3.60.0030.00914.81
7.3.50.0090.00614.77
7.3.40.0150.00014.52
7.3.30.0090.00014.61
7.3.20.0070.00316.48
7.3.10.0070.01116.52
7.3.00.0120.00616.53
7.2.330.0090.00916.69
7.2.320.0060.01316.66
7.2.310.0040.01316.49
7.2.300.0070.01416.82
7.2.290.0090.01216.73
7.2.240.0070.01115.23
7.2.230.0030.01415.23
7.2.220.0090.00615.02
7.2.210.0120.00614.86
7.2.200.0030.01015.14
7.2.190.0060.00914.98
7.2.180.0040.01114.92
7.2.170.0100.00715.01
7.2.160.0070.00715.24
7.2.150.0030.01317.07
7.2.140.0120.00617.11
7.2.130.0000.02016.78
7.2.120.0100.01016.73
7.2.110.0070.00616.98
7.2.100.0040.01216.85
7.2.90.0070.00717.09
7.2.80.0060.00916.80
7.2.70.0030.01417.03
7.2.60.0140.00416.95
7.2.50.0090.00617.06
7.2.40.0130.00617.07
7.2.30.0060.01016.66
7.2.20.0130.00317.10
7.2.10.0040.01516.95
7.2.00.0050.00517.07
7.1.330.0080.01115.57
7.1.320.0030.01015.99
7.1.310.0090.00915.71
7.1.300.0030.00615.79
7.1.290.0090.00615.80
7.1.280.0070.00715.54
7.1.270.0000.01415.45
7.1.260.0060.01315.77
7.1.250.0000.01815.46
7.1.70.0040.00716.84
7.1.60.0120.01219.32
7.1.50.0100.01316.99
7.1.00.0000.07722.32
7.0.200.0000.00816.88
7.0.140.0070.06322.15
7.0.60.0130.07719.96
7.0.50.0070.04017.83
7.0.40.0100.07720.14
7.0.30.0370.07720.17
7.0.20.0400.07020.21
7.0.10.0370.07020.08
7.0.00.0030.04320.23
5.6.280.0130.06321.11
5.6.210.0070.08320.51
5.6.200.0100.08018.21
5.6.190.0130.07320.48
5.6.180.0030.04020.41
5.6.170.0330.08320.50
5.6.160.0000.05720.46
5.6.150.0100.04718.23
5.6.140.0030.06018.14
5.6.130.0030.04318.28
5.6.120.0130.07321.15
5.6.110.0030.04020.98
5.6.100.0070.08321.01
5.6.90.0130.07721.13
5.6.80.0030.07320.39
5.6.70.0270.07020.28
5.5.350.0100.08020.47
5.5.340.0130.07317.98
5.5.330.0130.04320.19
5.5.320.0070.08020.34
5.5.310.0230.08020.36
5.5.300.0030.04318.02
5.5.290.0130.06317.99
5.5.280.0030.05720.89
5.5.270.0100.08020.72
5.5.260.0130.08020.84
5.5.250.0000.08720.62
5.5.240.0030.08020.04
5.4.450.0630.05719.64
5.4.440.0400.04019.29
5.4.430.0700.04719.45
5.4.420.0670.00019.36
5.4.410.0630.00019.44
5.4.400.0700.00019.14
5.4.390.0630.00019.25
5.4.380.0670.00019.07
5.4.370.0630.00019.21
5.4.360.0670.00019.16
5.4.350.0670.00019.07
5.4.340.0110.04312.03
5.4.320.0070.05212.52
5.4.310.0080.03712.51
5.4.300.0030.03912.52
5.4.290.0050.04112.52
5.4.280.0120.04912.41
5.4.270.0090.03812.41
5.4.260.0050.03912.41
5.4.250.0100.04012.41
5.4.240.0060.03612.41
5.4.230.0060.03812.41
5.4.220.0030.03812.40
5.4.210.0040.03812.41
5.4.200.0030.04112.41
5.4.190.0060.03712.40
5.4.180.0080.03412.41
5.4.170.0070.03512.41
5.4.160.0110.03112.40
5.4.150.0040.04212.40
5.4.140.0070.03612.09
5.4.130.0050.03612.07
5.4.120.0090.03412.04
5.4.110.0070.03512.03
5.4.100.0050.03612.04
5.4.90.0050.03712.04
5.4.80.0030.03912.03
5.4.70.0070.03612.03
5.4.60.0070.03612.03
5.4.50.0060.03412.03
5.4.40.0040.03612.02
5.4.30.0060.03512.01
5.4.20.0040.03912.01
5.4.10.0090.03112.02
5.4.00.0060.03811.50
5.3.290.0040.04312.80
5.3.280.0080.03712.71
5.3.270.0050.04012.72
5.3.260.0060.03912.72
5.3.250.0040.03812.72
5.3.240.0070.03612.72
5.3.230.0070.03712.71
5.3.220.0060.03712.68
5.3.210.0050.03912.68
5.3.200.0100.03412.68
5.3.190.0040.04112.68
5.3.180.0060.03612.67
5.3.170.0080.03412.67
5.3.160.0070.03712.68
5.3.150.0030.04112.68
5.3.140.0070.03512.66
5.3.130.0050.03912.66
5.3.120.0050.04012.66
5.3.110.0090.03712.66
5.3.100.0040.04312.12
5.3.90.0070.04012.11
5.3.80.0060.03812.10
5.3.70.0040.03812.10
5.3.60.0060.04012.08
5.3.50.0060.03612.03
5.3.40.0040.03912.03
5.3.30.0040.03711.99
5.3.20.0100.03011.77
5.3.10.0050.03611.74
5.3.00.0050.03611.72
5.2.170.0050.0319.23
5.2.160.0040.0319.23
5.2.150.0040.0379.23
5.2.140.0020.0359.22
5.2.130.0030.0309.18
5.2.120.0070.0259.18
5.2.110.0050.0289.19
5.2.100.0060.0279.18
5.2.90.0070.0269.18
5.2.80.0030.0319.18
5.2.70.0050.0299.18
5.2.60.0050.0299.13
5.2.50.0050.0319.11
5.2.40.0030.0299.07
5.2.30.0050.0289.05
5.2.20.0060.0269.04
5.2.10.0020.0298.95
5.2.00.0060.0278.81
5.1.60.0040.0238.09
5.1.50.0040.0248.09
5.1.40.0040.0248.07
5.1.30.0030.0278.42
5.1.20.0050.0258.45
5.1.10.0030.0278.17
5.1.00.0040.0258.16
5.0.50.0020.0226.64
5.0.40.0030.0196.50
5.0.30.0060.0296.32
5.0.20.0040.0186.28
5.0.10.0030.0206.27
5.0.00.0030.0306.26
4.4.90.0030.0144.78
4.4.80.0050.0184.75
4.4.70.0030.0164.76
4.4.60.0020.0164.75
4.4.50.0020.0164.77
4.4.40.0040.0244.71
4.4.30.0020.0164.76
4.4.20.0040.0144.84
4.4.10.0040.0144.84
4.4.00.0040.0234.76
4.3.110.0040.0144.66
4.3.100.0010.0164.66
4.3.90.0020.0154.64
4.3.80.0030.0244.58
4.3.70.0030.0144.63
4.3.60.0040.0134.63
4.3.50.0010.0174.62
4.3.40.0040.0254.54
4.3.30.0020.0193.30
4.3.20.0040.0153.29
4.3.10.0010.0173.24
4.3.00.0130.01313.37

preferences:
42.98 ms | 400 KiB | 5 Q