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->foo = function (){ return function(){ return "Foo"; }; }; // 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.0130.00618.52
8.3.50.0080.01221.20
8.3.40.0140.00718.84
8.3.30.0070.00720.33
8.3.20.0050.00220.16
8.3.10.0040.00422.09
8.3.00.0040.00422.40
8.2.180.0070.01716.60
8.2.170.0120.00322.96
8.2.160.0030.01020.34
8.2.150.0080.00024.18
8.2.140.0030.00624.66
8.2.130.0080.00026.16
8.2.120.0000.00819.52
8.2.110.0060.00922.26
8.2.100.0110.00019.19
8.2.90.0080.00019.21
8.2.80.0000.00819.43
8.2.70.0040.00417.63
8.2.60.0060.00517.85
8.2.50.0050.00318.07
8.2.40.0050.00318.22
8.2.30.0030.00518.10
8.2.20.0030.00517.74
8.2.10.0040.00417.71
8.2.00.0050.00317.73
8.1.280.0030.01725.92
8.1.270.0050.00224.66
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0090.00023.92
8.1.230.0080.00319.25
8.1.220.0000.00917.79
8.1.210.0060.00318.77
8.1.200.0030.00717.35
8.1.190.0040.00417.66
8.1.180.0000.00820.16
8.1.170.0030.00618.43
8.1.160.0000.00722.07
8.1.150.0080.00018.66
8.1.140.0040.00417.48
8.1.130.0090.00017.89
8.1.120.0000.00717.53
8.1.110.0030.00617.46
8.1.100.0000.00717.36
8.1.90.0030.00317.51
8.1.80.0050.00317.43
8.1.70.0000.00817.41
8.1.60.0000.00917.44
8.1.50.0030.00617.54
8.1.40.0000.00817.52
8.1.30.0040.00417.58
8.1.20.0080.00017.61
8.1.10.0030.00617.59
8.1.00.0030.00717.54
8.0.300.0000.00818.77
8.0.290.0040.00417.18
8.0.280.0040.00418.32
8.0.270.0030.00317.21
8.0.260.0060.00016.73
8.0.250.0000.00716.95
8.0.240.0030.00816.96
8.0.230.0000.00716.97
8.0.220.0040.00416.79
8.0.210.0070.00016.84
8.0.200.0000.00617.01
8.0.190.0020.00516.92
8.0.180.0110.00017.01
8.0.170.0040.00417.00
8.0.160.0070.00017.08
8.0.150.0000.00717.01
8.0.140.0050.00316.79
8.0.130.0050.00013.49
8.0.120.0070.00316.82
8.0.110.0040.00416.85
8.0.100.0080.00016.85
8.0.90.0070.00016.77
8.0.80.0050.01216.91
8.0.70.0000.00716.99
8.0.60.0000.00716.93
8.0.50.0040.00416.79
8.0.30.0110.00817.24
8.0.20.0080.01017.40
8.0.10.0000.00716.99
8.0.00.0100.01016.62
7.4.330.0000.00515.00
7.4.320.0060.00016.62
7.4.300.0030.00316.57
7.4.290.0000.00716.47
7.4.280.0040.00416.59
7.4.270.0040.00416.59
7.4.260.0030.00316.50
7.4.250.0030.00516.59
7.4.240.0040.00316.58
7.4.230.0000.00816.42
7.4.220.0060.00916.60
7.4.210.0070.00816.63
7.4.200.0030.00316.60
7.4.190.0070.00016.76
7.4.160.0060.01416.54
7.4.150.0140.01017.40
7.4.140.0120.00717.86
7.4.130.0110.00616.67
7.4.120.0090.00716.51
7.4.110.0100.00716.45
7.4.100.0110.00816.61
7.4.90.0100.01316.44
7.4.80.0100.01319.39
7.4.70.0100.01016.62
7.4.60.0070.01016.61
7.4.50.0040.00416.33
7.4.40.0090.00622.77
7.4.30.0120.01216.60
7.4.00.0100.00315.01
7.3.330.0060.00013.19
7.3.320.0000.00513.32
7.3.310.0030.00316.41
7.3.300.0000.00716.20
7.3.290.0160.00416.36
7.3.280.0070.01016.42
7.3.270.0100.00717.40
7.3.260.0120.01216.35
7.3.250.0160.00316.56
7.3.240.0120.00616.37
7.3.230.0130.00716.39
7.3.210.0130.01016.32
7.3.200.0100.01019.39
7.3.190.0110.01116.64
7.3.180.0120.00416.43
7.3.170.0090.00616.34
7.3.160.0110.00516.44
7.3.120.0060.01014.86
7.3.110.0040.01114.81
7.3.100.0060.00614.92
7.3.90.0070.01014.88
7.3.80.0060.00614.90
7.3.70.0000.01714.80
7.3.60.0030.01414.55
7.3.50.0030.00914.80
7.3.40.0000.01314.89
7.3.30.0110.00414.77
7.3.20.0040.01216.61
7.3.10.0050.01016.77
7.3.00.0070.00816.70
7.2.330.0070.01016.78
7.2.320.0080.00816.71
7.2.310.0070.01116.71
7.2.300.0100.01016.81
7.2.290.0070.01016.77
7.2.240.0040.00815.29
7.2.230.0030.01315.07
7.2.220.0000.00915.15
7.2.210.0070.00715.26
7.2.200.0040.01414.73
7.2.190.0080.00815.00
7.2.180.0070.00714.68
7.2.170.0070.01014.89
7.2.160.0070.00715.11
7.2.150.0060.00916.96
7.2.140.0070.01017.09
7.2.130.0080.00516.91
7.2.120.0030.01216.96
7.2.110.0050.00816.88
7.2.100.0030.01016.80
7.2.90.0030.01317.01
7.2.80.0060.01017.07
7.2.70.0110.00616.95
7.2.60.0050.00816.74
7.2.50.0050.01217.01
7.2.40.0050.01017.00
7.2.30.0070.00616.78
7.2.20.0070.00916.63
7.2.10.0050.01116.88
7.2.00.0030.01017.72
7.1.330.0070.00715.64
7.1.320.0040.01215.61
7.1.310.0070.00715.81
7.1.300.0040.01115.89
7.1.290.0030.01315.52
7.1.280.0030.00715.76
7.1.270.0070.00415.78
7.1.260.0040.01215.86
7.1.250.0090.00315.60
7.1.200.0040.00715.70
7.1.100.0000.01118.16
7.1.70.0040.01117.32
7.1.60.0140.01019.21
7.1.50.0100.01316.89
7.1.00.0070.06722.34
7.0.200.0290.00614.66
7.0.140.0070.07322.00
7.0.110.0570.06720.01
7.0.100.0500.08019.99
7.0.90.0400.08719.91
7.0.80.0600.07720.04
7.0.70.0570.07019.91
7.0.60.0570.07320.08
7.0.50.0500.05020.34
7.0.40.0100.04720.27
7.0.30.0070.04020.02
7.0.20.0100.07320.10
7.0.10.0130.07320.18
7.0.00.0170.07720.24
5.6.280.0070.07021.11
5.6.260.0100.08020.76
5.6.250.0130.07720.70
5.6.240.0000.09020.56
5.6.230.0100.07720.55
5.6.220.0130.08020.70
5.6.210.0100.07020.82
5.6.200.0070.08720.96
5.6.190.0070.04321.14
5.6.180.0000.07021.04
5.6.170.0000.08721.11
5.6.160.0100.08021.06
5.6.150.0070.08021.26
5.6.140.0070.08021.02
5.6.130.0030.09321.14
5.6.120.0130.07721.03
5.6.110.0070.08020.94
5.6.100.0130.05021.22
5.6.90.0070.09021.02
5.6.80.0030.08320.45
5.6.70.0070.07720.61
5.6.60.0200.06720.57
5.6.50.0200.06320.58
5.6.40.0130.07720.51
5.6.30.0130.07320.59
5.6.20.0070.04720.29
5.6.10.0030.08320.51
5.6.00.0100.07720.54
5.5.380.0170.07720.36
5.5.370.0100.07720.34
5.5.360.0000.08720.54
5.5.350.0070.08020.50
5.5.340.0030.08020.83
5.5.330.0130.07720.83
5.5.320.0100.07721.04
5.5.310.0130.07720.86
5.5.300.0170.07020.96
5.5.290.0100.07321.02
5.5.280.0100.08320.98
5.5.270.0070.08721.04
5.5.260.0030.08020.95
5.5.250.0100.07020.77
5.5.240.0070.07720.09
5.5.230.0130.07320.20
5.5.220.0100.07320.36
5.5.210.0170.05320.29
5.5.200.0030.08020.25
5.5.190.0100.04020.31
5.5.180.0070.08020.35
5.5.160.0100.07020.21
5.5.150.0170.06720.17
5.5.140.0070.07320.30
5.5.130.0100.07320.10
5.5.120.0000.05320.12
5.5.110.0170.07320.32
5.5.100.0130.04320.25
5.5.90.0100.07320.06
5.5.80.0070.08320.20
5.5.70.0130.07320.17
5.5.60.0070.08020.25
5.5.50.0070.05720.25
5.5.40.0070.07320.21
5.5.30.0130.05020.17
5.5.20.0130.07320.27
5.5.10.0070.07020.04
5.5.00.0000.09020.23
5.4.450.0100.06319.51
5.4.440.0070.08319.31
5.4.430.0030.07019.66
5.4.420.0070.08019.41
5.4.410.0030.08019.23
5.4.400.0100.07319.34
5.4.390.0030.08319.32
5.4.380.0030.05018.99
5.4.370.0070.04019.18
5.4.360.0070.08319.19
5.4.350.0030.08018.95
5.4.340.0000.08719.31
5.4.320.0030.04719.00
5.4.310.0130.06319.01
5.4.300.0070.05019.00
5.4.290.0170.06719.01
5.4.280.0070.05319.16
5.4.270.0030.08019.31
5.4.260.0070.08019.23
5.4.250.0070.07319.16
5.4.240.0030.07319.01
5.4.230.0030.07719.33
5.4.220.0200.06019.01
5.4.210.0030.08019.00
5.4.200.0100.07319.21
5.4.190.0200.06019.14
5.4.180.0130.07019.23
5.4.170.0070.07319.13
5.4.160.0100.07719.01
5.4.150.0030.08319.14
5.4.140.0130.06716.35
5.4.130.0030.07316.42
5.4.120.0170.06016.51
5.4.110.0070.07016.53
5.4.100.0000.07716.37
5.4.90.0100.07016.68
5.4.80.0000.07716.31
5.4.70.0030.04016.41
5.4.60.0100.06716.45
5.4.50.0070.07316.52
5.4.40.0000.07716.62
5.4.30.0000.05316.40
5.4.20.0030.08016.56
5.4.10.0070.07016.54
5.4.00.0030.07315.80
5.3.290.0070.07314.64
5.3.280.0170.04314.62
5.3.270.0230.05314.61
5.3.260.0130.07314.86
5.3.250.0070.05314.69
5.3.240.0030.07314.59
5.3.230.0100.04314.63
5.3.220.0070.06314.59
5.3.210.0100.07314.55
5.3.200.0100.07714.70
5.3.190.0100.04014.55
5.3.180.0030.08014.59
5.3.170.0000.07014.53
5.3.160.0130.06314.80
5.3.150.0170.06314.61
5.3.140.0070.07714.57
5.3.130.0070.06014.63
5.3.120.0130.07714.52
5.3.110.0070.07314.55
5.3.100.0030.07314.15
5.3.90.0100.07014.07
5.3.80.0070.07714.02
5.3.70.0000.08014.02
5.3.60.0070.07014.00
5.3.50.0070.07013.82
5.3.40.0000.08013.98
5.3.30.0170.06013.93
5.3.20.0070.07313.68
5.3.10.0070.06713.64
5.3.00.0000.08013.75
5.2.170.0070.06013.25
5.2.160.0000.06713.25
5.2.150.0070.02713.25
5.2.140.0030.06313.25
5.2.130.0070.06013.25
5.2.120.0100.02713.25
5.2.110.0030.06713.25
5.2.100.0100.06013.25
5.2.90.0070.06313.25
5.2.80.0070.03313.25
5.2.70.0100.05713.25
5.2.60.0030.06313.25
5.2.50.0070.05713.25
5.2.40.0070.06313.25
5.2.30.0170.05013.25
5.2.20.0030.05713.25
5.2.10.0000.06013.25
5.2.00.0030.06313.25
5.1.60.0100.04313.25
5.1.50.0030.05713.25
5.1.40.0070.04313.25
5.1.30.0030.05013.25
5.1.20.0070.05313.25
5.1.10.0070.05713.25
5.1.00.0070.05313.25
5.0.50.0100.04013.25
5.0.40.0000.04713.25
5.0.30.0070.06013.25
5.0.20.0070.04013.25
5.0.10.0030.04313.25
5.0.00.0030.07013.25
4.4.90.0000.04013.25
4.4.80.0070.03313.25
4.4.70.0030.03713.25
4.4.60.0070.03013.25
4.4.50.0070.03313.25
4.4.40.0000.05313.25
4.4.30.0030.02713.25
4.4.20.0030.03713.25
4.4.10.0000.03713.25
4.4.00.0030.05313.25
4.3.110.0100.03013.25
4.3.100.0030.03313.25
4.3.90.0030.03313.25
4.3.80.0070.05013.25
4.3.70.0070.03313.25
4.3.60.0030.03313.25
4.3.50.0070.03013.25
4.3.40.0100.03313.25
4.3.30.0000.04013.25
4.3.20.0000.03713.25
4.3.10.0030.03013.25
4.3.00.0030.03313.25

preferences:
39.02 ms | 401 KiB | 5 Q