3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $secret = 'Nyy lbhe Onfr ner orybat gb hf.'; private $callback; final public function run() { call_user_func($this->callback); return $this->secret . PHP_EOL; } public function __set($k, $v) { $key = $v[($v[$v])]; // $v is some kind of weird array $value = $v(); // and a callback! $this->{$key} = $value; } } // start class MyClass implements arrayaccess{ public function offsetSet($offset, $value) { if (is_null($offset)) { $this->array[] = $value; } else { $this->array[$offset] = $value; } } public function offsetExists($offset) { return isset($this->array[$offset]); } public function offsetUnset($offset) { unset($this->array[$offset]); } public function offsetGet($offset) { $offset = (string) $offset; return isset($this->array[$offset]) ? $this->array[$offset] : null; } } // end editing here echo $test->run();

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.01118.45
8.3.50.0140.00521.98
8.3.40.0090.01218.74
8.3.30.0070.00719.17
8.3.20.0050.00320.16
8.3.10.0080.00022.11
8.3.00.0080.00022.33
8.2.180.0070.01116.63
8.2.170.0080.00822.96
8.2.160.0090.00620.58
8.2.150.0030.00524.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00017.50
8.2.110.0070.00322.12
8.2.100.0080.00417.78
8.2.90.0080.00019.05
8.2.80.0000.00917.97
8.2.70.0070.00317.63
8.2.60.0050.00517.93
8.2.50.0050.00318.07
8.2.40.0030.00518.09
8.2.30.0060.00618.09
8.2.20.0000.00817.64
8.2.10.0070.00017.63
8.2.00.0050.00317.80
8.1.280.0070.01025.92
8.1.270.0040.00422.18
8.1.260.0030.00626.35
8.1.250.0000.00828.09
8.1.240.0040.00423.81
8.1.230.0070.00418.91
8.1.220.0090.00017.79
8.1.210.0060.00318.77
8.1.200.0050.00517.23
8.1.190.0000.00917.43
8.1.180.0080.00018.10
8.1.170.0060.00318.49
8.1.160.0000.00822.03
8.1.150.0040.00418.64
8.1.140.0050.00217.43
8.1.130.0000.00717.82
8.1.120.0000.00717.50
8.1.110.0070.00017.41
8.1.100.0040.00417.30
8.1.90.0040.00417.27
8.1.80.0000.00717.43
8.1.70.0000.00717.38
8.1.60.0090.00017.43
8.1.50.0000.00817.52
8.1.40.0030.00617.46
8.1.30.0000.00817.50
8.1.20.0030.00517.46
8.1.10.0080.00017.41
8.1.00.0030.01017.44
8.0.300.0000.00818.77
8.0.290.0080.00017.18
8.0.280.0040.00418.49
8.0.270.0000.00717.27
8.0.260.0060.00316.93
8.0.250.0000.00717.07
8.0.240.0060.00317.07
8.0.230.0030.00317.04
8.0.220.0000.00716.85
8.0.210.0030.00316.95
8.0.200.0030.00317.01
8.0.190.0000.00816.98
8.0.180.0040.00417.01
8.0.170.0000.00716.95
8.0.160.0040.00416.88
8.0.150.0070.00016.92
8.0.140.0040.00416.88
8.0.130.0030.00313.44
8.0.120.0040.00416.99
8.0.110.0080.00016.91
8.0.100.0050.00216.84
8.0.90.0000.00817.08
8.0.80.0000.01616.96
8.0.70.0000.00816.75
8.0.60.0000.00816.94
8.0.50.0040.00417.03
8.0.30.0100.01217.21
8.0.20.0140.00717.40
8.0.10.0000.00716.97
8.0.00.0110.01116.75
7.4.330.0000.00615.00
7.4.320.0000.00616.39
7.4.300.0000.00616.60
7.4.290.0000.00716.48
7.4.280.0030.00316.54
7.4.270.0000.00716.56
7.4.260.0070.00016.50
7.4.250.0070.00016.32
7.4.240.0010.00616.52
7.4.230.0030.00316.45
7.4.220.0070.01016.58
7.4.210.0070.01016.48
7.4.200.0030.00316.30
7.4.190.0000.00816.36
7.4.160.0060.00916.42
7.4.150.0060.01317.40
7.4.140.0110.00817.86
7.4.130.0100.01016.74
7.4.120.0060.01116.50
7.4.110.0100.01016.48
7.4.100.0160.00316.49
7.4.90.0120.00616.52
7.4.80.0090.01419.39
7.4.70.0060.01616.55
7.4.60.0000.01716.61
7.4.50.0030.00516.59
7.4.40.0030.01022.77
7.4.30.0110.00516.36
7.4.00.0100.00714.93
7.3.330.0050.00013.33
7.3.320.0000.00513.15
7.3.310.0000.00816.24
7.3.300.0030.00316.18
7.3.290.0120.00416.29
7.3.280.0050.01116.29
7.3.270.0060.01917.40
7.3.260.0030.01516.43
7.3.250.0100.00816.46
7.3.240.0030.01316.36
7.3.230.0110.00716.39
7.3.210.0060.01116.27
7.3.200.0100.00619.39
7.3.190.0100.01016.57
7.3.180.0100.01016.46
7.3.170.0060.00916.30
7.3.160.0090.00916.50
7.3.120.0000.01815.02
7.2.330.0100.00716.65
7.2.320.0060.01516.46
7.2.310.0190.00016.50
7.2.300.0070.01016.43
7.2.290.0170.00416.44
7.2.60.0030.01016.83
7.2.00.0080.00419.14
7.1.200.0040.01115.85
7.1.100.0060.00917.77
7.1.70.0000.01517.18
7.1.60.0070.01419.82
7.1.50.0100.01316.82
7.1.00.0030.07722.44
7.0.200.0140.00514.97
7.0.140.0030.07021.93
7.0.60.0130.08020.05
7.0.50.0130.07017.92
7.0.40.0100.06020.04
7.0.30.0300.04720.35
7.0.20.0030.05320.23
7.0.10.0030.09020.16
7.0.00.0070.07720.14
5.6.280.0100.06321.11
5.6.210.0070.07320.51
5.6.200.0070.08718.24
5.6.190.0030.04720.61
5.6.180.0330.04020.55
5.6.170.0170.04320.47
5.6.160.0100.08020.46
5.6.150.0000.09018.20
5.6.140.0070.06718.28
5.6.130.0030.07718.17
5.6.120.0100.08320.91
5.6.110.0030.09021.05
5.6.100.0170.07021.00
5.6.90.0100.06021.04
5.6.80.0100.06320.40
5.5.350.0300.07320.44
5.5.340.0130.07317.94
5.5.330.0170.07320.27
5.5.320.0070.08320.35
5.5.310.0200.06020.50
5.5.300.0030.05018.08
5.5.290.0100.05717.97
5.5.280.0070.06720.81
5.5.270.0030.05320.88
5.5.260.0130.08020.88
5.5.250.0100.06020.67
5.5.240.0030.03020.13
5.4.450.2100.04019.48
5.4.440.2230.04019.41
5.4.430.2370.04019.29
5.4.420.2300.04019.57
5.4.410.2370.04019.33
5.4.400.1670.04019.27
5.4.390.2570.03719.31
5.4.380.2530.04019.21
5.4.370.2530.03319.15
5.4.360.2530.03719.24
5.4.350.2970.04719.31
5.4.340.2770.04719.32
5.4.320.2330.04019.16
5.4.310.2730.03719.16
5.4.300.2600.03319.22
5.4.290.2570.04018.84
5.4.280.2570.03719.19
5.4.270.2600.04019.08
5.4.260.2570.03719.23
5.4.250.2530.04018.83
5.4.240.3170.03719.30
5.4.230.2770.04019.05
5.4.220.2900.03318.83
5.4.210.2970.03718.94
5.4.200.2630.04019.22
5.4.190.2530.03019.18
5.4.180.2700.04319.30
5.4.170.2530.04318.83
5.4.160.2730.04319.20
5.4.150.2830.05319.19
5.4.140.2600.03716.47
5.4.130.2870.04016.34
5.4.120.2730.04016.50
5.4.110.2930.04016.45
5.4.100.2500.03716.40
5.4.90.2400.03716.57
5.4.80.2670.03716.27
5.4.70.2770.03316.54
5.4.60.2730.04016.56
5.4.50.2730.03316.53
5.4.40.2500.03316.51
5.4.30.2970.04716.43
5.4.20.0270.06016.58
5.4.10.0200.04016.48
5.4.00.0200.07315.79
5.3.290.0130.05014.65
5.3.280.0130.05014.62
5.3.270.0230.04714.54
5.3.260.0200.04714.69
5.3.250.0130.04314.69
5.3.240.0230.03714.55
5.3.230.0200.07014.53
5.3.220.0230.07714.47
5.3.210.0200.07014.58
5.3.200.0230.07014.55
5.3.190.0200.06314.80
5.3.180.0100.04314.69
5.3.170.0330.04014.71
5.3.160.0200.07314.57
5.3.150.0200.05014.54
5.3.140.0100.04314.55
5.3.130.0270.06014.67
5.3.120.0270.04014.57
5.3.110.0270.08014.63
5.3.100.0230.04014.16
5.3.90.0230.04314.02
5.3.80.0170.04314.25
5.3.70.0200.07013.96
5.3.60.0270.07014.24
5.3.50.0200.04013.86
5.3.40.0300.06314.07
5.3.30.0230.04013.99
5.3.20.0230.05313.77
5.3.10.0170.04313.56
5.3.00.0300.06313.66
5.2.170.0130.03711.16
5.2.160.0500.04311.07
5.2.150.0170.05711.09
5.2.140.0170.03311.18
5.2.130.0300.04011.34
5.2.120.0130.02711.04
5.2.110.0130.03011.05
5.2.100.0170.03311.04
5.2.90.0200.02711.20
5.2.80.0170.03311.02
5.2.70.0130.03311.33
5.2.60.0170.03311.04
5.2.50.0170.06010.94
5.2.40.0170.02311.06
5.2.30.0100.03310.89
5.2.20.0170.02711.12
5.2.10.0100.03310.83
5.2.00.0170.03710.95
5.1.60.0170.02710.09
5.1.50.0100.02710.00
5.1.40.0070.03010.12
5.1.30.0170.02710.44
5.1.20.0200.04710.48
5.1.10.0130.02310.07
5.1.00.0070.0439.98
5.0.50.0100.0208.64
5.0.40.0070.0208.32
5.0.30.0030.0538.36
5.0.20.0070.0208.34
5.0.10.0070.0178.12
5.0.00.0070.0308.26
4.4.90.0030.0207.02
4.4.80.0030.0207.02
4.4.70.0070.0137.02
4.4.60.0070.0177.02
4.4.50.0070.0177.02
4.4.40.0070.0277.02
4.4.30.0100.0107.02
4.4.20.0070.0137.02
4.4.10.0100.0307.02
4.4.00.0070.0537.02
4.3.110.0030.0177.02
4.3.100.0070.0177.02
4.3.90.0070.0137.02
4.3.80.0070.0277.02
4.3.70.0070.0137.02
4.3.60.0030.0207.02
4.3.50.0070.0207.02
4.3.40.0030.0307.02
4.3.30.0030.0177.02
4.3.20.0000.0177.02
4.3.10.0000.0177.02
4.3.00.0030.0237.02

preferences:
72.51 ms | 400 KiB | 5 Q