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 // key needs to = 'callback', with a $v being a function which changes secret // the value $v[($v[$v])] needs to equal callback // v must be an array with a class Vee{ public function __contruct(){ return 'callback'; } } $test->secret = array('13', new Vee); // 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.00718.52
8.3.50.0090.00621.99
8.3.40.0070.01118.95
8.3.30.0110.00419.17
8.3.20.0050.00320.30
8.3.10.0050.00322.04
8.3.00.0050.00322.22
8.2.180.0110.00418.54
8.2.170.0120.00622.96
8.2.160.0100.00320.49
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0060.00326.16
8.2.120.0040.00419.36
8.2.110.0050.00520.43
8.2.100.0000.01017.78
8.2.90.0040.00419.23
8.2.80.0060.00317.97
8.2.70.0050.00317.75
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0080.00018.22
8.2.30.0030.00518.13
8.2.20.0040.00417.66
8.2.10.0000.00819.52
8.2.00.0040.00417.69
8.1.280.0030.01025.92
8.1.270.0060.00322.20
8.1.260.0000.00826.35
8.1.250.0000.00728.09
8.1.240.0040.00823.79
8.1.230.0090.00321.03
8.1.220.0000.00917.74
8.1.210.0080.00018.77
8.1.200.0060.00317.35
8.1.190.0060.00317.40
8.1.180.0000.00818.10
8.1.170.0040.00418.72
8.1.160.0000.00822.02
8.1.150.0040.00418.63
8.1.140.0060.00317.46
8.1.130.0000.00717.74
8.1.120.0040.00317.42
8.1.110.0050.00317.41
8.1.100.0020.00517.51
8.1.90.0000.00717.49
8.1.80.0070.00017.46
8.1.70.0040.00417.48
8.1.60.0030.00617.59
8.1.50.0040.00417.48
8.1.40.0080.00017.57
8.1.30.0030.00617.55
8.1.20.0050.00317.62
8.1.10.0040.00417.56
8.1.00.0000.00817.54
8.0.300.0070.00018.77
8.0.290.0050.00216.88
8.0.280.0070.00018.44
8.0.270.0030.00317.30
8.0.260.0030.00316.88
8.0.250.0000.00717.00
8.0.240.0040.00417.00
8.0.230.0070.00017.04
8.0.220.0050.00317.02
8.0.210.0030.00316.95
8.0.200.0030.00316.92
8.0.190.0040.00417.02
8.0.180.0040.00416.90
8.0.170.0000.00717.05
8.0.160.0000.00816.89
8.0.150.0040.00416.94
8.0.140.0000.00816.80
8.0.130.0000.00913.41
8.0.120.0040.00416.92
8.0.110.0000.00817.03
8.0.100.0040.00416.84
8.0.90.0040.00416.96
8.0.80.0120.00416.86
8.0.70.0000.00817.07
8.0.60.0050.00216.97
8.0.50.0000.00716.95
8.0.30.0150.01017.16
8.0.20.0090.01317.40
8.0.10.0040.00417.04
8.0.00.0100.00816.93
7.4.330.0000.00515.13
7.4.320.0040.00416.62
7.4.300.0030.00316.65
7.4.290.0060.00016.56
7.4.280.0000.00716.58
7.4.270.0000.00716.50
7.4.260.0070.00416.49
7.4.250.0030.00316.50
7.4.240.0020.00616.53
7.4.230.0000.00716.65
7.4.220.0110.00716.41
7.4.210.0100.00616.58
7.4.200.0040.00416.71
7.4.190.0030.00316.64
7.4.160.0080.00816.71
7.4.150.0100.00717.40
7.4.140.0090.00917.86
7.4.130.0100.01316.58
7.4.120.0100.00616.56
7.4.110.0100.00616.43
7.4.100.0140.00416.63
7.4.90.0110.00716.42
7.4.80.0130.00519.39
7.4.70.0150.00616.55
7.4.60.0090.00616.34
7.4.50.0090.00016.47
7.4.40.0060.00922.77
7.4.30.0120.00916.70
7.4.00.0060.01015.01
7.3.330.0050.00313.22
7.3.320.0000.00613.43
7.3.310.0000.00716.54
7.3.300.0000.00816.45
7.3.290.0090.00616.36
7.3.280.0100.00716.40
7.3.270.0120.00417.40
7.3.260.0030.01316.34
7.3.250.0060.01316.46
7.3.240.0150.00616.42
7.3.230.0130.00316.39
7.3.210.0030.01316.40
7.3.200.0190.00019.39
7.3.190.0120.00616.45
7.3.180.0060.01016.43
7.3.170.0130.00616.45
7.3.160.0060.01616.35
7.3.120.0080.01014.94
7.3.110.0070.01014.78
7.3.100.0030.00614.80
7.3.90.0000.01715.06
7.3.80.0070.01014.88
7.3.70.0080.01114.71
7.3.60.0030.01414.88
7.3.50.0060.01014.87
7.3.40.0030.01414.73
7.3.30.0100.00714.62
7.3.20.0040.01116.83
7.3.10.0060.00916.62
7.3.00.0060.00616.65
7.2.330.0140.00316.71
7.2.320.0120.01316.61
7.2.310.0110.00516.71
7.2.300.0060.01216.34
7.2.290.0060.01016.47
7.2.250.0040.01514.71
7.2.240.0060.00914.99
7.2.230.0060.01215.02
7.2.220.0030.01215.27
7.2.210.0070.00714.89
7.2.200.0070.01015.16
7.2.190.0060.01314.91
7.2.180.0090.00615.03
7.2.170.0040.00714.94
7.2.130.0050.01116.78
7.2.120.0110.00716.57
7.2.110.0040.01116.68
7.2.100.0040.00716.79
7.2.90.0070.00716.77
7.2.80.0080.00416.60
7.2.70.0000.01216.80
7.2.60.0040.00716.94
7.2.50.0070.00316.72
7.2.40.0070.01116.43
7.2.30.0150.01116.63
7.2.20.0180.00516.77
7.2.10.0110.01116.83
7.2.00.0060.00818.18
7.1.330.0080.00415.77
7.1.320.0040.01415.77
7.1.310.0000.01915.72
7.1.300.0060.01215.50
7.1.290.0120.00315.40
7.1.280.0090.00615.90
7.1.270.0030.00615.68
7.1.260.0030.00915.56
7.1.250.0100.00715.50
7.1.200.0060.00615.73
7.1.70.0030.00517.11
7.1.60.0080.00317.35
7.1.50.0060.01216.85
7.1.00.0070.07322.37
7.0.200.0080.00616.38
7.0.140.0030.07321.96
7.0.60.0100.05319.96
7.0.50.0030.05017.88
7.0.40.0070.04320.05
7.0.30.0330.07720.24
7.0.20.0330.06020.08
7.0.10.0030.08020.07
7.0.00.0100.03720.29
5.6.210.0100.07320.65
5.6.200.0070.08718.16
5.6.190.0100.04020.63
5.6.180.0130.07320.46
5.6.170.0230.05320.42
5.6.160.0070.08320.43
5.6.150.0000.05018.29
5.6.140.0000.05018.14
5.6.130.0030.04018.24
5.6.120.0130.07720.99
5.6.110.0070.05720.96
5.6.100.0170.07721.02
5.6.90.0100.06021.11
5.6.80.0070.05020.37
5.6.70.4170.03720.37
5.5.350.0200.09020.38
5.5.340.0070.07318.08
5.5.330.0000.05720.18
5.5.320.0230.04320.20
5.5.310.0270.05320.35
5.5.300.0100.03718.09
5.5.290.0100.07717.99
5.5.280.0070.04720.78
5.5.270.0070.08720.85
5.5.260.0030.05720.77
5.5.250.0230.06320.59
5.5.240.0370.06320.28
5.4.450.0700.05319.62
5.4.440.0830.05019.55
5.4.430.0770.05019.58
5.4.420.0100.06319.51
5.4.410.0200.06019.57
5.4.400.0230.04319.09
5.4.390.0070.05719.03
5.4.380.0070.06719.07
5.4.370.0100.05719.08
5.4.360.0130.05019.07
5.4.350.0030.03712.03
5.4.340.0080.04012.02
5.4.320.0080.05012.50
5.4.310.0040.04012.50
5.4.300.0090.04212.51
5.4.290.0080.05112.50
5.4.280.0040.04812.40
5.4.270.0170.06318.99
5.4.260.0230.06719.01
5.4.250.0200.07018.94
5.4.240.0070.06018.78
5.4.230.0100.07018.65
5.4.220.0100.05719.02
5.4.210.0130.07018.76
5.4.200.0200.04318.82
5.4.190.0230.06318.95
5.4.180.0130.06018.89
5.4.170.0230.06018.73
5.4.160.0170.05318.92
5.4.150.0130.06718.91
5.4.140.0200.05316.45
5.4.130.0130.07016.44
5.4.120.0200.06016.60
5.4.110.0000.06716.43
5.4.100.0100.07016.56
5.4.90.0100.06016.47
5.4.80.0130.06316.39
5.4.70.0100.05016.68
5.4.60.0130.06716.30
5.4.50.0070.05716.52
5.4.40.0030.07016.46
5.4.30.0070.06316.62
5.4.20.0230.05316.37
5.4.10.0030.08016.45
5.4.00.0070.06715.99
5.3.290.0080.04012.80
5.3.280.0100.05714.43
5.3.270.0070.05314.52
5.3.260.0000.06714.69
5.3.250.0070.06014.63
5.3.240.0130.06014.63
5.3.230.0130.05314.69
5.3.220.0070.06014.80
5.3.210.0070.06014.57
5.3.200.0070.05714.55
5.3.190.0070.06714.58
5.3.180.0070.08014.75
5.3.170.0070.06314.63
5.3.160.0070.07314.55
5.3.150.0130.04714.57
5.3.140.0130.05014.55
5.3.130.0070.06014.70
5.3.120.0100.05314.57
5.3.110.0170.07014.63
5.3.100.0100.05714.26
5.3.90.0070.05314.01
5.3.80.0100.05014.13
5.3.70.0130.06014.04
5.3.60.0100.06314.09
5.3.50.0100.05713.92
5.3.40.0100.06014.03
5.3.30.0130.04713.99
5.3.20.0100.06713.77
5.3.10.0000.06013.62
5.3.00.0070.05713.63
5.2.170.0200.03711.23
5.2.160.0030.06311.22
5.2.150.0100.04711.37
5.2.140.0070.04711.22
5.2.130.0070.05011.19
5.2.120.0030.05711.03
5.2.110.0070.05311.18
5.2.100.0100.04011.19
5.2.90.0170.04711.18
5.2.80.0000.05711.17
5.2.70.0100.04711.18
5.2.60.0070.05311.04
5.2.50.0030.06311.19
5.2.40.0100.05011.09
5.2.30.0070.05710.80
5.2.20.0100.05311.12
5.2.10.0070.05311.09
5.2.00.0130.04710.72
5.1.60.0070.03310.06
5.1.50.0070.04310.10
5.1.40.0000.04010.06
5.1.30.0100.04710.32
5.1.20.0130.05010.44
5.1.10.0030.03310.11
5.1.00.0170.04010.01
5.0.50.0030.0308.56
5.0.40.0100.0278.46
5.0.30.0070.0538.29
5.0.20.0100.0308.18
5.0.10.0070.0378.25
5.0.00.0030.0508.14
4.4.90.0030.0276.10
4.4.80.0030.0206.10
4.4.70.0030.0236.10
4.4.60.0100.0176.10
4.4.50.0000.0236.10
4.4.40.0000.0406.10
4.4.30.0000.0306.10
4.4.20.0070.0306.10
4.4.10.0030.0306.10
4.4.00.0030.0406.10
4.3.110.0070.0236.10
4.3.100.0030.0206.10
4.3.90.0000.0306.10
4.3.80.0070.0306.10
4.3.70.0100.0236.10
4.3.60.0030.0306.10
4.3.50.0030.0306.10
4.3.40.0000.0436.10
4.3.30.0000.0306.10
4.3.20.0030.0306.10
4.3.10.0000.0306.10
4.3.00.0070.0277.13

preferences:
40.21 ms | 401 KiB | 5 Q