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!' ]); $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.0100.01018.30
8.3.50.0070.00716.25
8.3.40.0090.00618.83
8.3.30.0000.01418.84
8.3.20.0050.00220.15
8.3.10.0050.00321.73
8.3.00.0080.00023.52
8.2.180.0130.00725.92
8.2.170.0170.00318.85
8.2.160.0170.00322.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0030.00521.04
8.2.120.0040.00426.35
8.2.110.0070.01021.04
8.2.100.0040.00717.93
8.2.90.0040.00419.25
8.2.80.0040.00417.97
8.2.70.0060.00317.62
8.2.60.0030.00618.05
8.2.50.0050.00318.09
8.2.40.0030.00522.34
8.2.30.0000.00819.40
8.2.20.0030.00617.68
8.2.10.0000.00718.14
8.2.00.0030.00518.03
8.1.280.0140.00025.92
8.1.270.0080.00024.66
8.1.260.0040.00428.09
8.1.250.0080.00028.09
8.1.240.0060.00622.58
8.1.230.0090.00319.08
8.1.220.0050.00317.74
8.1.210.0080.00018.77
8.1.200.0060.00317.25
8.1.190.0040.00417.23
8.1.180.0060.00318.10
8.1.170.0030.00618.59
8.1.160.0040.00420.78
8.1.150.0080.00018.95
8.1.140.0050.00319.56
8.1.130.0070.00017.47
8.1.120.0030.00517.36
8.1.110.0070.00017.48
8.1.100.0070.00017.51
8.1.90.0070.00317.46
8.1.80.0040.00417.52
8.1.70.0070.00017.37
8.1.60.0000.00817.63
8.1.50.0060.00317.55
8.1.40.0030.00617.57
8.1.30.0050.00317.51
8.1.20.0080.00017.66
8.1.10.0030.00617.59
8.1.00.0000.00717.54
8.0.300.0040.00418.77
8.0.290.0060.00316.75
8.0.280.0030.00318.34
8.0.270.0050.00217.39
8.0.260.0100.00016.81
8.0.250.0030.00316.95
8.0.240.0030.00517.04
8.0.230.0000.00717.10
8.0.220.0020.00516.90
8.0.210.0000.00716.94
8.0.200.0000.00716.96
8.0.190.0050.00317.08
8.0.180.0050.00317.00
8.0.170.0050.00316.94
8.0.160.0080.00017.00
8.0.150.0000.00716.90
8.0.140.0030.00516.91
8.0.130.0030.00313.49
8.0.120.0080.00016.96
8.0.110.0050.00316.90
8.0.100.0040.00416.86
8.0.90.0070.00016.94
8.0.80.0040.01216.89
8.0.70.0070.00016.90
8.0.60.0040.00417.00
8.0.50.0000.00716.79
8.0.30.0120.00617.09
8.0.20.0090.01017.40
8.0.10.0040.00417.13
8.0.00.0100.00916.92
7.4.330.0000.00516.78
7.4.320.0060.00016.42
7.4.300.0000.00716.61
7.4.290.0030.00316.54
7.4.280.0000.00716.43
7.4.270.0000.00716.67
7.4.260.0000.00716.60
7.4.250.0050.00316.48
7.4.240.0000.00716.66
7.4.230.0000.00816.72
7.4.220.0060.00916.57
7.4.210.0130.00316.55
7.4.200.0070.00016.34
7.4.160.0060.01016.44
7.4.150.0150.00317.40
7.4.140.0110.00917.86
7.4.130.0020.00616.50
7.4.120.0080.00816.52
7.4.110.0070.01016.60
7.4.100.0100.00716.52
7.4.90.0060.01616.64
7.4.80.0100.00719.39
7.4.70.0090.00916.66
7.4.60.0060.00916.31
7.4.50.0040.01116.64
7.4.40.0100.00716.51
7.4.30.0090.01316.45
7.4.00.0110.00414.86
7.3.330.0030.00313.35
7.3.320.0050.00013.38
7.3.310.0050.00216.25
7.3.300.0070.00016.40
7.3.290.0080.00716.41
7.3.280.0050.01316.33
7.3.270.0090.01017.40
7.3.260.0070.01016.36
7.3.240.0100.01016.41
7.3.230.0090.01316.57
7.3.210.0140.01016.58
7.3.200.0180.00519.39
7.3.190.0100.00716.41
7.3.180.0090.01516.36
7.3.170.0100.00716.50
7.3.160.0090.00916.49
7.2.330.0110.01116.79
7.2.320.0060.01216.89
7.2.310.0060.01616.48
7.2.300.0140.00516.87
7.2.290.0070.01016.85
7.2.60.0030.01016.83
7.2.00.0000.01419.59
7.1.200.0100.00315.84
7.1.100.0000.01418.14
7.1.70.0000.00717.13
7.1.60.0120.01219.40
7.1.50.0070.01516.91
7.1.00.0000.08022.51
7.0.200.0040.00416.84
7.0.60.0070.08021.67
7.0.50.0030.04017.88
7.0.40.0070.05720.11
7.0.30.0230.04720.34
7.0.20.0300.08020.34
7.0.10.0030.08320.09
7.0.00.0130.07020.30
5.6.280.0030.06720.82
5.6.210.0130.06720.53
5.6.200.0070.06718.19
5.6.190.0030.06320.61
5.6.180.0330.06320.63
5.6.170.0270.07720.51
5.6.160.0130.08320.47
5.6.150.0100.07318.17
5.6.140.0270.05718.29
5.6.130.0030.09018.18
5.6.120.0100.08721.13
5.6.110.0130.06021.12
5.6.100.0100.07321.14
5.6.90.0100.03720.98
5.6.80.0030.06020.39
5.5.350.3170.03720.53
5.5.340.0070.08018.02
5.5.330.0100.07720.37
5.5.320.0500.07320.42
5.5.310.0070.09020.27
5.5.300.0030.08317.98
5.5.290.0070.07717.98
5.5.280.0070.05020.77
5.5.270.0000.04720.80
5.5.260.0130.04020.85
5.5.250.0030.05020.78
5.5.240.0230.04720.16

preferences:
47.84 ms | 400 KiB | 5 Q