3v4l.org

run code in 300+ PHP versions simultaneously
<?php function struct(string $name, array $class) { $class = serialize($class); define($name, $class); } function create(array $class) { $array = []; foreach($class as $key => $value) { if(is_array($value)) $array =+ [$key => create($value)]; else $array += [$key => $value]; } return $array; } function call(array &$class, string $member, ...$args) { if(!isset($class[$member])) exit($member.' is not a member of the class.'); else { if(!is_callable($class[$member])) return $class[$member]; else { if(!isset($args[0])) $class[$member]($class); } } } define('myClass', [ 'foo' => 'Hello World!', 'bar' => function (&$this) { $this['foo'] = ' Hi!'; } ]); $obj = create(myClass); echo(call($obj, 'foo'));

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.0140.00716.50
8.3.50.0100.00921.18
8.3.40.0120.00318.71
8.3.30.0140.00018.72
8.3.20.0070.00020.34
8.3.10.0050.00321.90
8.3.00.0000.00823.48
8.2.180.0100.00725.92
8.2.170.0120.00418.97
8.2.160.0100.00722.96
8.2.150.0000.00725.66
8.2.140.0050.00324.66
8.2.130.0040.00421.00
8.2.120.0080.00026.35
8.2.110.0100.00021.11
8.2.100.0070.00317.92
8.2.90.0050.00318.95
8.2.80.0050.00317.97
8.2.70.0050.00517.36
8.2.60.0060.00317.80
8.2.50.0040.00418.09
8.2.40.0000.00822.21
8.2.30.0040.00419.21
8.2.20.0030.00717.57
8.2.10.0020.00517.96
8.2.00.0040.00417.83
8.1.280.0140.00725.92
8.1.270.0140.00324.66
8.1.260.0000.00728.09
8.1.250.0040.00428.09
8.1.240.0030.00722.42
8.1.230.0110.00019.01
8.1.220.0030.00617.74
8.1.210.0040.00418.77
8.1.200.0060.00317.10
8.1.190.0060.00317.10
8.1.180.0080.00018.10
8.1.170.0030.00718.51
8.1.160.0040.00420.72
8.1.150.0000.00718.70
8.1.140.0030.00519.47
8.1.130.0000.00717.47
8.1.120.0050.00317.32
8.1.110.0020.00517.37
8.1.100.0030.00517.41
8.1.90.0000.00817.38
8.1.80.0000.00817.34
8.1.70.0000.00717.28
8.1.60.0050.00317.36
8.1.50.0040.00417.43
8.1.40.0080.00017.46
8.1.30.0080.00017.39
8.1.20.0030.00517.43
8.1.10.0000.00717.41
8.1.00.0000.00817.38
8.0.300.0080.00018.77
8.0.290.0040.00416.63
8.0.280.0000.00718.38
8.0.270.0040.00417.20
8.0.260.0060.00017.06
8.0.250.0000.00716.79
8.0.240.0020.00516.98
8.0.230.0040.00416.84
8.0.220.0080.00016.86
8.0.210.0000.00716.75
8.0.200.0000.00616.93
8.0.190.0000.00716.80
8.0.180.0040.00416.78
8.0.170.0030.00516.88
8.0.160.0000.00816.90
8.0.150.0080.00316.88
8.0.140.0000.00716.77
8.0.130.0000.00613.30
8.0.120.0060.00316.89
8.0.110.0040.00416.85
8.0.100.0070.00016.69
8.0.90.0000.00716.92
8.0.80.0060.01016.76
8.0.70.0040.00416.82
8.0.60.0040.00416.81
8.0.50.0040.00416.69
8.0.30.0120.00717.25
8.0.20.0140.00717.40
8.0.10.0050.00316.93
8.0.00.0120.00916.51
7.4.330.0000.00516.89
7.4.320.0030.00316.34
7.4.300.0080.00016.34
7.4.290.0000.00716.39
7.4.280.0000.00716.34
7.4.270.0040.00416.52
7.4.260.0030.00316.48
7.4.250.0000.00816.29
7.4.240.0070.00016.52
7.4.230.0030.00316.52
7.4.220.0090.00616.36
7.4.210.0070.00816.44
7.4.200.0040.00416.26
7.4.160.0100.00816.46
7.4.150.0100.01317.40
7.4.140.0090.01217.86
7.4.130.0090.00816.31
7.4.120.0090.00816.49
7.4.110.0100.01316.28
7.4.100.0090.00916.49
7.4.90.0100.00716.50
7.4.80.0080.00819.39
7.4.70.0130.00316.43
7.4.60.0100.00616.64
7.4.50.0060.00916.50
7.4.40.0060.00916.32
7.4.30.0120.00716.44
7.4.00.0070.01014.66
7.3.330.0000.00613.20
7.3.320.0050.00013.34
7.3.310.0050.00216.19
7.3.300.0000.00616.15
7.3.290.0080.00816.28
7.3.280.0060.01216.25
7.3.270.0070.01117.40
7.3.260.0100.01016.25
7.3.250.0090.01016.43
7.3.240.0070.01116.42
7.3.230.0100.00716.41
7.3.210.0030.01916.34
7.3.200.0100.00619.39
7.3.190.0070.01016.22
7.3.180.0120.00916.47
7.3.170.0110.01116.28
7.3.160.0070.01416.48
7.2.330.0110.00816.28
7.2.320.0140.01116.31
7.2.310.0080.00816.29
7.2.300.0090.00916.64
7.2.290.0070.01016.58
7.2.60.0060.00916.75
7.2.00.0000.01319.23
7.1.200.0040.00815.63
7.1.100.0030.01018.24
7.1.70.0060.00617.09
7.1.60.0150.01119.40
7.1.50.0090.00916.52
7.1.00.0000.08022.33
7.0.200.0000.00916.34
7.0.60.0100.07721.66
7.0.50.0000.04317.94
7.0.40.0070.04320.04
7.0.30.0200.05720.24
7.0.20.0400.08320.23
7.0.10.0130.08020.06
7.0.00.0070.07020.06
5.6.280.0000.07020.90
5.6.210.0070.04720.57
5.6.200.0070.05718.15
5.6.190.0030.06020.50
5.6.180.0270.05020.77
5.6.170.0300.07020.47
5.6.160.0070.08320.48
5.6.150.0170.06018.15
5.6.140.0030.08018.28
5.6.130.0100.07718.21
5.6.120.0130.07721.11
5.6.110.0030.06721.15
5.6.100.0070.08320.99
5.6.90.0100.03721.00
5.6.80.0030.08320.49
5.5.350.3270.03020.42
5.5.340.0070.07717.99
5.5.330.0070.08320.43
5.5.320.0500.07320.30
5.5.310.0230.07720.19
5.5.300.0030.07318.03
5.5.290.0030.07718.08
5.5.280.0100.07720.85
5.5.270.0030.04720.73
5.5.260.0130.07720.77
5.5.250.0070.08720.59
5.5.240.0100.05720.20

preferences:
80.34 ms | 401 KiB | 5 Q