3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Challenge 1: Modify Test::$secret before it's output. Rules:: 1. No use of Reflection API / runkit extension 2. No stopping execution before Test::run() 3. No Exceptions or PHP errors / warnings notices allowed Hints: 1. Caesar 2. Magic methods 3. Requires a new feature of PHP 5.4 */ 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 $test->callback = 'shiney'; // 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.0070.01118.68
8.3.50.0170.00521.14
8.3.40.0180.00418.97
8.3.30.0100.00320.30
8.3.20.0040.00420.13
8.3.10.0040.00421.98
8.3.00.0030.00522.34
8.2.180.0150.00616.75
8.2.170.0090.00622.96
8.2.160.0000.01320.22
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0070.01126.16
8.2.120.0080.00019.66
8.2.110.0030.00720.35
8.2.100.0040.00817.78
8.2.90.0000.00819.22
8.2.80.0050.00317.97
8.2.70.0030.00517.63
8.2.60.0040.00417.93
8.2.50.0040.00418.07
8.2.40.0040.00418.09
8.2.30.0030.00618.00
8.2.20.0040.00417.75
8.2.10.0000.00817.64
8.2.00.0000.00917.67
8.1.280.0140.00725.92
8.1.270.0030.00624.66
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0030.00622.14
8.1.230.0040.00817.64
8.1.220.0060.00317.79
8.1.210.0040.00418.77
8.1.200.0060.00317.35
8.1.190.0040.00417.53
8.1.180.0030.00619.01
8.1.170.0050.00318.55
8.1.160.0040.00422.15
8.1.150.0000.00718.51
8.1.140.0040.00417.45
8.1.130.0080.00017.75
8.1.120.0040.00317.30
8.1.110.0030.00617.30
8.1.100.0000.00817.30
8.1.90.0080.00017.32
8.1.80.0040.00417.44
8.1.70.0070.00017.37
8.1.60.0060.00317.57
8.1.50.0000.00717.55
8.1.40.0030.00517.52
8.1.30.0080.00017.54
8.1.20.0000.00917.71
8.1.10.0000.00717.54
8.1.00.0000.00817.41
8.0.300.0040.00418.77
8.0.290.0050.00216.75
8.0.280.0000.00718.39
8.0.270.0000.00817.18
8.0.260.0030.00316.83
8.0.250.0000.00716.89
8.0.240.0000.00816.99
8.0.230.0030.00316.96
8.0.220.0030.00516.93
8.0.210.0040.00416.92
8.0.200.0060.00016.93
8.0.190.0040.00416.98
8.0.180.0000.00716.82
8.0.170.0050.00316.83
8.0.160.0000.00716.86
8.0.150.0040.00416.91
8.0.140.0040.00316.93
8.0.130.0030.00313.39
8.0.120.0050.00316.73
8.0.110.0030.00516.82
8.0.100.0000.00816.78
8.0.90.0000.00816.78
8.0.80.0060.00916.87
8.0.70.0040.00416.96
8.0.60.0050.00216.79
8.0.50.0040.00416.71
8.0.30.0140.00517.12
8.0.20.0110.01017.40
8.0.10.0040.00417.05
8.0.00.0100.00716.76
7.4.330.0030.00315.00
7.4.320.0070.00016.50
7.4.300.0060.00016.53
7.4.290.0000.00816.61
7.4.280.0070.00016.60
7.4.270.0000.00716.42
7.4.260.0070.00316.45
7.4.250.0040.00416.48
7.4.240.0000.00716.55
7.4.230.0000.00716.55
7.4.220.0090.01216.56
7.4.210.0070.00716.58
7.4.200.0000.00716.52
7.4.190.0000.00716.66
7.4.160.0120.00416.50
7.4.150.0120.00617.40
7.4.140.0070.01117.86
7.4.130.0070.01016.63
7.4.120.0130.00516.52
7.4.110.0100.00616.60
7.4.100.0030.01316.58
7.4.90.0090.00916.40
7.4.80.0090.01119.39
7.4.70.0000.01616.44
7.4.60.0040.01316.45
7.4.50.0040.00416.21
7.4.40.0150.00022.77
7.4.30.0100.00716.70
7.4.00.0050.01014.95
7.3.330.0000.00613.39
7.3.320.0000.00613.24
7.3.310.0030.00316.32
7.3.300.0030.00316.38
7.3.290.0060.01216.39
7.3.280.0070.01116.32
7.3.270.0070.01017.40
7.3.260.0140.00416.31
7.3.250.0080.01016.41
7.3.240.0060.01216.29
7.3.230.0130.00316.39
7.3.210.0130.00316.39
7.3.200.0100.01019.39
7.3.190.0090.01316.27
7.3.180.0070.01516.36
7.3.170.0090.00916.30
7.3.160.0030.01316.35
7.3.120.0060.01114.89
7.3.110.0040.01115.03
7.3.100.0040.01514.77
7.3.90.0070.00714.89
7.3.80.0070.00714.89
7.3.70.0070.00714.86
7.3.60.0060.00815.00
7.3.50.0060.00614.81
7.3.40.0000.00914.66
7.3.30.0090.00614.86
7.3.20.0060.00616.60
7.3.10.0090.00316.33
7.3.00.0030.00616.70
7.2.330.0170.00316.41
7.2.320.0120.00916.48
7.2.310.0030.01316.70
7.2.300.0090.00916.38
7.2.290.0080.00816.38
7.2.250.0030.01514.73
7.2.240.0070.01114.81
7.2.230.0040.01114.88
7.2.220.0000.01615.05
7.2.210.0030.01214.95
7.2.200.0100.00314.71
7.2.190.0000.01214.96
7.2.180.0060.00915.06
7.2.170.0000.01515.20
7.2.160.0060.00614.89
7.2.150.0080.00816.68
7.2.140.0030.01016.68
7.2.130.0030.01017.07
7.2.120.0080.00816.80
7.2.110.0030.01016.66
7.2.100.0040.00816.66
7.2.90.0070.00717.01
7.2.80.0090.00316.82
7.2.70.0000.01716.63
7.2.60.0050.00716.88
7.2.50.0030.00716.61
7.2.40.0060.01216.84
7.2.30.0050.00516.86
7.2.20.0000.01117.00
7.2.10.0030.01316.64
7.2.00.0030.00818.19
7.1.330.0000.01815.96
7.1.320.0060.00815.70
7.1.310.0000.01115.45
7.1.300.0070.01015.88
7.1.290.0030.01015.68
7.1.280.0070.00715.98
7.1.270.0090.00615.79
7.1.260.0070.00715.76
7.1.250.0060.00915.93
7.1.240.0040.00815.87
7.1.230.0090.00315.91
7.1.220.0070.00715.76
7.1.210.0030.00915.73
7.1.200.0060.00915.56
7.1.190.0070.01015.87
7.1.180.0040.00415.79
7.1.170.0030.00915.94
7.1.160.0060.00815.53
7.1.150.0090.00015.55
7.1.140.0060.00315.88
7.1.130.0060.00315.53
7.1.120.0030.01415.53
7.1.110.0040.01115.77
7.1.100.0100.00516.98
7.1.90.0080.00815.50
7.1.80.0000.01915.95
7.1.70.0010.00916.26
7.1.60.0110.00917.60
7.1.50.0100.01016.48
7.1.40.0110.00415.64
7.1.30.0030.00615.54
7.1.20.0040.01115.57
7.1.10.0040.01115.53
7.1.00.0050.04519.10
7.0.330.0130.00315.02
7.0.320.0060.00615.25
7.0.310.0040.00415.40
7.0.300.0090.00315.40
7.0.290.0090.00015.50
7.0.280.0060.00615.43
7.0.270.0000.01415.24
7.0.260.0060.01015.44
7.0.250.0110.00015.36
7.0.240.0040.01115.13
7.0.230.0070.00415.55
7.0.220.0030.01015.30
7.0.210.0000.01515.54
7.0.200.0050.00715.88
7.0.190.0070.00715.36
7.0.180.0030.00615.44
7.0.170.0130.00015.53
7.0.160.0030.01015.20
7.0.150.0000.01415.48
7.0.140.0040.04118.68
7.0.130.0030.00615.14
7.0.120.0070.00715.49
7.0.110.0040.01115.50
7.0.100.0060.02417.63
7.0.90.0050.02417.71
7.0.80.0030.02717.64
7.0.70.0110.02017.60
7.0.60.0050.03217.62
7.0.50.0060.04317.83
7.0.40.0050.04816.63
7.0.30.0120.04216.81
7.0.20.0020.03016.72
7.0.10.0080.04516.75
7.0.00.0050.03216.79
5.6.400.0060.00614.38
5.6.390.0130.00314.49
5.6.380.0000.01614.23
5.6.370.0000.01514.44
5.6.360.0040.00814.28
5.6.350.0080.00614.07
5.6.340.0000.01314.43
5.6.330.0070.00714.72
5.6.320.0040.01114.27
5.6.310.0090.00913.96
5.6.300.0100.00314.30
5.6.290.0040.00714.40
5.6.280.0070.01014.73
5.6.270.0090.00614.38
5.6.260.0040.01114.39
5.6.250.0070.01917.52
5.6.240.0070.02417.51
5.6.230.0030.02517.59
5.6.220.0030.03317.69
5.6.210.0050.02617.45
5.6.200.0030.02517.61
5.6.190.0020.04517.68
5.6.180.0060.03817.60
5.6.170.0150.04017.78
5.6.160.0110.04317.63
5.6.150.0090.03717.67
5.6.140.0130.03817.83
5.6.130.0060.04217.57
5.6.120.0090.04017.76
5.6.110.0050.04617.81
5.6.100.0110.04117.71
5.6.90.0100.04317.61
5.6.80.0100.02117.37
5.6.70.0070.03917.21
5.6.60.0090.04517.45
5.6.50.0080.03917.32
5.6.40.0070.04317.35
5.6.30.0050.02817.39
5.6.20.0100.03017.31
5.6.10.0040.03217.25
5.6.00.0060.04017.34
5.5.380.0050.02317.43
5.5.370.0050.02517.24
5.5.360.0140.01517.41
5.5.350.0070.02217.39
5.5.340.0030.05417.51
5.5.330.0050.04517.59
5.5.320.0030.03917.49
5.5.310.0070.03317.41
5.5.300.0070.04217.54
5.5.290.0060.02817.69
5.5.280.0090.04117.69
5.5.270.0110.03617.55
5.5.260.0120.04017.66
5.5.250.0020.04917.55
5.5.240.0100.03717.17
5.5.230.0050.04717.31
5.5.220.0060.04017.19
5.5.210.0030.04817.24
5.5.200.0040.02917.14
5.5.190.0070.04417.04
5.5.180.0080.04117.21
5.5.170.0080.00814.44
5.5.160.0080.04317.24
5.5.150.0070.04417.19
5.5.140.0110.03317.24
5.5.130.0080.03617.32
5.5.120.0050.04317.12
5.5.110.0150.03917.16
5.5.100.0050.03517.15
5.5.90.0070.04717.05
5.5.80.0080.04217.24
5.5.70.0060.04117.32
5.5.60.0060.03617.10
5.5.50.0020.04117.15
5.5.40.0090.03517.06
5.5.30.0060.04617.04
5.5.20.0080.02817.16
5.5.10.0080.04016.94
5.5.00.0080.04217.01
5.4.450.0070.04015.52
5.4.440.0100.03115.60
5.4.430.0030.04315.68
5.4.420.0050.04215.69
5.4.410.0050.04115.56
5.4.400.0030.04315.49
5.4.390.0100.03515.34
5.4.380.0050.04015.34
5.4.370.0070.02315.42
5.4.360.0100.03815.42
5.4.350.0060.04215.34
5.4.340.0140.03215.46
5.4.330.0000.00711.81
5.4.320.0060.02615.47
5.4.310.0120.03215.48
5.4.300.0050.04015.41
5.4.290.0150.01715.47
5.4.280.0030.04515.52
5.4.270.0030.03915.38
5.4.260.0050.03815.45
5.4.250.0080.03215.35
5.4.240.0050.03815.45
5.4.230.0050.03815.46
5.4.220.0070.02515.46
5.4.210.0030.02515.33
5.4.200.0030.03615.41
5.4.190.0040.02315.35
5.4.180.0070.03615.47
5.4.170.0060.02715.42
5.4.160.0030.02615.41
5.4.150.0030.03215.41
5.4.140.0030.04214.11
5.4.130.0020.02214.07
5.4.120.0070.03113.99
5.4.110.0070.02714.10
5.4.100.0060.02814.08
5.4.90.0050.01714.12
5.4.80.0060.03814.14
5.4.70.0020.03014.11
5.4.60.0040.02014.11
5.4.50.0110.03514.14
5.4.40.0050.02514.13
5.4.30.0030.04414.07
5.4.20.0100.03514.07
5.4.10.0050.03414.14
5.4.00.0000.03813.74
5.3.290.0100.03613.23
5.3.280.0030.02113.21
5.3.270.0010.02413.19
5.3.260.0050.04313.21
5.3.250.0050.02313.21
5.3.240.0020.02813.19
5.3.230.0030.03013.27
5.3.220.0120.02713.19
5.3.210.0060.03413.26
5.3.200.0050.02413.26
5.3.190.0020.03313.22
5.3.180.0060.02313.18
5.3.170.0040.02813.17
5.3.160.0050.01813.18
5.3.150.0050.03813.21
5.3.140.0090.03013.19
5.3.130.0070.03913.21
5.3.120.0080.03513.19
5.3.110.0000.04513.19
5.3.100.0030.04312.90
5.3.90.0060.03912.88
5.3.80.0050.04012.90
5.3.70.0030.03912.92
5.3.60.0050.03012.86
5.3.50.0090.03912.91
5.3.40.0050.04012.88
5.3.30.0040.04012.81
5.3.20.0000.04312.71
5.3.10.0120.02812.80
5.3.00.0060.03612.71
5.2.170.0030.06012.21
5.2.160.0000.05712.21
5.2.150.0030.04312.21
5.2.140.0070.06012.21
5.2.130.0030.06312.21
5.2.120.0030.03312.21
5.2.110.0000.06712.21
5.2.100.0030.06312.21
5.2.90.0070.05712.21
5.2.80.0100.04012.21
5.2.70.0070.06012.21
5.2.60.0130.05012.21
5.2.50.0100.05712.21
5.2.40.0100.05012.21
5.2.30.0030.06012.21
5.2.20.0070.05012.21
5.2.10.0030.03312.21
5.2.00.0070.05712.21
5.1.60.0100.05012.21
5.1.50.0000.05712.21
5.1.40.0000.06012.21
5.1.30.0100.03012.21
5.1.20.0070.05012.21
5.1.10.0070.05312.21
5.1.00.0070.05312.21
5.0.50.0030.04312.21
5.0.40.0030.04312.21
5.0.30.0030.03312.21
5.0.20.0000.03312.21
5.0.10.0030.03312.21
5.0.00.0030.06012.21
4.4.90.0000.03312.21
4.4.80.0030.01712.21
4.4.70.0030.03312.21
4.4.60.0100.01712.21
4.4.50.0030.03012.21
4.4.40.0000.04312.21
4.4.30.0070.02712.21
4.4.20.0070.02712.21
4.4.10.0000.03712.21
4.4.00.0030.04012.21
4.3.110.0000.03712.21
4.3.100.0070.03012.21
4.3.90.0030.03312.21
4.3.80.0130.04712.21
4.3.70.0100.01312.21
4.3.60.0000.03712.21
4.3.50.0000.03712.21
4.3.40.0070.02012.21
4.3.30.0000.03012.21
4.3.20.0000.03712.21
4.3.10.0030.03312.21
4.3.00.0030.03312.21

preferences:
44.67 ms | 401 KiB | 5 Q