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 V implements arrayaccess{ public $args = array('0'=>'1', '1'=> 'callback'); 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 V($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.40.0100.01018.98
8.3.30.0110.00419.20
8.3.20.0040.00420.34
8.3.10.0000.00822.14
8.3.00.0000.00822.39
8.2.170.0040.01122.96
8.2.160.0070.00720.52
8.2.150.0080.00024.18
8.2.140.0090.00624.66
8.2.130.0150.00326.16
8.2.120.0080.00019.48
8.2.110.0040.00422.11
8.2.100.0000.01219.63
8.2.90.0070.00019.22
8.2.80.0080.00017.97
8.2.70.0040.00417.63
8.2.60.0090.00017.93
8.2.50.0080.00018.07
8.2.40.0000.00818.16
8.2.30.0060.00318.00
8.2.20.0030.00517.55
8.2.10.0040.00417.68
8.2.00.0020.00517.81
8.1.270.0050.00322.05
8.1.260.0000.00826.35
8.1.250.0000.00828.09
8.1.240.0060.00323.64
8.1.230.0080.00419.12
8.1.220.0050.00317.74
8.1.210.0080.00018.77
8.1.200.0030.00617.23
8.1.190.0040.00417.53
8.1.180.0040.00418.10
8.1.170.0050.00318.56
8.1.160.0060.00321.94
8.1.150.0000.00818.59
8.1.140.0080.00017.41
8.1.130.0030.00317.89
8.1.120.0040.00417.45
8.1.110.0050.00217.31
8.1.100.0000.00717.43
8.1.90.0070.00017.36
8.1.80.0040.00417.34
8.1.70.0050.00317.40
8.1.60.0000.00817.60
8.1.50.0080.00017.57
8.1.40.0040.00417.58
8.1.30.0000.00817.49
8.1.20.0080.00017.53
8.1.10.0000.00817.64
8.1.00.0030.00617.45
8.0.300.0040.00418.77
8.0.290.0030.00517.05
8.0.280.0070.00018.46
8.0.270.0030.00317.21
8.0.260.0060.00016.89
8.0.250.0030.00317.05
8.0.240.0040.00417.07
8.0.230.0000.00717.05
8.0.220.0070.00017.00
8.0.210.0000.00716.91
8.0.200.0000.00716.99
8.0.190.0000.00716.96
8.0.180.0000.00716.99
8.0.170.0040.00417.05
8.0.160.0040.00417.07
8.0.150.0000.00716.97
8.0.140.0040.00416.88
8.0.130.0030.00313.39
8.0.120.0070.00016.89
8.0.110.0040.00416.98
8.0.100.0050.00316.91
8.0.90.0040.00417.01
8.0.80.0090.01017.01
8.0.70.0070.00017.01
8.0.60.0040.00416.90
8.0.50.0040.00416.85
8.0.30.0120.00817.23
8.0.20.0130.01017.40
8.0.10.0040.00416.98
8.0.00.0070.01216.83
7.4.330.0030.00315.00
7.4.320.0060.00016.34
7.4.300.0060.00016.43
7.4.290.0030.00316.50
7.4.280.0000.00716.43
7.4.270.0000.00716.53
7.4.260.0030.00316.54
7.4.250.0000.00716.54
7.4.240.0070.00016.45
7.4.230.0070.00016.25
7.4.220.0030.01416.62
7.4.210.0080.01216.56
7.4.200.0040.00416.63
7.4.190.0000.00716.55
7.4.160.0000.01516.35
7.4.150.0140.01117.40
7.4.140.0110.00617.86
7.4.130.0120.00516.52
7.4.120.0120.00716.46
7.4.110.0070.01016.57
7.4.100.0150.00316.51
7.4.90.0070.01316.53
7.4.80.0100.00719.39
7.4.70.0130.01016.46
7.4.60.0130.00316.42
7.4.50.0040.00416.42
7.4.40.0000.01422.77
7.4.30.0140.00316.57
7.4.00.0060.00614.89
7.3.330.0000.00513.32
7.3.320.0000.00613.16
7.3.310.0040.00416.40
7.3.300.0030.00316.27
7.3.290.0090.00916.33
7.3.280.0130.00716.30
7.3.270.0090.00917.40
7.3.260.0070.01116.48
7.3.250.0080.01316.50
7.3.240.0100.01016.32
7.3.230.0130.00716.48
7.3.210.0090.00916.29
7.3.200.0130.00319.39
7.3.190.0090.00916.40
7.3.180.0070.00716.57
7.3.170.0070.00716.42
7.3.160.0060.01516.39
7.3.120.0040.01114.74
7.3.110.0030.00914.97
7.3.100.0110.00414.59
7.3.90.0060.00914.54
7.3.80.0060.01014.94
7.3.70.0100.00714.80
7.3.60.0100.00314.83
7.3.50.0030.01314.68
7.3.40.0040.00714.77
7.3.30.0160.00014.56
7.3.20.0060.00916.56
7.3.10.0070.00716.75
7.3.00.0030.00816.55
7.2.330.0130.01316.40
7.2.320.0150.00816.47
7.2.310.0160.00016.37
7.2.300.0150.01116.58
7.2.290.0110.00716.54
7.2.240.0060.00615.06
7.2.230.0100.00014.72
7.2.220.0030.00715.09
7.2.210.0070.00714.73
7.2.200.0000.01414.69
7.2.190.0110.00715.12
7.2.180.0090.00614.62
7.2.170.0090.00614.99
7.2.160.0040.01415.09
7.2.150.0100.00716.86
7.2.140.0060.00616.66
7.2.130.0100.00716.87
7.2.120.0090.00016.72
7.2.110.0040.01116.69
7.2.100.0040.01116.77
7.2.90.0070.01016.98
7.2.80.0000.01116.66
7.2.70.0030.01216.79
7.2.60.0010.01316.71
7.2.50.0050.00516.67
7.2.40.0070.01016.98
7.2.30.0000.01016.67
7.2.20.0130.00316.67
7.2.10.0070.00716.66
7.2.00.0030.01217.88
7.1.330.0060.00615.95
7.1.320.0030.00715.85
7.1.310.0070.00715.60
7.1.300.0050.00515.67
7.1.290.0060.01015.85
7.1.280.0000.01515.43
7.1.270.0000.01115.89
7.1.260.0040.01115.59
7.1.250.0090.00615.70
7.1.200.0030.01015.60
7.1.100.0030.01218.39
7.1.70.0030.00617.18
7.1.60.0090.01319.82
7.1.50.0040.01516.54
7.1.00.0170.06022.54
7.0.200.0070.00016.71
7.0.140.0070.06322.00
7.0.60.0000.04320.02
7.0.50.0100.03717.79
7.0.40.0030.09720.24
7.0.30.0230.07020.08
7.0.20.0330.05020.30
7.0.10.0230.05320.09
7.0.00.0070.05020.10
5.6.280.0030.07321.00
5.6.210.0100.08320.52
5.6.200.0070.03718.14
5.6.190.0030.04320.49
5.6.180.3100.04720.50
5.6.170.0270.06320.56
5.6.160.0030.08720.52
5.6.150.0100.08018.15
5.6.140.0030.04018.15
5.6.130.0070.05718.17
5.6.120.0130.08321.09
5.6.110.0070.04021.01
5.6.100.0130.05021.12
5.6.90.0070.03720.96
5.6.80.0070.06720.39
5.6.70.0330.06320.51
5.5.350.0130.07020.43
5.5.340.0070.05718.05
5.5.330.0030.05320.32
5.5.320.0270.07020.31
5.5.310.0330.07320.50
5.5.300.0200.07317.95
5.5.290.0070.08017.98
5.5.280.0130.05720.66
5.5.270.0030.05720.69
5.5.260.0070.07020.85
5.5.250.0030.04020.67
5.5.240.0000.04320.24
5.4.450.0270.05319.56
5.4.440.0800.05319.53
5.4.430.0130.06719.45
5.4.420.0170.05719.51
5.4.410.0170.05019.35
5.4.400.0830.00018.76
5.4.390.0830.00018.76
5.4.380.0330.05018.78
5.4.370.0100.05718.76
5.4.360.0230.04318.76
5.4.350.0100.05718.54
5.4.340.0100.05318.77
5.4.320.0080.03912.51
5.4.310.0040.04012.50
5.4.300.0070.03912.51
5.4.290.0080.04212.50
5.4.280.0110.03412.40
5.4.270.0170.06318.82
5.4.260.0230.06318.94
5.4.250.0100.06018.74
5.4.240.0100.06718.93
5.4.230.0200.05318.64
5.4.220.0170.05718.74
5.4.210.0170.06318.78
5.4.200.0100.08018.94
5.4.190.0130.05318.82
5.4.180.0170.06018.60
5.4.170.0070.06018.94
5.4.160.0170.05018.94
5.4.150.0130.05318.91
5.4.140.0100.07316.51
5.4.130.0000.05316.53
5.4.120.0070.05016.52
5.4.110.0100.06016.61
5.4.100.0070.05316.51
5.4.90.0070.05316.46
5.4.80.0100.05016.51
5.4.70.0030.05316.54
5.4.60.0130.06316.45
5.4.50.0100.06016.53
5.4.40.0070.05316.57
5.4.30.0070.05016.48
5.4.20.0070.05316.37
5.4.10.0030.06716.52
5.4.00.0100.07315.98
5.3.290.0060.04212.80
5.3.280.0030.06314.83
5.3.270.0070.07014.80
5.3.260.0100.06314.84
5.3.250.0100.06714.78
5.3.240.0170.06714.59
5.3.230.0100.06714.63
5.3.220.0030.05314.79
5.3.210.0070.05714.65
5.3.200.0070.05014.59
5.3.190.0030.07714.64
5.3.180.0070.05014.66
5.3.170.0030.07314.56
5.3.160.0170.06014.47
5.3.150.0100.05014.56
5.3.140.0030.08314.70
5.3.130.0100.07014.77
5.3.120.0070.06314.54
5.3.110.0070.07314.53
5.3.100.0100.07714.05
5.3.90.0070.05714.04
5.3.80.0030.05714.00
5.3.70.0100.05714.21
5.3.60.0070.06714.20
5.3.50.0100.05713.87
5.3.40.0070.06714.03
5.3.30.0070.07013.93
5.3.20.0070.06013.69
5.3.10.0070.07313.63
5.3.00.0130.05713.63
5.2.170.0100.04711.14
5.2.160.0100.05310.99
5.2.150.0030.05011.23
5.2.140.0100.05311.23
5.2.130.0000.05311.02
5.2.120.0070.04011.20
5.2.110.0030.04011.21
5.2.100.0070.05311.18
5.2.90.0100.05011.08
5.2.80.0000.05311.20
5.2.70.0100.03711.18
5.2.60.0070.05011.05
5.2.50.0000.04711.12
5.2.40.0030.04711.09
5.2.30.0100.06011.17
5.2.20.0070.04711.05
5.2.10.0070.05310.86
5.2.00.0000.06310.69
5.1.60.0030.04010.11
5.1.50.0100.04010.11
5.1.40.0100.0509.83
5.1.30.0030.05710.34
5.1.20.0030.05710.36
5.1.10.0030.04710.08
5.1.00.0130.02710.04
5.0.50.0070.0378.48
5.0.40.0070.0408.48
5.0.30.0030.0478.44
5.0.20.0000.0308.26
5.0.10.0070.0378.28
5.0.00.0070.0508.16
4.4.90.0070.0205.82
4.4.80.0070.0205.82
4.4.70.0030.0235.82
4.4.60.0030.0235.85
4.4.50.0030.0305.84
4.4.40.0070.0305.86
4.4.30.0070.0235.85
4.4.20.0030.0205.86
4.4.10.0000.0275.90
4.4.00.0030.0335.86
4.3.110.0000.0335.82
4.3.100.0070.0175.82
4.3.90.0000.0305.82
4.3.80.0070.0375.82
4.3.70.0000.0335.82
4.3.60.0000.0235.82
4.3.50.0070.0275.82
4.3.40.0100.0275.83
4.3.30.0000.0275.82
4.3.20.0030.0275.82
4.3.10.0030.0275.82
4.3.00.0000.0236.54

preferences:
51.92 ms | 400 KiB | 5 Q