3v4l.org

run code in 300+ PHP versions simultaneously
<?php function struct(string $name, array $class) { $class = json_encode($class); define($name, $class); } function create($class) { $object = (array) json_decode($class); //if(function_exists($object['__construct']())) $object['__construct']($object); return $object; } function call(array &$class, string $member, ...$args) { if(!isset($class[$member])) exit($member.' is not a member of the class.'); else { if(!isset($args[0])) $class[$member]($class); else $class[$member]($class, $args); } } struct('myStruct', [ 'foo' => 'Hello World!', 'bar' => function (array &$this) { echo(' Hi!'); } ]); $obj = create(myStruct); call($obj, 'bar');

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.00416.50
8.3.50.0110.00821.09
8.3.40.0140.00018.60
8.3.30.0120.00318.41
8.3.20.0020.00520.39
8.3.10.0040.00421.90
8.3.00.0080.00023.42
8.2.180.0040.01118.41
8.2.170.0090.00622.96
8.2.160.0100.00320.52
8.2.150.0070.00024.18
8.2.140.0060.00324.66
8.2.130.0070.00021.00
8.2.120.0040.00426.35
8.2.110.0070.00320.96
8.2.100.0080.00417.68
8.2.90.0040.00419.00
8.2.80.0030.00517.97
8.2.70.0070.00317.50
8.2.60.0000.00817.80
8.2.50.0050.00318.09
8.2.40.0040.00422.38
8.2.30.0050.00219.20
8.2.20.0040.00417.67
8.2.10.0040.00417.94
8.2.00.0000.00817.97
8.1.280.0100.00725.92
8.1.270.0080.00021.93
8.1.260.0070.00028.09
8.1.250.0050.00328.09
8.1.240.0030.00622.32
8.1.230.0030.00719.03
8.1.220.0000.00817.74
8.1.210.0000.00918.77
8.1.200.0030.00617.23
8.1.190.0040.00417.10
8.1.180.0050.00318.10
8.1.170.0060.00318.66
8.1.160.0050.00220.69
8.1.150.0030.00620.58
8.1.140.0000.00819.51
8.1.130.0030.00317.58
8.1.120.0040.00417.41
8.1.110.0050.00317.25
8.1.100.0030.00317.23
8.1.90.0000.00717.33
8.1.80.0000.00717.36
8.1.70.0070.00017.39
8.1.60.0030.00617.53
8.1.50.0080.00017.36
8.1.40.0080.00017.33
8.1.30.0040.00417.45
8.1.20.0040.00417.54
8.1.10.0040.00417.40
8.1.00.0040.00417.40
8.0.300.0050.00218.77
8.0.290.0070.00016.63
8.0.280.0040.00418.25
8.0.270.0040.00417.14
8.0.260.0000.00617.14
8.0.250.0040.00416.92
8.0.240.0060.00016.80
8.0.230.0030.00316.87
8.0.220.0070.00016.81
8.0.210.0070.00016.93
8.0.200.0060.00016.87
8.0.190.0030.00516.97
8.0.180.0070.00016.89
8.0.170.0060.00316.83
8.0.160.0070.00016.84
8.0.150.0000.01116.88
8.0.140.0040.00416.67
8.0.130.0030.00313.21
8.0.120.0030.00616.69
8.0.110.0040.00416.86
8.0.100.0040.00416.75
8.0.90.0030.00616.92
8.0.80.0160.00316.88
8.0.70.0040.00416.78
8.0.60.0000.00816.82
8.0.50.0030.00516.70
8.0.30.0090.00916.98
8.0.20.0110.00717.40
8.0.10.0070.00016.86
8.0.00.0100.01016.69
7.4.330.0060.00016.69
7.4.320.0060.00016.42
7.4.300.0040.00416.50
7.4.290.0070.00016.44
7.4.280.0030.00516.48
7.4.270.0000.00816.39
7.4.260.0020.00516.47
7.4.250.0000.00716.35
7.4.240.0070.00016.27
7.4.230.0030.00316.29
7.4.220.0100.01716.47
7.4.210.0130.00316.48
7.4.200.0040.00416.61
7.4.160.0090.00616.24
7.4.150.0150.00717.40
7.4.140.0160.00517.86
7.4.130.0090.00916.54
7.4.120.0050.01216.36
7.4.110.0070.01116.42
7.4.100.0130.00316.27
7.4.90.0120.00616.26
7.4.80.0100.00719.39
7.4.70.0000.02216.52
7.4.60.0160.00016.23
7.4.50.0000.01316.23
7.4.40.0080.00816.27
7.4.30.0140.00316.18
7.4.00.0040.01114.81
7.3.330.0020.00213.10
7.3.320.0040.00413.07
7.3.310.0030.00316.21
7.3.300.0030.00316.10
7.3.290.0030.00316.12
7.3.280.0040.01116.21
7.3.270.0070.01117.40
7.3.260.0100.00716.35
7.3.250.0060.01116.41
7.3.240.0120.00916.30
7.3.230.0110.00816.39
7.3.210.0060.00916.46
7.3.200.0100.00719.39
7.3.190.0030.01516.42
7.3.180.0100.00616.29
7.3.170.0040.01416.27
7.3.160.0130.00616.13
7.3.120.0090.00917.15
7.3.110.0030.01017.15
7.3.100.0040.01117.15
7.3.90.0120.00317.15
7.3.80.0030.01217.15
7.3.70.0030.01017.15
7.3.60.0000.01517.15
7.3.50.0000.00817.15
7.3.40.0030.01017.15
7.3.30.0070.01017.15
7.3.20.0100.00717.15
7.3.10.0090.00617.15
7.3.00.0080.00516.79
7.2.330.0120.00916.31
7.2.320.0140.00416.46
7.2.310.0100.01316.41
7.2.300.0070.01016.38
7.2.290.0040.02016.29
7.2.240.0060.01217.15
7.2.230.0000.01517.15
7.2.220.0000.01317.15
7.2.210.0000.00817.15
7.2.200.0030.01317.15
7.2.190.0060.00917.15
7.2.180.0060.00917.15
7.2.170.0060.00617.15
7.2.160.0060.00917.15
7.2.150.0030.01017.15
7.2.140.0060.00917.15
7.2.130.0100.00516.88
7.2.120.0050.00716.79
7.2.110.0090.00516.90
7.2.100.0050.00916.90
7.2.90.0080.00516.86
7.2.80.0070.01016.80
7.2.70.0080.00716.85
7.2.60.0070.00816.78
7.2.50.0000.01316.98
7.2.40.0090.00416.81
7.2.30.0030.01116.82
7.2.20.0080.00816.83
7.2.10.0030.01016.81
7.2.00.0080.00517.74
7.1.330.0030.01317.15
7.1.320.0060.00617.15
7.1.310.0030.01017.15
7.1.300.0060.00317.15
7.1.290.0030.00617.15
7.1.280.0050.00517.15
7.1.270.0000.00917.15
7.1.260.0000.00917.15
7.1.250.0100.00316.27
7.1.240.0040.01115.29
7.1.230.0000.00915.33
7.1.220.0030.00715.57
7.1.210.0030.00715.59
7.1.200.0060.00615.53
7.1.190.0060.00315.34
7.1.180.0030.00515.50
7.1.170.0050.00315.41
7.1.160.0030.00615.52
7.1.150.0000.00815.20
7.1.140.0090.00615.11
7.1.130.0060.00315.22
7.1.120.0030.01015.47
7.1.110.0060.00615.29
7.1.100.0020.01216.66
7.1.90.0130.00315.45
7.1.80.0060.00915.22
7.1.70.0020.00816.29
7.1.60.0080.01117.22
7.1.50.0030.00816.08
7.1.40.0080.00015.34
7.1.30.0080.00315.40
7.1.20.0120.00315.24
7.1.10.0080.00615.43
7.1.00.0140.03318.87
7.0.330.0030.00715.21
7.0.320.0030.00714.84
7.0.310.0060.00315.23
7.0.300.0000.01115.12
7.0.290.0090.00314.82
7.0.280.0130.00715.07
7.0.270.0100.00314.85
7.0.260.0000.00815.21
7.0.250.0030.00815.09
7.0.240.0060.00615.37
7.0.230.0080.00415.12
7.0.220.0150.00615.45
7.0.210.0000.01215.14
7.0.200.0080.00615.92
7.0.190.0030.00615.20
7.0.180.0100.00314.99
7.0.170.0070.00715.35
7.0.160.0050.00315.07
7.0.150.0080.00315.13
7.0.140.0060.00315.27
7.0.130.0100.00315.17
7.0.120.0060.00615.27
7.0.110.0070.00315.14
7.0.100.0060.00315.09
7.0.90.0320.03917.65
7.0.80.0380.04317.61
7.0.70.0350.03817.58
7.0.60.0220.03517.58
7.0.50.0200.02017.82
7.0.40.0030.02316.63
7.0.30.0050.04216.58
7.0.20.0090.04516.78
7.0.10.0100.03816.66
7.0.00.0060.02216.68
5.6.380.0060.00613.94
5.6.370.0040.00813.89
5.6.360.0120.00314.13
5.6.350.0030.00714.13
5.6.340.0000.01014.34
5.6.330.0090.00014.41
5.6.320.0040.00714.12
5.6.310.0060.00313.97
5.6.300.0030.00713.71
5.6.290.0120.00014.06
5.6.280.0020.03817.39
5.6.270.0030.00713.94
5.6.260.0100.00313.84
5.6.250.0090.00313.63
5.6.240.0040.04717.17
5.6.230.0060.04317.14
5.6.220.0120.03817.24
5.6.210.0040.02917.23
5.6.200.0060.02117.56
5.6.190.0000.04217.44
5.6.180.0130.02017.33
5.6.170.0050.03017.52
5.6.160.0090.04017.42
5.6.150.0110.03117.52
5.6.140.0030.03017.58
5.6.130.0100.03317.44
5.6.120.0040.02417.32
5.6.110.0050.02317.51
5.6.100.0090.02117.68
5.6.90.0030.02217.51
5.6.80.0070.02017.17
5.6.70.0050.02417.28
5.6.60.0030.02217.16
5.6.50.0020.04617.11
5.6.40.0060.02317.06
5.6.30.0050.02417.02
5.6.20.0130.03717.19
5.6.10.0030.02417.03
5.6.00.0100.02017.12
5.5.380.0100.04315.47
5.5.370.0140.03515.57
5.5.360.0030.02515.64
5.5.350.0050.04815.56
5.5.340.0060.02715.72
5.5.330.0050.02015.73
5.5.320.0070.02215.67
5.5.310.0080.02015.84
5.5.300.0130.01715.91
5.5.290.0020.02215.55
5.5.280.0060.02215.80
5.5.270.0080.02015.74
5.5.260.0030.02315.77
5.5.250.0080.02015.63
5.5.240.0020.02515.45
5.5.230.0050.03015.32
5.5.220.0080.01515.45
5.5.210.0030.02315.41
5.5.200.0080.01815.42
5.5.190.0120.02115.52
5.5.180.0060.02315.37
5.5.170.0100.00310.86
5.5.160.0050.02115.38
5.5.150.0040.02215.40
5.5.140.0060.03315.32
5.5.130.0050.02215.31
5.5.120.0050.02015.47
5.5.110.0050.02315.34
5.5.100.0030.02015.20
5.5.90.0020.03215.30
5.5.80.0050.02015.24
5.5.70.0010.02515.42
5.5.60.0010.02315.31
5.5.50.0020.02715.25
5.5.40.0030.03715.18
5.5.30.0020.04515.21
5.5.20.0030.04015.21
5.5.10.0070.02215.27
5.5.00.0080.04115.30

preferences:
59.91 ms | 401 KiB | 5 Q