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 $test->callback = function(){ }; // 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.0110.00418.68
8.3.50.0120.00822.08
8.3.40.0110.00418.96
8.3.30.0160.00319.18
8.3.20.0090.00020.16
8.3.10.0070.00022.11
8.3.00.0080.00022.39
8.2.180.0100.01016.88
8.2.170.0120.00322.96
8.2.160.0070.01020.43
8.2.150.0040.00424.18
8.2.140.0110.00724.66
8.2.130.0050.00326.16
8.2.120.0050.00319.36
8.2.110.0070.00421.93
8.2.100.0040.00819.76
8.2.90.0030.00619.27
8.2.80.0040.00417.97
8.2.70.0000.00817.73
8.2.60.0070.00018.04
8.2.50.0040.00418.07
8.2.40.0030.00618.09
8.2.30.0050.00218.21
8.2.20.0000.00917.85
8.2.10.0070.00017.88
8.2.00.0000.00717.84
8.1.280.0100.00325.92
8.1.270.0000.00822.14
8.1.260.0130.00326.35
8.1.250.0040.00428.09
8.1.240.0000.00923.79
8.1.230.0000.01118.97
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0030.00617.38
8.1.190.0030.00517.29
8.1.180.0000.00918.10
8.1.170.0000.00818.50
8.1.160.0030.00722.03
8.1.150.0000.00818.67
8.1.140.0040.00417.47
8.1.130.0070.00017.85
8.1.120.0030.00317.36
8.1.110.0000.00717.42
8.1.100.0040.00417.49
8.1.90.0040.00417.34
8.1.80.0030.00317.48
8.1.70.0000.00717.51
8.1.60.0060.00317.55
8.1.50.0000.00817.61
8.1.40.0050.00317.58
8.1.30.0050.00317.60
8.1.20.0080.00017.70
8.1.10.0000.00817.43
8.1.00.0000.00817.46
8.0.300.0000.00718.77
8.0.290.0060.00317.05
8.0.280.0000.00718.41
8.0.270.0030.00317.17
8.0.260.0000.00616.78
8.0.250.0100.00016.96
8.0.240.0050.00416.86
8.0.230.0070.00016.99
8.0.220.0000.00716.98
8.0.210.0060.00016.91
8.0.200.0000.00717.07
8.0.190.0070.00017.04
8.0.180.0030.00517.03
8.0.170.0030.00716.91
8.0.160.0020.00516.96
8.0.150.0030.00316.85
8.0.140.0000.00716.93
8.0.130.0050.00013.41
8.0.120.0000.00817.01
8.0.110.0040.00416.88
8.0.100.0050.00216.91
8.0.90.0050.00217.02
8.0.80.0070.01016.92
8.0.70.0040.00416.92
8.0.60.0040.00416.98
8.0.50.0000.00816.89
8.0.30.0130.00716.95
8.0.20.0080.01017.40
8.0.10.0040.00417.17
8.0.00.0060.01217.10
7.4.330.0050.00015.01
7.4.320.0000.00716.43
7.4.300.0040.00416.55
7.4.290.0000.00716.66
7.4.280.0030.00316.41
7.4.270.0000.00716.52
7.4.260.0000.00716.53
7.4.250.0040.00416.40
7.4.240.0040.00316.55
7.4.230.0040.00416.57
7.4.220.0100.01016.65
7.4.210.0070.00816.53
7.4.200.0000.00716.55
7.4.190.0040.00416.63
7.4.160.0080.00816.58
7.4.150.0090.00917.40
7.4.140.0130.00517.86
7.4.130.0100.00816.61
7.4.120.0150.00716.57
7.4.110.0140.00316.34
7.4.100.0160.00416.79
7.4.90.0100.00716.58
7.4.80.0120.01219.39
7.4.70.0030.01316.50
7.4.60.0060.01216.49
7.4.50.0070.00016.18
7.4.40.0070.00422.77
7.4.30.0060.01016.41
7.4.00.0040.00815.21
7.3.330.0000.00513.36
7.3.320.0050.00013.21
7.3.310.0030.00316.41
7.3.300.0000.00716.20
7.3.290.0090.00616.42
7.3.280.0100.00916.38
7.3.270.0170.00317.40
7.3.260.0060.01216.33
7.3.250.0140.00516.62
7.3.240.0040.01216.55
7.3.230.0100.00716.62
7.3.210.0090.00616.37
7.3.200.0070.01019.39
7.3.190.0080.01216.46
7.3.180.0050.01116.48
7.3.170.0080.00816.34
7.3.160.0000.01516.45
7.3.120.0100.00714.69
7.3.10.0110.00316.66
7.3.00.0060.00316.73
7.2.330.0090.00916.84
7.2.320.0120.00616.82
7.2.310.0110.00716.50
7.2.300.0060.01316.66
7.2.290.0200.00316.80
7.2.130.0040.00916.97
7.2.120.0060.00316.66
7.2.110.0000.01916.93
7.2.100.0070.00716.79
7.2.90.0070.01116.68
7.2.80.0030.00716.79
7.2.70.0030.00816.89
7.2.60.0070.00716.77
7.2.50.0000.01316.74
7.2.40.0090.00016.79
7.2.30.0100.00316.73
7.2.20.0030.01016.93
7.2.10.0070.00416.69
7.2.00.0050.00817.97
7.1.250.0030.00515.82
7.1.200.0040.00815.78
7.1.100.0040.00717.82
7.1.70.0060.00316.85
7.1.60.0120.00619.82
7.1.50.0070.00716.67
7.1.00.0070.07322.43
7.0.200.0060.00616.29
7.0.140.0070.06722.09
7.0.60.0030.04019.97
7.0.50.0070.07017.73
7.0.40.0070.05020.10
7.0.30.0300.08720.07
7.0.20.0370.07720.33
7.0.10.0270.08020.15
7.0.00.0130.09720.14
5.6.280.0100.07021.16
5.6.210.0070.06720.55
5.6.200.0000.04318.29
5.6.190.0030.05020.45
5.6.180.3400.04020.77
5.6.170.0330.05320.51
5.6.160.0130.07720.39
5.6.150.0100.07718.23
5.6.140.0130.07318.14
5.6.130.0070.08318.11
5.6.120.0100.06021.01
5.6.110.0030.04321.16
5.6.100.0170.07321.04
5.6.90.0070.08320.97
5.6.80.0030.05720.39
5.6.70.0430.05720.29
5.5.350.0030.04720.47
5.5.340.0000.05317.95
5.5.330.0100.08720.40
5.5.320.0270.08020.23
5.5.310.0230.07720.32
5.5.300.0100.07317.96
5.5.290.0100.03717.98
5.5.280.0000.04720.75
5.5.270.0100.08020.78
5.5.260.0030.04320.73
5.5.250.0070.07020.50
5.5.240.0100.05320.08
5.4.450.1570.03719.48
5.4.440.1400.04319.64
5.4.430.1600.03719.40
5.4.420.1430.04019.41
5.4.410.1400.03019.14
5.4.400.1400.03318.95
5.4.390.1430.03719.17
5.4.380.1600.03719.32
5.4.370.1570.03718.95
5.4.360.1430.04019.08
5.4.350.1400.04019.09
5.4.340.1570.03319.14
5.4.320.1570.03719.09
5.4.310.1430.03719.05
5.4.300.1630.02719.01
5.4.290.1400.03719.21
5.4.280.1530.04319.08
5.4.270.1600.03319.30
5.4.260.1500.04019.31
5.4.250.1600.03019.08
5.4.240.1570.03319.15
5.4.230.1570.03719.05
5.4.220.1700.02319.13
5.4.210.1600.03319.16
5.4.200.1630.03719.08
5.4.190.1530.03718.96
5.4.180.0930.03719.25
5.4.170.0030.03718.97
5.4.160.0100.04019.29
5.4.150.0000.05319.11
5.4.140.1200.04316.66
5.4.130.1730.03316.70
5.4.120.1500.03016.41
5.4.110.1400.03716.25
5.4.100.1230.03716.51
5.4.90.1470.04016.51
5.4.80.1700.03716.20
5.4.70.1770.03716.50
5.4.60.1430.03716.25
5.4.50.0130.03316.55
5.4.40.0100.06316.22
5.4.30.0030.04316.33
5.4.20.1000.06316.51
5.4.10.1630.04716.52
5.4.00.1770.04015.96
5.3.290.1700.04714.79
5.3.280.1770.04714.52
5.3.270.1770.04714.60
5.3.260.1670.03314.76
5.3.250.1830.03714.52
5.3.240.1700.03314.58
5.3.230.1870.04714.61
5.3.220.1630.03314.55
5.3.210.1600.03714.79
5.3.200.1770.03314.59
5.3.190.1530.04314.59
5.3.180.1630.03714.54
5.3.170.1600.04014.58
5.3.160.1670.04314.49
5.3.150.1670.02714.57
5.3.140.1500.04314.48
5.3.130.1870.04714.48
5.3.120.1530.04314.61
5.3.110.1600.03314.45
5.3.100.1570.03714.01
5.3.90.1570.03313.95
5.3.80.1730.03713.93
5.3.70.1630.03014.03
5.3.60.1670.03714.15
5.3.50.1630.02713.97
5.3.40.1670.02713.88
5.3.30.1770.03713.84
5.3.20.1970.03313.68
5.3.10.2030.04013.59
5.3.00.1730.04013.65
5.2.170.1630.03311.06
5.2.160.1400.03311.27
5.2.150.1470.04311.40
5.2.140.1400.02711.06
5.2.130.1530.03711.02
5.2.120.1570.03311.02
5.2.110.1530.02711.18
5.2.100.1500.03011.23
5.2.90.0730.03311.06
5.2.80.0030.06711.00
5.2.70.0030.06311.07
5.2.60.0130.03011.14
5.2.50.0530.03011.10
5.2.40.1070.03310.91
5.2.30.1270.04311.03
5.2.20.1100.03311.19
5.2.10.1100.02710.79
5.2.00.1100.04010.73
5.1.60.1030.0279.93
5.1.50.1030.02310.15
5.1.40.1230.0279.96
5.1.30.1230.03010.31
5.1.20.1100.03710.34
5.1.10.1030.0309.97
5.1.00.1100.03310.16
5.0.50.0670.0278.68
5.0.40.0630.0338.36
5.0.30.0630.0338.18
5.0.20.0630.0238.14
5.0.10.0570.0208.11
5.0.00.0670.0408.05
4.4.90.0470.0237.49
4.4.80.0470.0177.49
4.4.70.0500.0177.49
4.4.60.0670.0237.49
4.4.50.0570.0137.49
4.4.40.0570.0307.49
4.4.30.0670.0207.49
4.4.20.0700.0207.49
4.4.10.0600.0207.49
4.4.00.0470.0277.49
4.3.110.0670.0137.49
4.3.100.0770.0207.49
4.3.90.0600.0177.49
4.3.80.0670.0377.49
4.3.70.0630.0277.49
4.3.60.0570.0137.49
4.3.50.0630.0177.49
4.3.40.0730.0337.49
4.3.30.0300.0277.49
4.3.20.0300.0207.49
4.3.10.0270.0237.49
4.3.00.0330.0307.49

preferences:
37.84 ms | 401 KiB | 5 Q