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; } } $test = new Test; // start editing here $fn = function(){ return $this -13; }; $a = array('a','b'); class A{ static function b(){ return function(){ return $this -13; }; } } $test->secret = $a; // 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.0130.00618.43
8.3.50.0090.00521.98
8.3.40.0040.01118.96
8.3.30.0090.00619.07
8.3.20.0030.00520.21
8.3.10.0000.00822.09
8.3.00.0060.00322.36
8.2.180.0120.00917.00
8.2.170.0090.00622.96
8.2.160.0140.00320.32
8.2.150.0000.00724.18
8.2.140.0040.00424.66
8.2.130.0110.00426.16
8.2.120.0040.00417.75
8.2.110.0030.00622.00
8.2.100.0060.00619.64
8.2.90.0000.00719.21
8.2.80.0040.00417.97
8.2.70.0080.00017.63
8.2.60.0000.00818.05
8.2.50.0040.00418.07
8.2.40.0040.00418.09
8.2.30.0040.00418.07
8.2.20.0060.00317.89
8.2.10.0050.00317.86
8.2.00.0040.00417.93
8.1.280.0070.01325.92
8.1.270.0070.00022.05
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0030.00623.75
8.1.230.0000.01218.89
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0060.00317.13
8.1.190.0050.00317.53
8.1.180.0000.00818.10
8.1.170.0060.00318.58
8.1.160.0050.00222.14
8.1.150.0040.00418.59
8.1.140.0000.00817.45
8.1.130.0050.00217.85
8.1.120.0030.00317.54
8.1.110.0030.00517.44
8.1.100.0000.00817.51
8.1.90.0040.00417.47
8.1.80.0050.00217.49
8.1.70.0070.00017.46
8.1.60.0080.00017.57
8.1.50.0050.00217.52
8.1.40.0040.00417.43
8.1.30.0040.00417.49
8.1.20.0080.00017.73
8.1.10.0040.00417.62
8.1.00.0040.00417.59
8.0.300.0000.00718.77
8.0.290.0000.00717.04
8.0.280.0080.00018.41
8.0.270.0030.00317.13
8.0.260.0080.00016.71
8.0.250.0070.00016.94
8.0.240.0070.00016.93
8.0.230.0030.00316.90
8.0.220.0040.00416.83
8.0.210.0070.00016.93
8.0.200.0040.00417.08
8.0.190.0000.00817.07
8.0.180.0030.00317.01
8.0.170.0070.00016.95
8.0.160.0070.00017.10
8.0.150.0030.00316.98
8.0.140.0000.00716.91
8.0.130.0000.00813.45
8.0.120.0040.00417.00
8.0.110.0020.00516.98
8.0.100.0000.00716.95
8.0.90.0000.00716.84
8.0.80.0110.00316.98
8.0.70.0000.00716.91
8.0.60.0040.00416.82
8.0.50.0000.00717.09
8.0.30.0090.01217.10
8.0.20.0110.01717.40
8.0.10.0000.00717.20
8.0.00.0110.01016.72
7.4.330.0060.00015.20
7.4.320.0060.00016.61
7.4.300.0060.00016.67
7.4.290.0030.00316.65
7.4.280.0000.00716.48
7.4.270.0030.00316.62
7.4.260.0040.00416.43
7.4.250.0000.00716.48
7.4.240.0020.00516.49
7.4.230.0070.00016.52
7.4.220.0030.01416.63
7.4.210.0030.01316.56
7.4.200.0040.00416.60
7.4.190.0030.00316.50
7.4.160.0130.00316.67
7.4.150.0120.00617.40
7.4.140.0100.01317.86
7.4.130.0120.00616.48
7.4.120.0100.00716.60
7.4.110.0060.01516.51
7.4.100.0080.00816.71
7.4.90.0060.01016.70
7.4.80.0030.01719.39
7.4.70.0030.01316.54
7.4.60.0100.00716.52
7.4.50.0040.00416.67
7.4.40.0060.00922.77
7.4.30.0180.00016.43
7.4.10.0140.00315.06
7.4.00.0030.01314.97
7.3.330.0030.00313.27
7.3.320.0000.00613.28
7.3.310.0070.00016.47
7.3.300.0000.00716.45
7.3.290.0040.01116.48
7.3.280.0100.00616.42
7.3.270.0150.00717.40
7.3.260.0100.00716.64
7.3.250.0080.00816.44
7.3.240.0130.00316.38
7.3.230.0090.00916.59
7.3.210.0130.00316.64
7.3.200.0030.01619.39
7.3.190.0060.01616.60
7.3.180.0030.01316.48
7.3.170.0000.01616.46
7.3.160.0040.01116.52
7.3.130.0040.01514.71
7.3.120.0040.01314.94
7.3.110.0070.01114.79
7.3.100.0000.01514.82
7.3.90.0030.01014.98
7.3.80.0030.00914.93
7.3.70.0040.00414.91
7.3.60.0090.00014.83
7.3.50.0000.01714.78
7.3.40.0000.01714.72
7.3.30.0060.00614.80
7.3.20.0000.01516.80
7.3.10.0040.00716.64
7.3.00.0030.01016.48
7.2.330.0080.00816.45
7.2.320.0070.01316.85
7.2.310.0030.01316.50
7.2.300.0070.01016.79
7.2.290.0040.01216.87
7.2.260.0110.01115.11
7.2.250.0070.01114.81
7.2.240.0070.01015.13
7.2.230.0090.00615.34
7.2.220.0040.01515.23
7.2.210.0090.00014.90
7.2.200.0030.01015.02
7.2.190.0060.00714.83
7.2.180.0090.00615.17
7.2.170.0060.00314.80
7.2.160.0040.00814.75
7.2.150.0140.00016.62
7.2.140.0080.00816.69
7.2.130.0060.00916.61
7.2.120.0120.00316.95
7.2.110.0030.01616.78
7.2.100.0000.01416.86
7.2.90.0060.00816.95
7.2.80.0070.01116.62
7.2.70.0000.01116.92
7.2.60.0050.00717.03
7.2.50.0100.00717.07
7.2.40.0080.00317.16
7.2.30.0030.00716.89
7.2.20.0120.00617.03
7.2.10.0060.01316.98
7.2.00.0040.00917.91
7.1.330.0000.01516.05
7.1.320.0060.00315.98
7.1.310.0030.00915.87
7.1.300.0060.00615.84
7.1.290.0030.01015.62
7.1.280.0040.00715.69
7.1.270.0080.00415.61
7.1.260.0070.00715.61
7.1.250.0100.00315.57
7.1.240.0130.00315.71
7.1.230.0060.01215.89
7.1.220.0040.00715.74
7.1.210.0040.01115.81
7.1.200.0000.01015.86
7.1.190.0030.00515.92
7.1.180.0000.01215.57
7.1.170.0030.01015.75
7.1.160.0080.00415.73
7.1.150.0000.01715.78
7.1.140.0030.01015.65
7.1.130.0090.00615.50
7.1.120.0050.00515.76
7.1.110.0000.01115.90
7.1.100.0020.01016.96
7.1.90.0030.01015.57
7.1.80.0000.01115.75
7.1.70.0030.01016.47
7.1.60.0100.01117.80
7.1.50.0130.00716.39
7.1.40.0060.00615.94
7.1.30.0110.00415.81
7.1.20.0040.01115.80
7.1.10.0090.00615.71
7.1.00.0060.03819.10
7.0.330.0030.01315.29
7.0.320.0040.01115.33
7.0.310.0040.01115.05
7.0.300.0060.00615.26
7.0.290.0070.00715.32
7.0.280.0100.00315.27
7.0.270.0070.00715.44
7.0.260.0080.00414.97
7.0.250.0040.01115.30
7.0.240.0040.00415.10
7.0.230.0000.00815.21
7.0.220.0140.00015.33
7.0.210.0070.00315.36
7.0.200.0060.00815.96
7.0.190.0060.00615.60
7.0.180.0060.00815.24
7.0.170.0030.01015.45
7.0.160.0000.01815.17
7.0.150.0070.01015.20
7.0.140.0030.03818.55
7.0.130.0040.01115.34
7.0.120.0070.00715.12
7.0.110.0070.00815.30
7.0.100.0150.00015.45
7.0.90.0000.00815.25
7.0.80.0030.01315.49
7.0.70.0070.00715.34
7.0.60.0050.04317.72
7.0.50.0000.04316.52
7.0.40.0090.04616.67
7.0.30.0150.04216.80
7.0.20.0160.04116.94
7.0.10.0200.04216.92
7.0.00.0020.02816.89
5.6.400.0060.00314.54
5.6.390.0140.00314.30
5.6.380.0070.00714.64
5.6.370.0070.00714.31
5.6.360.0030.00714.31
5.6.350.0070.00314.44
5.6.340.0070.00714.14
5.6.330.0060.00914.42
5.6.320.0030.01014.36
5.6.310.0040.01114.22
5.6.300.0070.01014.55
5.6.290.0100.00614.15
5.6.280.0030.04217.67
5.6.270.0040.01214.50
5.6.260.0000.01014.62
5.6.250.0030.00814.72
5.6.240.0030.00614.45
5.6.230.0040.00714.48
5.6.220.0030.00814.42
5.6.210.0020.02517.49
5.6.200.0080.03916.34
5.6.190.0060.03717.60
5.6.180.2020.02917.33
5.6.170.0100.03217.58
5.6.160.0050.03217.32
5.6.150.0050.02016.14
5.6.140.0050.02216.47
5.6.130.0070.02216.33
5.6.120.0100.02717.73
5.6.110.0030.02817.70
5.6.100.0190.03717.89
5.6.90.0080.04717.59
5.6.80.0130.01517.28
5.6.70.0170.02317.46
5.6.60.0080.00814.14
5.6.50.0100.00714.26
5.6.40.0030.00714.30
5.6.30.0000.01514.52
5.6.20.0150.00314.46
5.6.10.0120.00314.32
5.6.00.0090.00614.31
5.5.380.0040.01114.43
5.5.370.0100.00314.32
5.5.360.0080.00414.33
5.5.350.0070.04517.26
5.5.340.0110.03216.04
5.5.330.0030.02517.29
5.5.320.0120.02717.20
5.5.310.0210.04117.16
5.5.300.0110.04016.01
5.5.290.0080.03315.99
5.5.280.0080.03017.35
5.5.270.0030.03317.54
5.5.260.0110.03217.54
5.5.250.0130.02617.37
5.5.240.0040.02317.11
5.5.230.0070.00913.86
5.5.220.0060.00914.39
5.5.210.0040.01114.21
5.5.200.0070.00714.07
5.5.190.0070.00714.02
5.5.180.0030.01514.26
5.5.170.0160.00714.12
5.5.160.0120.00614.52
5.5.150.0030.01714.11
5.5.140.0000.01113.91
5.5.130.0030.01014.33
5.5.120.0080.00814.03
5.5.110.0110.00314.18
5.5.100.0030.01314.22
5.5.90.0080.01114.22
5.5.80.0070.01114.39
5.5.70.0090.00614.16
5.5.60.0040.01214.09
5.5.50.0060.01414.50
5.5.40.0000.01414.23
5.5.30.0070.00714.28
5.5.20.0070.00714.39
5.5.10.0060.00813.96
5.5.00.0140.00014.26
5.4.450.0070.03015.01
5.4.440.0300.03915.29
5.4.430.0080.03815.25
5.4.420.0070.03915.42
5.4.410.0020.03615.41
5.4.400.0430.00214.74
5.4.390.0330.00314.90
5.4.380.0100.03314.83
5.4.370.0050.03114.85
5.4.360.0170.02514.92
5.4.350.0100.03114.88
5.4.340.0070.02914.60
5.4.330.0060.00611.11
5.4.320.0020.02511.77
5.4.310.0070.02211.74
5.4.300.0050.02311.73
5.4.290.0060.02011.68
5.4.280.0040.02411.72
5.4.270.0130.02314.86
5.4.260.0120.03715.08
5.4.250.0080.03614.82
5.4.240.0100.02814.92
5.4.230.0100.04014.71
5.4.220.0100.04014.96
5.4.210.0100.03814.84
5.4.200.0150.02214.83
5.4.190.0000.03414.92
5.4.180.0050.04115.02
5.4.170.0060.03715.01
5.4.160.0050.04615.00
5.4.150.0100.03815.01
5.4.140.0070.03813.88
5.4.130.0090.03013.75
5.4.120.0100.02313.83
5.4.110.0070.02613.84
5.4.100.0080.02813.80
5.4.90.0050.03413.67
5.4.80.0050.03913.77
5.4.70.0030.02813.73
5.4.60.0130.02813.68
5.4.50.0090.03213.67
5.4.40.0060.03613.82
5.4.30.0100.02713.54
5.4.20.0100.03713.71
5.4.10.0050.04613.55
5.4.00.0150.02513.37
5.3.290.0030.02611.77
5.3.280.0030.03312.70
5.3.270.0030.03112.66
5.3.260.0070.04112.58
5.3.250.0050.03512.70
5.3.240.0080.03812.66
5.3.230.0050.02912.61
5.3.220.0070.03912.69
5.3.210.0030.03412.57
5.3.200.0020.03412.64
5.3.190.0030.03012.57
5.3.180.0100.02712.62
5.3.170.0070.04212.53
5.3.160.0030.04312.71
5.3.150.0080.03412.70
5.3.140.0160.03212.56
5.3.130.0070.03712.65
5.3.120.0130.02612.52
5.3.110.0030.03612.63
5.3.100.0130.02712.29
5.3.90.0120.03512.29
5.3.80.0160.03012.41
5.3.70.0090.02812.34
5.3.60.0070.04012.30
5.3.50.0070.03712.23
5.3.40.0030.03112.29
5.3.30.0020.04312.29
5.3.20.0080.03312.18
5.3.10.0050.02712.13
5.3.00.0060.02612.11
5.2.170.0070.04311.10
5.2.160.0130.05311.13
5.2.150.0130.04711.11
5.2.140.0130.05711.23
5.2.130.0070.05711.32
5.2.120.0170.04710.93
5.2.110.0000.06311.10
5.2.100.0070.05011.28
5.2.90.0100.05711.17
5.2.80.0100.03711.19
5.2.70.0070.04011.25
5.2.60.0030.06311.03
5.2.50.0000.06311.21
5.2.40.0170.04711.08
5.2.30.0030.04311.05
5.2.20.0130.03710.96
5.2.10.0070.05010.95
5.2.00.0070.04010.91
5.1.60.0070.04710.24
5.1.50.0070.0339.95
5.1.40.0130.0439.96
5.1.30.0070.04310.42
5.1.20.0100.05310.44
5.1.10.0100.03010.16
5.1.00.0100.04010.04
5.0.50.0070.0279.22
5.0.40.0000.0339.22
5.0.30.0070.0539.22
5.0.20.0100.0209.22
5.0.10.0100.0379.22
5.0.00.0100.0479.22
4.4.90.0000.0339.22
4.4.80.0000.0239.22
4.4.70.0070.0279.22
4.4.60.0030.0279.22
4.4.50.0000.0239.22
4.4.40.0100.0379.22
4.4.30.0030.0209.22
4.4.20.0030.0279.22
4.4.10.0100.0279.22
4.4.00.0030.0339.22
4.3.110.0030.0279.22
4.3.100.0030.0339.22
4.3.90.0070.0209.22
4.3.80.0100.0409.22
4.3.70.0030.0209.22
4.3.60.0100.0139.22
4.3.50.0100.0179.22
4.3.40.0000.0339.22
4.3.30.0070.0279.22
4.3.20.0000.0309.22
4.3.10.0070.0179.22
4.3.00.0000.0236.47

preferences:
44 ms | 401 KiB | 5 Q