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 4. No redefining $test 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 // end editing here echo $test->run(function(){ $this->secret='balle'; });

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.70.0060.00916.46
8.3.60.0000.01418.28
8.3.50.0090.00922.06
8.3.40.0030.01318.71
8.3.30.0100.00719.02
8.3.20.0080.00020.31
8.3.10.0000.00822.13
8.3.00.0040.00422.34
8.2.190.0070.01517.00
8.2.180.0110.00417.00
8.2.170.0040.01122.96
8.2.160.0100.00720.84
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0030.00519.36
8.2.110.0090.00020.46
8.2.100.0080.00317.72
8.2.90.0040.00419.23
8.2.80.0030.00518.05
8.2.70.0030.00517.49
8.2.60.0090.00018.04
8.2.50.0000.00818.07
8.2.40.0050.00518.16
8.2.30.0000.00818.10
8.2.20.0040.00417.84
8.2.10.0000.00717.83
8.2.00.0020.00517.74
8.1.280.0070.00725.92
8.1.270.0040.00422.20
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0110.00018.95
8.1.230.0080.00419.15
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0060.00617.35
8.1.190.0090.00017.65
8.1.180.0000.00818.10
8.1.170.0040.00418.59
8.1.160.0000.00721.99
8.1.150.0050.00218.65
8.1.140.0040.00417.49
8.1.130.0070.00017.84
8.1.120.0050.00217.45
8.1.110.0050.00317.34
8.1.100.0040.00417.46
8.1.90.0040.00417.45
8.1.80.0000.00817.46
8.1.70.0070.00017.45
8.1.60.0000.00917.60
8.1.50.0000.00817.44
8.1.40.0070.00017.58
8.1.30.0070.00017.64
8.1.20.0040.00417.67
8.1.10.0070.00017.47
8.1.00.0040.00417.45
8.0.300.0040.00418.77
8.0.290.0000.00717.18
8.0.280.0000.00818.27
8.0.270.0030.00517.17
8.0.260.0030.00316.77
8.0.250.0000.00716.98
8.0.240.0030.00316.89
8.0.230.0070.00016.93
8.0.220.0000.00716.93
8.0.210.0000.00716.79
8.0.200.0040.00417.02
8.0.190.0040.00417.07
8.0.180.0080.00016.89
8.0.170.0040.00416.85
8.0.160.0000.00816.84
8.0.150.0000.00716.90
8.0.140.0040.00416.95
8.0.130.0000.00613.41
8.0.120.0020.00516.92
8.0.110.0030.00617.05
8.0.100.0040.00417.00
8.0.90.0000.00816.81
8.0.80.0000.01616.98
8.0.70.0070.00016.82
8.0.60.0030.00516.82
8.0.50.0070.00016.78
8.0.30.0120.00717.06
8.0.20.0160.00617.40
8.0.10.0070.00016.96
8.0.00.0140.00716.85
7.4.330.0020.00215.00
7.4.320.0040.00416.62
7.4.300.0040.00416.61
7.4.290.0030.00316.52
7.4.280.0060.00016.59
7.4.270.0030.00616.63
7.4.260.0070.00316.59
7.4.250.0070.00016.62
7.4.240.0060.00216.49
7.4.230.0030.00316.45
7.4.220.0130.00916.55
7.4.210.0050.00916.50
7.4.200.0030.00316.41
7.4.190.0070.00016.39
7.4.160.0070.00716.34
7.4.150.0080.00917.40
7.4.140.0120.00517.86
7.4.130.0180.00016.56
7.4.120.0090.00616.58
7.4.110.0090.00916.66
7.4.100.0110.00716.68
7.4.90.0070.01116.63
7.4.80.0160.00619.39
7.4.70.0070.01016.56
7.4.60.0060.00916.49
7.4.50.0030.00616.25
7.4.40.0030.01322.77
7.4.30.0130.00316.48
7.4.00.0050.01114.97
7.3.330.0060.00013.24
7.3.320.0060.00013.35
7.3.310.0070.00016.35
7.3.300.0070.00016.41
7.3.290.0040.01216.36
7.3.280.0060.01016.38
7.3.270.0120.00617.40
7.3.260.0100.01016.35
7.3.250.0090.01016.48
7.3.240.0060.01116.30
7.3.230.0160.00616.39
7.3.210.0090.00916.21
7.3.200.0090.01219.39
7.3.190.0090.00916.31
7.3.180.0060.00916.32
7.3.170.0100.01016.39
7.3.160.0100.00616.40
7.3.120.0070.01114.89
7.3.110.0090.00914.94
7.3.100.0110.00714.92
7.3.90.0120.00314.84
7.3.80.0070.01014.88
7.3.70.0030.00914.64
7.3.60.0000.01414.84
7.3.50.0090.00614.50
7.3.40.0100.00314.80
7.3.30.0060.00914.65
7.3.20.0040.00716.65
7.3.10.0070.01016.64
7.3.00.0030.01016.75
7.2.330.0110.00716.54
7.2.320.0150.00916.84
7.2.310.0140.00416.94
7.2.300.0090.00616.46
7.2.290.0080.00916.59
7.2.250.0110.00714.94
7.2.240.0070.01015.02
7.2.230.0030.01315.12
7.2.220.0060.00915.02
7.2.210.0030.01015.21
7.2.200.0090.00614.84
7.2.190.0110.00415.29
7.2.180.0050.00515.13
7.2.170.0070.00714.82
7.2.160.0130.00714.92
7.2.150.0070.00316.87
7.2.140.0000.01116.90
7.2.130.0100.00716.91
7.2.120.0070.00717.07
7.2.110.0040.00716.84
7.2.100.0040.01116.97
7.2.90.0110.00416.89
7.2.80.0030.01317.13
7.2.70.0060.00916.94
7.2.60.0070.00316.96
7.2.50.0100.00316.96
7.2.40.0090.00616.93
7.2.30.0060.00916.96
7.2.20.0060.00616.95
7.2.10.0120.00016.73
7.2.00.0070.00418.17
7.1.330.0060.00615.70
7.1.320.0040.01215.87
7.1.310.0060.00315.88
7.1.300.0100.00315.63
7.1.290.0040.00415.65
7.1.280.0050.00515.50
7.1.270.0110.00415.66
7.1.260.0070.00715.76
7.1.250.0070.00715.82
7.1.240.0040.00415.82
7.1.230.0030.01015.87
7.1.220.0030.00615.85
7.1.210.0060.00715.41
7.1.200.0060.00315.56
7.1.190.0000.01415.59
7.1.180.0030.01015.49
7.1.170.0060.00615.68
7.1.160.0070.01015.49
7.1.150.0100.00315.74
7.1.140.0070.00715.77
7.1.130.0040.01115.77
7.1.120.0070.01015.52
7.1.110.0130.00015.77
7.1.100.0040.00916.88
7.1.90.0070.00715.82
7.1.80.0000.01515.70
7.1.70.0050.00716.38
7.1.60.0050.01017.82
7.1.50.0090.01116.25
7.1.40.0070.01015.68
7.1.30.0070.00715.73
7.1.20.0070.00315.69
7.1.10.0060.00615.93
7.1.00.0060.04019.04
7.0.330.0000.01615.34
7.0.320.0060.00615.11
7.0.310.0030.00715.37
7.0.300.0000.01415.33
7.0.290.0040.01015.33
7.0.280.0030.01015.45
7.0.270.0070.01015.36
7.0.260.0070.00715.29
7.0.250.0040.00815.55
7.0.240.0120.00315.29
7.0.230.0000.00815.36
7.0.220.0000.01015.12
7.0.210.0040.00415.26
7.0.200.0040.00815.88
7.0.190.0040.01115.50
7.0.180.0060.00615.35
7.0.170.0100.00015.27
7.0.160.0070.00715.39
7.0.150.0070.00315.47
7.0.140.0020.04418.65
7.0.130.0090.00615.29
7.0.120.0030.01015.40
7.0.110.0070.00315.54
7.0.100.0030.04217.64
7.0.90.0100.04317.61
7.0.80.0030.04617.68
7.0.70.0020.04417.59
7.0.60.0110.03117.77
7.0.50.0160.04017.89
7.0.40.0030.04916.77
7.0.30.0050.03716.78
7.0.20.0080.04416.81
7.0.10.0020.04816.66
7.0.00.0070.04516.79
5.6.400.0090.00614.54
5.6.390.0070.01013.99
5.6.380.0040.00714.46
5.6.370.0030.01414.63
5.6.360.0030.00914.45
5.6.350.0080.00814.19
5.6.340.0090.00314.11
5.6.330.0030.01314.38
5.6.320.0030.01014.24
5.6.310.0000.00814.15
5.6.300.0070.00714.37
5.6.290.0030.01014.26
5.6.280.0050.03917.58
5.6.270.0100.00714.04
5.6.260.0040.00814.04
5.6.250.0030.03917.55
5.6.240.0090.04017.61
5.6.230.0090.04317.41
5.6.220.0110.03617.42
5.6.210.0080.03817.58
5.6.200.0110.04317.77
5.6.190.0050.04517.92
5.6.180.0050.02817.60
5.6.170.0070.03517.81
5.6.160.0090.04217.59
5.6.150.0110.03717.58
5.6.140.0050.04817.67
5.6.130.0110.02317.68
5.6.120.0030.04317.79
5.6.110.0110.02717.81
5.6.100.0070.04417.64
5.6.90.0030.04717.58
5.6.80.0080.03717.42
5.6.70.0080.04017.46
5.6.60.0080.04217.34
5.6.50.0100.03817.29
5.6.40.0050.04617.31
5.6.30.0100.03617.28
5.6.20.0070.03317.38
5.6.10.0100.03617.34
5.6.00.0030.03217.36
5.5.380.0080.02217.27
5.5.370.0090.04517.32
5.5.360.0130.03817.45
5.5.350.0120.04217.40
5.5.340.0070.04517.55
5.5.330.0030.04017.71
5.5.320.0070.03417.51
5.5.310.0080.04517.59
5.5.300.0060.04717.71
5.5.290.0100.03517.51
5.5.280.0120.03717.56
5.5.270.0130.04217.43
5.5.260.0080.03617.35
5.5.250.0090.04017.51
5.5.240.0100.04317.24
5.5.230.0050.03217.29
5.5.220.0050.04517.22
5.5.210.0080.04217.05
5.5.200.0080.02617.10
5.5.190.0030.02517.20
5.5.180.0050.02917.13
5.5.170.0030.01014.48
5.5.160.0030.04417.20
5.5.150.0120.04217.28
5.5.140.0060.04217.32
5.5.130.0050.04817.28
5.5.120.0080.04317.00
5.5.110.0130.03717.26
5.5.100.0030.03717.00
5.5.90.0070.04817.02
5.5.80.0070.04317.22
5.5.70.0050.02717.03
5.5.60.0080.03617.22
5.5.50.0080.03717.28
5.5.40.0160.03017.15
5.5.30.0080.03517.07
5.5.20.0070.03916.98
5.5.10.0030.04417.25
5.5.00.0100.03117.14
5.4.450.0070.04515.99
5.4.440.0100.04015.96
5.4.430.0050.02315.88
5.4.420.0060.04316.05
5.4.410.0060.04215.97
5.4.400.0010.02815.85
5.4.390.0090.02715.82
5.4.380.0040.02615.84
5.4.370.0090.03415.81
5.4.360.0100.02315.80
5.4.350.0070.04115.71
5.4.340.0050.05315.73
5.4.330.0070.00012.57
5.4.320.0120.03215.80
5.4.310.0060.04115.86
5.4.300.0120.03515.73
5.4.290.0070.04215.80
5.4.280.0060.04215.86
5.4.270.0070.02615.76
5.4.260.0070.03415.80
5.4.250.0050.04415.85
5.4.240.0050.03915.73
5.4.230.0030.03515.82
5.4.220.0050.04515.72
5.4.210.0080.03315.80
5.4.200.0100.04715.79
5.4.190.0070.03915.78
5.4.180.0000.04115.80
5.4.170.0070.03715.87
5.4.160.0030.02515.79
5.4.150.0000.04915.82
5.4.140.0050.04014.49
5.4.130.0030.03614.53
5.4.120.0030.04314.49
5.4.110.0040.02314.52
5.4.100.0030.03814.52
5.4.90.0040.02214.53
5.4.80.0060.03514.44
5.4.70.0060.03414.53
5.4.60.0040.03514.49
5.4.50.0070.03214.51
5.4.40.0010.03314.51
5.4.30.0030.02814.52
5.4.20.0030.03214.50
5.4.10.0050.03714.46
5.4.00.0000.04614.22
5.3.290.0070.03913.65
5.3.280.0050.04213.58
5.3.270.0060.02413.60
5.3.260.0080.01713.55
5.3.250.0100.03713.66
5.3.240.0070.03213.58
5.3.230.0050.03913.64
5.3.220.0070.03813.64
5.3.210.0070.02513.55
5.3.200.0030.04013.56
5.3.190.0020.04513.54
5.3.180.0000.02513.58
5.3.170.0030.03313.60
5.3.160.0100.02713.64
5.3.150.0050.03813.60
5.3.140.0030.04613.53
5.3.130.0060.04313.57
5.3.120.0070.01713.59
5.3.110.0050.03813.54
5.3.100.0040.03913.28
5.3.90.0090.03513.26
5.3.80.0030.03513.34
5.3.70.0060.01813.28
5.3.60.0080.01813.30
5.3.50.0090.02013.21
5.3.40.0020.02913.29
5.3.30.0050.03713.25
5.3.20.0040.04213.19
5.3.10.0050.04313.16
5.3.00.0050.04513.09
5.2.170.0070.03712.70
5.2.160.0070.06312.70
5.2.150.0000.03312.70
5.2.140.0030.05312.70
5.2.130.0170.05012.70
5.2.120.0070.04312.70
5.2.110.0070.05712.70
5.2.100.0030.06312.70
5.2.90.0030.03712.70
5.2.80.0030.03712.70
5.2.70.0100.04712.70
5.2.60.0030.06712.70
5.2.50.0030.05012.70
5.2.40.0030.05712.70
5.2.30.0100.06012.70
5.2.20.0030.04712.70
5.2.10.0100.05312.70
5.2.00.0070.04312.70
5.1.60.0030.02712.70
5.1.50.0100.05012.70
5.1.40.0100.02312.70
5.1.30.0030.06012.70
5.1.20.0000.03012.70
5.1.10.0030.05312.70
5.1.00.0070.02712.70
5.0.50.0000.04312.70
5.0.40.0070.04012.70
5.0.30.0000.07012.70
5.0.20.0070.02012.70
5.0.10.0000.02312.70
5.0.00.0130.04312.70
4.4.90.0000.03312.70
4.4.80.0000.02712.70
4.4.70.0000.02712.70
4.4.60.0070.01712.70
4.4.50.0000.04012.70
4.4.40.0030.05312.70
4.4.30.0070.03312.70
4.4.20.0000.03712.70
4.4.10.0130.02712.70
4.4.00.0030.04012.70
4.3.110.0030.03712.70
4.3.100.0000.03712.70
4.3.90.0030.01712.70
4.3.80.0000.02712.70
4.3.70.0030.02712.70
4.3.60.0030.02312.70
4.3.50.0030.02012.70
4.3.40.0030.02312.70
4.3.30.0000.03312.70
4.3.20.0030.03712.70
4.3.10.0000.02012.70
4.3.00.0030.02312.70

preferences:
53.98 ms | 401 KiB | 5 Q