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 echo $key; $value = $v(); // and a callback! $this->{$key} = $value; } } $test = new Test; // start editing here $test->foo = "bar"; // 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.01116.50
8.3.50.0120.00722.12
8.3.40.0220.00018.87
8.3.30.0100.01018.96
8.3.20.0000.00920.21
8.3.10.0040.00423.61
8.3.00.0030.01122.34
8.2.180.0110.00318.41
8.2.170.0140.00722.96
8.2.160.0130.00020.52
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0120.00322.25
8.2.110.0070.00322.30
8.2.100.0070.00417.72
8.2.90.0050.00319.17
8.2.80.0000.00817.97
8.2.70.0060.00317.63
8.2.60.0090.00018.00
8.2.50.0050.00318.07
8.2.40.0000.00719.24
8.2.30.0000.00818.13
8.2.20.0070.00017.79
8.2.10.0030.00517.80
8.2.00.0000.00817.85
8.1.280.0070.01025.92
8.1.270.0040.00423.79
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.96
8.1.230.0030.00719.14
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0040.00717.35
8.1.190.0040.00417.43
8.1.180.0040.00418.10
8.1.170.0000.00818.32
8.1.160.0040.00422.00
8.1.150.0050.00218.50
8.1.140.0070.00017.44
8.1.130.0030.00317.79
8.1.120.0040.00417.43
8.1.110.0070.00017.38
8.1.100.0030.00317.29
8.1.90.0000.00817.34
8.1.80.0000.00717.38
8.1.70.0000.00717.34
8.1.60.0050.00317.61
8.1.50.0040.00417.52
8.1.40.0000.00817.44
8.1.30.0000.00917.63
8.1.20.0040.00417.60
8.1.10.0040.00417.58
8.1.00.0040.00417.49
8.0.300.0000.00718.77
8.0.290.0050.00216.93
8.0.280.0070.00018.39
8.0.270.0030.00317.08
8.0.260.0000.00616.79
8.0.250.0030.00316.97
8.0.240.0040.00416.99
8.0.230.0040.00416.94
8.0.220.0000.00616.83
8.0.210.0030.00316.76
8.0.200.0060.00016.96
8.0.190.0050.00217.00
8.0.180.0030.00516.97
8.0.170.0030.00616.92
8.0.160.0040.00416.84
8.0.150.0000.00716.82
8.0.140.0000.01016.86
8.0.130.0060.00013.36
8.0.120.0000.00816.77
8.0.110.0000.00716.79
8.0.100.0030.00516.68
8.0.90.0070.00016.81
8.0.80.0120.00916.79
8.0.70.0070.00016.78
8.0.60.0040.00416.77
8.0.50.0050.00316.94
8.0.30.0080.01117.15
8.0.20.0110.00917.40
8.0.10.0050.00217.09
8.0.00.0120.00916.75
7.4.330.0050.00015.09
7.4.320.0030.00316.54
7.4.300.0040.00416.61
7.4.290.0030.00516.42
7.4.280.0000.00716.63
7.4.270.0030.00316.65
7.4.260.0000.00716.59
7.4.250.0040.00416.61
7.4.240.0050.00316.58
7.4.230.0030.00316.59
7.4.220.0120.01216.52
7.4.210.0090.00616.55
7.4.200.0030.00316.39
7.4.190.0080.00016.78
7.4.160.0060.01016.63
7.4.150.0070.01017.40
7.4.140.0110.01017.86
7.4.130.0120.00516.48
7.4.120.0110.00916.59
7.4.110.0100.00716.71
7.4.100.0130.00416.47
7.4.90.0080.01616.68
7.4.80.0060.01316.53
7.4.70.0000.02116.43
7.4.60.0090.01516.59
7.4.50.0030.00616.38
7.4.40.0040.00722.77
7.4.30.0060.01016.47
7.4.00.0080.00815.21
7.3.330.0030.00313.29
7.3.320.0000.00513.17
7.3.310.0000.00716.21
7.3.300.0000.00716.40
7.3.290.0120.00616.32
7.3.280.0070.01116.37
7.3.270.0170.00817.40
7.3.260.0110.00616.34
7.3.250.0130.00516.45
7.3.240.0130.00316.29
7.3.230.0130.00316.47
7.3.210.0090.00916.58
7.3.200.0060.01619.39
7.3.190.0070.01116.47
7.3.180.0060.01216.41
7.3.170.0070.00816.46
7.3.160.0080.01416.33
7.3.120.0000.01715.02
7.3.110.0090.00614.78
7.3.100.0040.01214.66
7.3.90.0040.01414.90
7.3.80.0030.01314.57
7.3.70.0070.01014.79
7.3.60.0090.00414.48
7.3.50.0030.01314.79
7.3.40.0160.00014.77
7.3.30.0110.00414.69
7.3.20.0000.01216.76
7.3.10.0030.01116.66
7.3.00.0050.00716.55
7.2.330.0120.00716.73
7.2.320.0200.00316.50
7.2.310.0090.00916.87
7.2.300.0070.01016.81
7.2.290.0160.00016.69
7.2.240.0050.00514.80
7.2.230.0030.01415.24
7.2.220.0090.00615.08
7.2.210.0040.01115.02
7.2.200.0070.01015.16
7.2.190.0090.00615.21
7.2.180.0100.00715.25
7.2.170.0000.01815.13
7.2.160.0070.01114.96
7.2.150.0070.00716.90
7.2.140.0070.00716.94
7.2.130.0030.01216.83
7.2.120.0020.01316.94
7.2.110.0030.00916.93
7.2.100.0030.00816.93
7.2.90.0090.00816.99
7.2.80.0070.00716.91
7.2.70.0040.00916.96
7.2.60.0090.00416.99
7.2.50.0110.00316.96
7.2.40.0090.00716.96
7.2.30.0060.00616.99
7.2.20.0030.00916.73
7.2.10.0050.00816.86
7.2.00.0070.00717.04
7.1.330.0100.00615.66
7.1.320.0030.00615.92
7.1.310.0090.00315.82
7.1.300.0040.00815.95
7.1.290.0000.01715.84
7.1.280.0050.00515.81
7.1.270.0120.00316.03
7.1.260.0060.00915.67
7.1.250.0000.01315.89
7.1.200.0040.01115.71
7.1.70.0040.00416.93
7.1.60.0100.01319.29
7.1.50.0160.01017.05
7.1.00.0000.08022.26
7.0.200.0000.00716.79
7.0.140.0000.07721.97
7.0.110.0000.06319.88
7.0.100.0100.05319.90
7.0.90.0070.08020.07
7.0.80.0170.06720.00
7.0.70.0030.08319.85
7.0.60.0130.06720.02
7.0.50.0170.05019.93
7.0.40.0070.08719.75
7.0.30.0170.05319.67
7.0.20.0130.07319.71
7.0.10.0100.08019.73
7.0.00.0100.08019.70
5.6.280.0070.06721.05
5.6.260.0070.06020.53
5.6.250.0100.07320.61
5.6.240.0170.07020.65
5.6.230.0030.08320.48
5.6.220.0070.08320.66
5.6.210.0000.07320.63
5.6.200.0100.08020.63
5.6.190.0100.08320.63
5.6.180.0100.08020.66
5.6.170.0170.06320.86
5.6.160.0070.07320.71
5.6.150.0170.07020.66
5.6.140.0100.08320.66
5.6.130.0070.07320.70
5.6.120.0170.06720.55
5.6.110.0070.08320.60
5.6.100.0000.08320.58
5.6.90.0170.07020.55
5.6.80.0030.08020.22
5.6.70.0130.05719.99
5.6.60.0000.05019.94
5.6.50.0070.08019.94
5.6.40.0070.07720.22
5.6.30.0070.05719.95
5.6.20.0000.07719.93
5.6.10.0030.08020.02
5.6.00.0000.08719.83
5.5.380.0070.07320.56
5.5.370.0030.06720.58
5.5.360.0100.08020.35
5.5.350.0070.08020.47
5.5.340.0070.08320.68
5.5.330.0030.05320.83
5.5.320.0030.05720.98
5.5.310.0130.07020.80
5.5.300.0070.09020.89
5.5.290.0100.08020.81
5.5.280.0030.08320.99
5.5.270.0100.08021.04
5.5.260.0130.08020.97
5.5.250.0070.07720.62
5.5.240.0100.06720.07
5.5.230.0070.07720.37
5.5.220.0230.06020.25
5.5.210.0000.08720.09
5.5.200.0070.03720.05
5.5.190.0070.08320.20
5.5.180.0070.06720.16
5.5.160.0030.04720.26
5.5.150.0130.07020.25
5.5.140.0030.07720.37
5.5.130.0070.06720.32
5.5.120.0100.07720.35
5.5.110.0030.08020.19
5.5.100.0070.08020.11
5.5.90.0070.07320.13
5.5.80.0270.04320.24
5.5.70.0130.04020.14
5.5.60.0070.08020.19
5.5.50.0100.07020.07
5.5.40.0070.07720.24
5.5.30.0030.08020.25
5.5.20.0070.07020.06
5.5.10.0100.07720.16
5.5.00.0030.05720.10
5.4.450.0030.05319.64
5.4.440.0030.08019.50
5.4.430.0130.07319.66
5.4.420.0030.08319.49
5.4.410.0100.04319.50
5.4.400.0030.08019.17
5.4.390.0200.03019.16
5.4.380.0100.07319.03
5.4.370.0030.03719.19
5.4.360.0070.06719.00
5.4.350.0070.07319.18
5.4.340.0100.03318.97
5.4.320.0130.07018.99
5.4.310.0000.08019.26
5.4.300.0030.04319.14
5.4.290.0030.06319.13
5.4.280.0000.08719.20
5.4.270.0170.06719.34
5.4.260.0170.06319.00
5.4.250.0070.07319.22
5.4.240.0070.06719.33
5.4.230.0070.07719.15
5.4.220.0070.07019.30
5.4.210.0030.07019.17
5.4.200.0030.07719.18
5.4.190.0070.07718.97
5.4.180.0070.07319.00
5.4.170.0100.07018.98
5.4.160.0070.07019.16
5.4.150.0100.07319.14
5.4.140.0100.05716.34
5.4.130.0070.06716.43
5.4.120.0070.07016.53
5.4.110.0000.07716.43
5.4.100.0070.07716.36
5.4.90.0030.07316.47
5.4.80.0030.07316.25
5.4.70.0000.07016.58
5.4.60.0130.06316.47
5.4.50.0100.03716.23
5.4.40.0100.07016.45
5.4.30.0030.04316.52
5.4.20.0100.06016.38
5.4.10.0100.06716.43
5.4.00.0130.06715.79
5.3.290.0070.08014.91
5.3.280.0070.08014.61
5.3.270.0030.06014.70
5.3.260.0100.07014.70
5.3.250.0130.07014.62
5.3.240.0100.05314.60
5.3.230.0100.07014.57
5.3.220.0070.05014.56
5.3.210.0070.07714.60
5.3.200.0070.08014.42
5.3.190.0070.04314.56
5.3.180.0170.07014.65
5.3.170.0070.07314.55
5.3.160.0130.06714.59
5.3.150.0030.04314.54
5.3.140.0030.07314.57
5.3.130.0070.07314.64
5.3.120.0070.07014.55
5.3.110.0070.08014.69
5.3.100.0100.07014.08
5.3.90.0030.04714.04
5.3.80.0130.06314.08
5.3.70.0070.07013.98
5.3.60.0070.07714.02
5.3.50.0100.06313.96
5.3.40.0070.04713.96
5.3.30.0070.07314.00
5.3.20.0030.07313.70
5.3.10.0070.05313.70
5.3.00.0170.06713.77
5.2.170.0070.03311.91
5.2.160.0070.06011.91
5.2.150.0030.06311.91
5.2.140.0100.03011.91
5.2.130.0070.04711.91
5.2.120.0100.06011.91
5.2.110.0030.06311.91
5.2.100.0070.06011.91
5.2.90.0030.04311.91
5.2.80.0000.06011.91
5.2.70.0130.05311.91
5.2.60.0100.04011.91
5.2.50.0030.05011.91
5.2.40.0070.03311.91
5.2.30.0170.05011.91
5.2.20.0070.06311.91
5.2.10.0030.06311.91
5.2.00.0070.05011.91
5.1.60.0000.03711.91
5.1.50.0030.05311.91
5.1.40.0070.04011.91
5.1.30.0100.05011.91
5.1.20.0030.05711.91
5.1.10.0100.05311.91
5.1.00.0030.05011.91
5.0.50.0100.02711.91
5.0.40.0130.03011.91
5.0.30.0070.06011.91
5.0.20.0030.04311.91
5.0.10.0000.04711.91
5.0.00.0100.05011.91
4.4.90.0000.03711.91
4.4.80.0000.03711.91
4.4.70.0000.02311.91
4.4.60.0000.03711.91
4.4.50.0070.02711.91
4.4.40.0070.05011.91
4.4.30.0030.03711.91
4.4.20.0070.02711.91
4.4.10.0000.01711.91
4.4.00.0070.04311.91
4.3.110.0030.03711.91
4.3.100.0000.03311.91
4.3.90.0070.02711.91
4.3.80.0030.05011.91
4.3.70.0000.03711.91
4.3.60.0030.03311.91
4.3.50.0070.02311.91
4.3.40.0070.04011.91
4.3.30.0000.02311.91
4.3.20.0000.02711.91
4.3.10.0030.03011.91
4.3.00.0000.03011.91

preferences:
46.46 ms | 401 KiB | 5 Q