3v4l.org

run code in 300+ PHP versions simultaneously
<?php function __(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); else $class[$member]($class, $args); } } } function _new(array $class, ...$args) { $obj = $class; if(isset($class['__construct'])) { if(isset($args[0])) $obj['__construct']($obj, $args); else $obj['__construct']($obj); } return $obj; } $obj = [ 'foo' => '', 'bar' => function (&$this) { $this['foo'] = ' World!'; }, '__construct' => function (&$this) { $this['foo'] = 'Hello'; } ]; echo($obj['foo']); __($obj, 'bar'); echo($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.01316.61
8.3.50.0080.00816.16
8.3.40.0090.01218.80
8.3.30.0150.00618.72
8.3.20.0040.00420.29
8.3.10.0040.01123.49
8.3.00.0060.00323.56
8.2.180.0030.01218.29
8.2.170.0040.01122.96
8.2.160.0070.01020.52
8.2.150.0080.00025.66
8.2.140.0030.00624.66
8.2.130.0080.00020.93
8.2.120.0040.00426.35
8.2.110.0000.00919.35
8.2.100.0070.00417.68
8.2.90.0040.00419.09
8.2.80.0030.00517.97
8.2.70.0030.00617.38
8.2.60.0080.00017.68
8.2.50.0040.00418.09
8.2.40.0080.00022.15
8.2.30.0080.00019.33
8.2.20.0040.00419.36
8.2.10.0050.00217.82
8.2.00.0040.00417.95
8.1.270.0110.00722.19
8.1.260.0100.00728.09
8.1.250.0030.00528.09
8.1.240.0060.00322.45
8.1.230.0110.00017.82
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0050.00517.22
8.1.190.0030.00617.10
8.1.180.0040.00418.10
8.1.170.0060.00618.38
8.1.160.0020.00520.61
8.1.150.0040.00418.88
8.1.140.0050.00319.47
8.1.130.0030.00317.59
8.1.120.0080.00017.36
8.1.110.0000.00717.30
8.1.100.0000.00717.25
8.1.90.0050.00217.17
8.1.80.0070.00317.39
8.1.70.0050.00317.41
8.1.60.0040.00417.50
8.1.50.0050.00317.45
8.1.40.0030.00717.30
8.1.30.0030.00517.54
8.1.20.0030.00617.38
8.1.10.0000.00917.29
8.1.00.0000.00817.22
8.0.300.0000.00818.77
8.0.290.0070.00016.63
8.0.280.0000.00718.34
8.0.270.0030.00317.19
8.0.260.0070.00017.07
8.0.250.0070.00016.93
8.0.240.0050.00316.93
8.0.230.0000.00716.92
8.0.220.0050.00316.75
8.0.210.0040.00416.84
8.0.200.0000.00616.77
8.0.190.0050.00316.86
8.0.180.0000.00716.91
8.0.170.0030.00516.89
8.0.160.0040.00416.91
8.0.150.0000.00716.83
8.0.140.0040.00416.76
8.0.130.0060.00013.25
8.0.120.0000.00716.80
8.0.110.0050.00316.74
8.0.100.0000.00716.74
8.0.90.0000.00816.82
8.0.80.0100.01016.89
8.0.70.0000.00716.73
8.0.60.0000.00716.71
8.0.50.0000.00716.67
8.0.30.0050.01416.89
8.0.20.0070.01217.40
8.0.10.0070.00016.96
8.0.00.0110.01116.65
7.4.330.0020.00216.71
7.4.320.0030.00316.48
7.4.300.0080.00016.48
7.4.290.0050.00216.48
7.4.280.0000.00716.48
7.4.270.0000.00716.55
7.4.260.0070.00016.45
7.4.250.0050.00316.50
7.4.240.0070.00016.35
7.4.230.0030.00316.48
7.4.220.0130.00716.54
7.4.210.0090.00816.31
7.4.200.0050.00216.44
7.4.160.0120.00616.49
7.4.150.0120.00617.40
7.4.140.0100.01117.86
7.4.130.0070.01116.49
7.4.120.0160.00416.33
7.4.110.0070.01016.48
7.4.100.0090.00916.59
7.4.90.0000.01716.21
7.4.80.0040.01219.39
7.4.70.0110.00516.40
7.4.60.0030.01316.36
7.4.50.0040.00816.14
7.4.40.0090.00616.60
7.4.30.0120.00516.49
7.4.00.0070.01114.93
7.3.330.0060.00013.10
7.3.320.0000.00613.04
7.3.310.0000.00716.29
7.3.300.0030.00316.20
7.3.290.0040.00416.30
7.3.280.0100.00516.27
7.3.270.0110.00917.40
7.3.260.0070.01116.46
7.3.250.0110.00916.29
7.3.240.0110.00716.32
7.3.230.0110.00716.43
7.3.210.0100.00616.29
7.3.200.0140.00819.39
7.3.190.0090.00616.46
7.3.180.0070.01116.43
7.3.170.0060.01216.27
7.3.160.0120.00316.26
7.3.120.0050.01014.94
7.3.110.0050.01114.65
7.3.100.0080.00814.85
7.3.90.0040.00914.67
7.3.80.0100.00214.59
7.3.70.0090.00314.55
7.3.60.0040.00914.78
7.3.50.0070.00714.64
7.3.40.0080.00614.77
7.3.30.0070.00814.59
7.3.20.0020.01316.59
7.3.10.0090.00516.52
7.3.00.0060.00516.42
7.2.330.0090.01016.61
7.2.320.0090.00916.43
7.2.310.0130.00316.37
7.2.300.0100.00716.40
7.2.290.0090.00616.27
7.2.240.0070.01014.86
7.2.230.0090.00614.87
7.2.220.0060.01014.91
7.2.210.0030.01114.86
7.2.200.0110.00714.92
7.2.190.0070.00714.66
7.2.180.0080.00614.94
7.2.170.0070.01014.61
7.2.160.0040.01114.72
7.2.150.0130.00316.59
7.2.140.0080.00516.64
7.2.130.0070.00816.68
7.2.120.0060.01016.72
7.2.110.0020.01116.53
7.2.100.0040.00816.62
7.2.90.0070.00716.71
7.2.80.0080.00616.55
7.2.70.0050.01016.67
7.2.60.0070.00716.58
7.2.50.0040.00816.58
7.2.40.0070.00616.65
7.2.30.0050.00716.77
7.2.20.0040.00816.67
7.2.10.0020.01316.54
7.2.00.0050.00717.37
7.1.330.0100.00615.47
7.1.320.0100.00615.68
7.1.310.0050.01015.43
7.1.300.0070.00615.46
7.1.290.0080.00515.55
7.1.280.0090.00515.56
7.1.270.0040.00915.58
7.1.260.0060.00815.55
7.1.250.0040.00915.38
7.1.240.0000.01315.53
7.1.230.0060.00915.59
7.1.220.0120.00015.65
7.1.210.0120.00315.62
7.1.200.0040.00615.68
7.1.190.0030.01015.33
7.1.180.0140.00015.58
7.1.170.0030.01015.57
7.1.160.0100.00315.47
7.1.150.0090.00315.49
7.1.140.0070.00715.59
7.1.130.0040.00415.44
7.1.120.0050.00515.26
7.1.110.0090.00315.54
7.1.100.0030.00916.88
7.1.90.0000.01515.42
7.1.80.0070.00715.35
7.1.70.0020.01016.33
7.1.60.0050.01117.46
7.1.50.0050.00516.00
7.1.40.0040.00815.42
7.1.30.0030.01015.57
7.1.20.0000.01115.55
7.1.10.0040.00415.51
7.1.00.0070.04018.92
7.0.330.0030.00515.44
7.0.320.0060.00615.45
7.0.310.0070.00315.08
7.0.300.0100.00315.23
7.0.290.0030.00915.04
7.0.280.0060.00715.13
7.0.270.0100.00315.08
7.0.260.0030.00915.18
7.0.250.0040.00415.15
7.0.240.0040.01115.38
7.0.230.0110.00715.38
7.0.220.0040.00415.09
7.0.210.0050.00515.30
7.0.200.0050.00715.86
7.0.190.0040.00715.22
7.0.180.0040.00414.91
7.0.170.0040.01115.22
7.0.160.0000.00715.20
7.0.150.0060.00614.99
7.0.140.0030.00815.21
7.0.130.0060.00315.20
7.0.120.0050.00515.13
7.0.110.0040.01115.31
7.0.100.0000.01515.23
7.0.90.0110.00515.36
7.0.80.0040.01315.39
7.0.70.0000.01515.29
7.0.60.0130.02317.75
7.0.50.0050.02216.73
7.0.40.0050.02616.68
7.0.30.0270.02716.88
7.0.20.0180.04716.73
7.0.10.0050.02516.69
7.0.00.0110.04316.89
5.6.380.0030.01014.20
5.6.370.0000.01514.29
5.6.360.0090.00614.24
5.6.350.0030.00914.45
5.6.340.0070.00714.09
5.6.330.0070.00714.50
5.6.320.0060.00814.33
5.6.310.0130.00314.20
5.6.300.0070.00314.00
5.6.290.0040.01114.55
5.6.280.0040.02917.70
5.6.270.0070.00714.40
5.6.260.0060.00614.41
5.6.250.0000.01414.52
5.6.240.0100.00314.23
5.6.230.0030.01314.46
5.6.220.0110.00414.11
5.6.210.0040.03017.41
5.6.200.0020.03516.21
5.6.190.0110.03917.50
5.6.180.0120.04517.26
5.6.170.0170.04317.26
5.6.160.0130.03017.54
5.6.150.0100.04016.29
5.6.140.0030.02916.17
5.6.130.0070.02716.31
5.6.120.0120.04517.66
5.6.110.0180.03717.57
5.6.100.0050.05017.69
5.6.90.0080.03317.65
5.6.80.0050.04617.43
5.6.70.0080.00014.02
5.6.60.0060.00314.39
5.6.50.0070.00414.21
5.6.40.0090.00314.14
5.6.30.0060.00914.26
5.6.20.0000.01414.20
5.6.10.0080.00814.13
5.6.00.0130.00014.08
5.5.380.0070.00410.82
5.5.370.0040.00711.02
5.5.360.0060.00310.94
5.5.350.1550.02215.62
5.5.340.0020.04314.49
5.5.330.0100.02715.52
5.5.320.0370.03415.75
5.5.310.0110.02115.46
5.5.300.0040.02814.52
5.5.290.0050.03714.25
5.5.280.0050.03715.76
5.5.270.0060.02815.82
5.5.260.0020.02615.83
5.5.250.0080.03315.63
5.5.240.0070.02315.52
5.5.230.0070.00410.59
5.5.220.0050.00310.82
5.5.210.0000.00610.81
5.5.200.0030.00810.81
5.5.190.0000.01110.79
5.5.180.0030.00810.96
5.5.170.0000.00710.90
5.5.160.0000.00710.96
5.5.150.0030.00710.72
5.5.140.0000.00810.99
5.5.130.0000.00610.74
5.5.120.0060.00010.86
5.5.110.0030.00310.73
5.5.100.0060.00610.82
5.5.90.0000.01011.06
5.5.80.0130.00010.78
5.5.70.0030.00310.71
5.5.60.0040.00811.00
5.5.50.0040.00710.63
5.5.40.0000.01110.96
5.5.30.0030.00910.68
5.5.20.0070.00010.83
5.5.10.0030.00710.91
5.5.00.0070.00010.63

preferences:
60.8 ms | 400 KiB | 5 Q