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; } } $test->callback = new MyClass($test); // 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.0040.01418.68
8.3.50.0090.00721.99
8.3.40.0090.01218.80
8.3.30.0040.01119.17
8.3.20.0040.00420.37
8.3.10.0000.00821.95
8.3.00.0050.00222.40
8.2.180.0070.01116.88
8.2.170.0140.00022.96
8.2.160.0040.01420.35
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0000.00817.38
8.2.110.0040.00422.29
8.2.100.0080.00319.45
8.2.90.0040.00419.05
8.2.80.0040.00418.05
8.2.70.0060.00317.50
8.2.60.0090.00017.93
8.2.50.0030.00518.07
8.2.40.0030.00618.28
8.2.30.0030.00718.00
8.2.20.0070.00017.65
8.2.10.0080.00019.59
8.2.00.0040.00417.75
8.1.280.0070.00725.92
8.1.270.0000.00822.25
8.1.260.0090.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00723.81
8.1.230.0060.00618.79
8.1.220.0030.00517.79
8.1.210.0050.00318.77
8.1.200.0080.00317.23
8.1.190.0080.00017.29
8.1.180.0000.00818.10
8.1.170.0050.00318.65
8.1.160.0040.00422.04
8.1.150.0070.00018.55
8.1.140.0070.00017.45
8.1.130.0000.00717.73
8.1.120.0040.00417.46
8.1.110.0000.00717.31
8.1.100.0050.00217.39
8.1.90.0040.00417.45
8.1.80.0030.00517.46
8.1.70.0000.00717.44
8.1.60.0030.00617.48
8.1.50.0040.00417.55
8.1.40.0000.00817.39
8.1.30.0000.00817.64
8.1.20.0050.00317.69
8.1.10.0030.00517.58
8.1.00.0060.00317.59
8.0.300.0070.00018.77
8.0.290.0030.00517.05
8.0.280.0050.00318.50
8.0.270.0080.00017.23
8.0.260.0030.00316.85
8.0.250.0070.00016.95
8.0.240.0030.00616.96
8.0.230.0000.00717.01
8.0.220.0070.00016.96
8.0.210.0080.00016.79
8.0.200.0050.00217.04
8.0.190.0040.00417.07
8.0.180.0070.00016.98
8.0.170.0000.00717.00
8.0.160.0050.00316.90
8.0.150.0070.00016.98
8.0.140.0000.00716.96
8.0.130.0000.00613.39
8.0.120.0000.00716.95
8.0.110.0000.00716.90
8.0.100.0000.00816.99
8.0.90.0040.00416.94
8.0.80.0120.00916.97
8.0.70.0040.00416.77
8.0.60.0030.00517.04
8.0.50.0080.00016.96
8.0.30.0090.01017.11
8.0.20.0110.00817.40
8.0.10.0070.00016.96
8.0.00.0130.00616.82
7.4.330.0040.00415.00
7.4.320.0060.00016.50
7.4.300.0060.00016.45
7.4.290.0000.00716.60
7.4.280.0000.00716.45
7.4.270.0040.00416.46
7.4.260.0030.00316.56
7.4.250.0070.00016.41
7.4.240.0030.00416.56
7.4.230.0030.00316.61
7.4.220.0070.01016.46
7.4.210.0080.01216.53
7.4.200.0000.00816.65
7.4.190.0040.00416.65
7.4.160.0060.01016.53
7.4.150.0070.01417.40
7.4.140.0120.00917.86
7.4.130.0120.00916.59
7.4.120.0120.00816.58
7.4.110.0030.01316.45
7.4.100.0090.01016.62
7.4.90.0100.00716.61
7.4.80.0100.01319.39
7.4.70.0170.00016.60
7.4.60.0040.01316.46
7.4.50.0040.00416.38
7.4.40.0120.00322.77
7.4.30.0100.00716.45
7.4.00.0030.01514.74
7.3.330.0000.00513.18
7.3.320.0000.00513.13
7.3.310.0080.00016.36
7.3.300.0060.00016.22
7.3.290.0090.01216.33
7.3.280.0110.00616.24
7.3.270.0130.01017.40
7.3.260.0120.00416.50
7.3.250.0070.01016.57
7.3.240.0110.00516.50
7.3.230.0080.01116.39
7.3.210.0030.01516.56
7.3.200.0040.01119.39
7.3.190.0070.00916.49
7.3.180.0000.01616.52
7.3.170.0160.00316.29
7.3.160.0070.01116.27
7.3.120.0130.00314.93
7.3.10.0120.00316.59
7.3.00.0030.00916.73
7.2.330.0040.01916.45
7.2.320.0120.00616.63
7.2.310.0000.01816.47
7.2.300.0080.01116.67
7.2.290.0070.01416.73
7.2.130.0000.01416.57
7.2.120.0060.00616.85
7.2.110.0030.00716.55
7.2.100.0080.00416.72
7.2.90.0070.00816.78
7.2.80.0030.00716.86
7.2.70.0070.00716.84
7.2.60.0060.01016.62
7.2.50.0110.00016.88
7.2.40.0000.01216.97
7.2.30.0040.00916.49
7.2.20.0000.01116.71
7.2.10.0030.01016.66
7.2.00.0060.00717.95
7.1.250.0030.00715.65
7.1.200.0030.01015.57
7.1.100.0070.00718.18
7.1.70.0070.00317.09
7.1.60.0070.01819.82
7.1.50.0140.00716.92
7.1.00.0000.08022.30
7.0.200.0000.01016.80
7.0.140.0030.07322.10
7.0.60.0100.08319.94
7.0.50.0200.03017.99
7.0.40.0030.04720.12
7.0.30.0200.04320.17
7.0.20.0270.04720.24
7.0.10.0330.07020.21
7.0.00.0030.07720.29
5.6.280.0070.07021.11
5.6.210.0100.07320.67
5.6.200.0130.07718.18
5.6.190.0170.08020.58
5.6.180.0230.07720.46
5.6.170.0230.04720.52
5.6.160.0030.06720.61
5.6.150.0100.08018.27
5.6.140.0070.06018.18
5.6.130.0000.04718.28
5.6.120.0030.04021.03
5.6.110.0130.06321.12
5.6.100.0100.03320.99
5.6.90.0100.08721.01
5.6.80.0030.04020.52
5.6.70.4500.03720.39
5.5.350.0100.07720.48
5.5.340.0170.07317.98
5.5.330.0100.04720.43
5.5.320.3470.04320.23
5.5.310.0200.04720.21
5.5.300.0070.05017.98
5.5.290.0030.04017.95
5.5.280.0000.05720.81
5.5.270.0070.06320.73
5.5.260.0070.08320.90
5.5.250.0130.07020.61
5.5.240.0270.04320.38
5.4.450.0270.05019.51
5.4.440.0470.05319.28
5.4.430.0630.03019.32
5.4.420.0930.03319.54
5.4.410.0270.04719.07
5.4.400.0600.03719.16
5.4.390.0930.06319.21
5.4.380.0300.04718.57
5.4.370.0330.04718.73
5.4.360.0200.05318.78
5.4.350.0230.05718.78
5.4.340.0130.05718.79
5.4.320.0100.03712.51
5.4.310.0050.04112.51
5.4.300.0080.03812.51
5.4.290.0100.03412.50
5.4.280.0070.04312.40
5.4.270.0070.06318.80
5.4.260.0070.05718.96
5.4.250.0170.07018.74
5.4.240.0230.06018.96
5.4.230.0100.07318.76
5.4.220.0100.05719.09
5.4.210.0170.06718.97
5.4.200.0030.08318.99
5.4.190.0100.05318.89
5.4.180.0130.06318.83
5.4.170.0130.05719.10
5.4.160.0000.05718.78
5.4.150.0100.06318.73
5.4.140.0130.07016.43
5.4.130.0030.05316.43
5.4.120.0030.05316.45
5.4.110.0030.07316.51
5.4.100.0200.03716.36
5.4.90.0130.06316.62
5.4.80.0070.06016.32
5.4.70.0030.05316.39
5.4.60.0100.04716.39
5.4.50.0170.05716.47
5.4.40.0170.06316.51
5.4.30.0070.06016.32
5.4.20.0100.05016.40
5.4.10.0100.07316.50
5.4.00.0100.04315.76
5.3.290.0080.04612.80
5.3.280.0130.06714.83
5.3.270.0070.05714.60
5.3.260.0200.06014.78
5.3.250.0200.05014.70
5.3.240.0100.05314.60
5.3.230.0030.07314.60
5.3.220.0170.04314.71
5.3.210.0100.06314.56
5.3.200.0170.06314.42
5.3.190.0170.04714.41
5.3.180.0100.06714.41
5.3.170.0070.07014.59
5.3.160.0070.06714.50
5.3.150.0070.05014.48
5.3.140.0070.07314.79
5.3.130.0100.05314.57
5.3.120.0130.04714.62
5.3.110.0100.05714.54
5.3.100.0130.06714.27
5.3.90.0070.05314.01
5.3.80.0200.06013.93
5.3.70.0100.06714.19
5.3.60.0070.05313.84
5.3.50.0200.04313.95
5.3.40.0100.04713.95
5.3.30.0030.05714.10
5.3.20.0130.04313.63
5.3.10.0100.04713.64
5.3.00.0070.05713.81
5.2.170.0000.05311.14
5.2.160.0070.04011.24
5.2.150.0100.04311.32
5.2.140.0070.06311.14
5.2.130.0100.03711.29
5.2.120.0030.04011.09
5.2.110.0100.05011.20
5.2.100.0130.04711.27
5.2.90.0100.03311.18
5.2.80.0170.05011.09
5.2.70.0100.04311.18
5.2.60.0170.04711.05
5.2.50.0130.04711.21
5.2.40.0030.05310.84
5.2.30.0100.04011.16
5.2.20.0130.03711.18
5.2.10.0170.03310.95
5.2.00.0100.03710.95
5.1.60.0070.04710.08
5.1.50.0070.04710.00
5.1.40.0100.0309.83
5.1.30.0100.03010.41
5.1.20.0100.03310.20
5.1.10.0070.0339.92
5.1.00.0070.03710.06
5.0.50.0030.0308.52
5.0.40.0070.0378.52
5.0.30.0030.0538.15
5.0.20.0030.0278.27
5.0.10.0030.0378.16
5.0.00.0070.0378.24
4.4.90.0200.0135.86
4.4.80.0000.0235.83
4.4.70.0030.0205.84
4.4.60.0070.0275.96
4.4.50.0070.0205.83
4.4.40.0030.0335.90
4.4.30.0000.0235.84
4.4.20.0000.0275.89
4.4.10.0100.0175.90
4.4.00.0030.0335.88
4.3.110.0070.0275.79
4.3.100.0000.0335.73
4.3.90.0030.0205.88
4.3.80.0030.0335.76
4.3.70.0100.0235.82
4.3.60.0030.0205.73
4.3.50.0070.0275.77
4.3.40.0070.0405.73
4.3.30.0030.0235.73
4.3.20.0030.0205.73
4.3.10.0000.0235.73
4.3.00.0000.01315.57

preferences:
46.47 ms | 401 KiB | 5 Q