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 = array(function(){ echo $this->secret; }); // 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.0140.00718.56
8.3.50.0080.01321.33
8.3.40.0120.00318.69
8.3.30.0100.01020.23
8.3.20.0000.00720.09
8.3.10.0040.00422.02
8.3.00.0040.00422.32
8.2.180.0040.01118.18
8.2.170.0110.00322.96
8.2.160.0070.01020.38
8.2.150.0000.00824.18
8.2.140.0000.00924.66
8.2.130.0040.00426.16
8.2.120.0080.00021.02
8.2.110.0000.00820.29
8.2.100.0110.00417.97
8.2.90.0040.00419.21
8.2.80.0050.00319.28
8.2.70.0000.00817.63
8.2.60.0060.00318.04
8.2.50.0040.00418.07
8.2.40.0080.00018.34
8.2.30.0050.00218.15
8.2.20.0000.00717.67
8.2.10.0000.00817.95
8.2.00.0050.00317.70
8.1.280.0140.00425.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0060.00322.11
8.1.230.0080.00320.89
8.1.220.0070.00217.74
8.1.210.0000.00918.77
8.1.200.0060.00317.25
8.1.190.0030.00517.66
8.1.180.0050.00320.21
8.1.170.0030.00518.60
8.1.160.0050.00222.16
8.1.150.0000.00718.65
8.1.140.0040.00417.48
8.1.130.0030.00617.88
8.1.120.0000.00717.50
8.1.110.0040.00417.50
8.1.100.0050.00317.51
8.1.90.0070.00017.49
8.1.80.0040.00417.46
8.1.70.0040.00417.44
8.1.60.0050.00317.55
8.1.50.0030.00617.44
8.1.40.0040.00417.40
8.1.30.0040.00417.66
8.1.20.0030.00617.66
8.1.10.0080.00017.62
8.1.00.0040.00717.43
8.0.300.0040.00418.77
8.0.290.0040.00417.03
8.0.280.0030.00318.46
8.0.270.0030.00317.28
8.0.260.0060.00016.89
8.0.250.0060.00016.96
8.0.240.0060.00516.96
8.0.230.0030.00317.04
8.0.220.0070.00016.97
8.0.210.0030.00516.87
8.0.200.0060.00016.98
8.0.190.0040.00417.06
8.0.180.0050.00317.02
8.0.170.0030.00516.84
8.0.160.0040.00417.09
8.0.150.0040.00416.86
8.0.140.0040.00416.89
8.0.130.0060.00013.26
8.0.120.0040.00416.86
8.0.110.0000.00716.95
8.0.100.0000.00816.98
8.0.90.0000.00716.86
8.0.80.0060.00916.97
8.0.70.0040.00416.75
8.0.60.0070.00016.82
8.0.50.0000.00716.91
8.0.30.0080.01516.98
8.0.20.0080.01417.40
8.0.10.0000.00916.86
8.0.00.0120.00816.81
7.4.330.0000.00515.00
7.4.320.0000.00716.59
7.4.300.0000.00716.61
7.4.290.0000.00716.52
7.4.280.0070.00016.59
7.4.270.0030.00316.51
7.4.260.0030.00316.42
7.4.250.0000.00716.57
7.4.240.0040.00416.49
7.4.230.0040.00316.64
7.4.220.0120.00616.45
7.4.210.0100.00716.51
7.4.200.0040.00416.50
7.4.190.0000.00716.56
7.4.160.0160.00416.70
7.4.150.0070.01017.40
7.4.140.0150.00717.86
7.4.130.0090.00816.54
7.4.120.0140.00616.72
7.4.110.0100.00716.59
7.4.100.0150.00316.43
7.4.90.0040.01416.56
7.4.80.0160.00619.39
7.4.70.0090.00916.57
7.4.60.0110.00516.59
7.4.50.0000.00816.41
7.4.40.0110.00622.77
7.4.30.0070.01016.64
7.4.10.0100.00715.26
7.4.00.0110.00615.00
7.3.330.0050.00013.45
7.3.320.0050.00013.29
7.3.310.0070.00016.38
7.3.300.0000.00616.29
7.3.290.0060.01016.32
7.3.280.0050.01216.37
7.3.270.0100.00717.40
7.3.260.0130.01016.64
7.3.250.0080.01116.39
7.3.240.0030.01416.44
7.3.230.0100.00716.55
7.3.210.0100.00616.64
7.3.200.0060.00919.39
7.3.190.0090.00916.50
7.3.180.0100.00716.54
7.3.170.0100.00716.69
7.3.160.0100.00716.39
7.3.130.0100.01014.79
7.3.120.0040.01214.97
7.3.110.0060.01214.97
7.3.100.0070.00714.91
7.3.90.0030.01615.03
7.3.80.0030.01314.81
7.3.70.0150.00314.99
7.3.60.0070.01015.02
7.3.50.0060.01014.61
7.3.40.0030.01014.71
7.3.30.0040.01414.96
7.3.20.0110.00416.71
7.3.10.0050.00516.69
7.3.00.0030.01116.49
7.2.330.0060.01716.46
7.2.320.0080.00816.42
7.2.310.0150.00916.86
7.2.300.0070.01016.80
7.2.290.0070.01016.64
7.2.260.0060.01214.93
7.2.250.0060.01015.20
7.2.240.0090.00615.21
7.2.230.0100.00714.96
7.2.220.0070.01415.23
7.2.210.0000.00915.11
7.2.200.0100.00715.04
7.2.190.0150.00314.92
7.2.180.0180.00015.00
7.2.170.0070.00714.88
7.2.160.0070.01115.12
7.2.150.0040.01416.89
7.2.140.0090.00317.06
7.2.130.0050.00816.86
7.2.120.0070.00417.00
7.2.110.0020.01116.77
7.2.100.0040.00916.98
7.2.90.0040.01217.01
7.2.80.0060.00916.98
7.2.70.0060.00917.06
7.2.60.0050.01016.78
7.2.50.0030.01116.90
7.2.40.0050.00917.06
7.2.30.0030.00716.81
7.2.20.0050.00816.90
7.2.10.0060.00916.96
7.2.00.0070.00917.82
7.1.330.0150.00015.76
7.1.320.0090.00615.70
7.1.310.0060.00615.65
7.1.300.0110.00415.78
7.1.290.0040.00415.57
7.1.280.0060.01315.64
7.1.270.0060.01015.87
7.1.260.0030.01015.91
7.1.250.0110.00515.69
7.1.240.0030.01015.63
7.1.230.0040.00715.71
7.1.220.0040.01115.55
7.1.210.0040.00815.74
7.1.200.0070.00615.71
7.1.190.0000.00915.85
7.1.180.0000.01515.42
7.1.170.0000.01815.62
7.1.160.0030.00915.65
7.1.150.0000.01115.82
7.1.140.0070.00415.76
7.1.130.0060.00915.91
7.1.120.0060.00915.77
7.1.110.0110.00315.62
7.1.100.0000.01515.91
7.1.90.0050.00315.89
7.1.80.0030.00915.64
7.1.70.0060.00616.29
7.1.60.0090.00416.46
7.1.50.0140.01525.22
7.1.40.0080.00615.57
7.1.30.0030.01415.75
7.1.20.0060.00615.79
7.1.10.0030.01015.69
7.1.00.0050.01919.09
7.0.330.0060.00915.62
7.0.320.0040.00715.63
7.0.310.0070.00415.42
7.0.300.0040.00815.45
7.0.290.0070.00715.48
7.0.280.0090.00415.36
7.0.270.0040.00415.44
7.0.260.0040.00815.46
7.0.250.0040.00415.57
7.0.240.0040.00715.38
7.0.230.0070.00315.60
7.0.220.0090.00915.23
7.0.210.0100.01015.48
7.0.200.0070.00915.94
7.0.190.0000.01115.55
7.0.180.0030.01015.58
7.0.170.0060.00915.60
7.0.160.0030.01015.31
7.0.150.0100.00315.46
7.0.140.0030.04218.76
7.0.130.0030.01015.22
7.0.120.0040.00415.48
7.0.110.0000.01315.34
7.0.100.0070.03717.78
7.0.90.0050.02417.75
7.0.80.0050.02517.75
7.0.70.0070.02217.67
7.0.60.0080.02517.68
7.0.50.0050.02417.96
7.0.40.0030.04416.73
7.0.30.0030.02916.86
7.0.20.0030.04916.80
7.0.10.0050.02216.77
7.0.00.0020.02916.80
5.6.400.0040.00814.58
5.6.390.0090.00614.21
5.6.380.0030.01214.60
5.6.370.0060.00314.41
5.6.360.0110.00714.60
5.6.350.0030.01014.10
5.6.340.0030.01014.26
5.6.330.0040.01214.38
5.6.320.0040.00414.54
5.6.310.0080.00314.08
5.6.300.0030.01014.15
5.6.290.0030.00914.43
5.6.280.0020.04317.73
5.6.270.0070.00714.46
5.6.260.0000.01314.35
5.6.250.0030.02517.46
5.6.240.0030.02517.56
5.6.230.0060.02117.65
5.6.220.0080.02717.35
5.6.210.0090.02117.62
5.6.200.0070.03617.62
5.6.190.0040.02517.88
5.6.180.0070.03517.73
5.6.170.0020.03317.60
5.6.160.0090.02917.86
5.6.150.0050.02317.75
5.6.140.0000.03317.61
5.6.130.0070.02117.69
5.6.120.0030.02617.76
5.6.110.0020.03017.80
5.6.100.0030.02817.65
5.6.90.0050.03117.74
5.6.80.0100.01817.56
5.6.70.0070.01817.42
5.6.60.0050.02617.32
5.6.50.0070.02117.32
5.6.40.0030.02317.39
5.6.30.0060.02517.32
5.6.20.0020.02517.42
5.6.10.0070.02117.26
5.6.00.0010.02617.39
5.5.380.0100.04317.28
5.5.370.0100.03217.42
5.5.360.0030.02717.30
5.5.350.0050.02617.38
5.5.340.0120.01817.54
5.5.330.0040.04917.70
5.5.320.0070.03417.55
5.5.310.0030.02317.55
5.5.300.0100.02017.47
5.5.290.0060.02517.51
5.5.280.0080.02317.56
5.5.270.0040.02217.71
5.5.260.0020.03317.66
5.5.250.0080.02317.34
5.5.240.0000.03517.17
5.5.230.0020.02317.37
5.5.220.0050.02517.28
5.5.210.0030.03517.05
5.5.200.0030.02317.27
5.5.190.0050.02717.34
5.5.180.0040.02317.15
5.5.170.0030.01314.07
5.5.160.0070.02217.26
5.5.150.0050.03317.11
5.5.140.0050.04217.19
5.5.130.0080.04017.19
5.5.120.0030.03817.28
5.5.110.0050.04417.30
5.5.100.0050.03517.14
5.5.90.0080.04016.99
5.5.80.0070.04117.13
5.5.70.0110.04217.10
5.5.60.0070.04517.18
5.5.50.0120.03917.27
5.5.40.0050.04717.22
5.5.30.0100.04017.33
5.5.20.0070.05117.24
5.5.10.0030.04017.13
5.5.00.0060.04116.97
5.4.450.0000.02615.23
5.4.440.0020.02415.17
5.4.430.0020.02515.23
5.4.420.0020.03315.22
5.4.410.0050.02815.27
5.4.400.0050.02015.02
5.4.390.0050.03515.02
5.4.380.0080.02015.09
5.4.370.0030.02014.88
5.4.360.0090.02014.95
5.4.350.0070.01715.07
5.4.340.0030.02315.10
5.4.330.0040.00810.82
5.4.320.0040.02215.04
5.4.310.0030.02315.17
5.4.300.0050.04215.13
5.4.290.0070.02315.02
5.4.280.0070.03415.21
5.4.270.0140.03314.94
5.4.260.0130.03215.04
5.4.250.0030.04014.87
5.4.240.0070.02515.08
5.4.230.0030.02515.15
5.4.220.0130.03215.20
5.4.210.0120.03715.04
5.4.200.0030.04015.00
5.4.190.0100.03815.18
5.4.180.0070.03914.82
5.4.170.0050.04514.94
5.4.160.0100.03315.15
5.4.150.0090.04115.18
5.4.140.0070.04213.67
5.4.130.0030.04213.76
5.4.120.0070.03913.86
5.4.110.0100.03513.64
5.4.100.0060.03513.89
5.4.90.0030.04113.79
5.4.80.0060.04013.73
5.4.70.0050.04313.73
5.4.60.0120.03313.82
5.4.50.0060.04013.83
5.4.40.0070.04013.91
5.4.30.0050.03813.80
5.4.20.0050.03913.82
5.4.10.0080.03913.82
5.4.00.0030.04013.54
5.3.290.0060.01712.66
5.3.280.0050.02712.65
5.3.270.0070.03812.73
5.3.260.0060.02312.67
5.3.250.0050.04212.58
5.3.240.0020.02412.53
5.3.230.0030.04412.66
5.3.220.0040.04212.57
5.3.210.0010.04512.63
5.3.200.0070.03112.62
5.3.190.0100.04012.60
5.3.180.0060.03812.58
5.3.170.0030.04412.66
5.3.160.0090.03712.63
5.3.150.0120.03512.68
5.3.140.0070.03912.67
5.3.130.0030.04312.58
5.3.120.0020.04512.51
5.3.110.0030.03712.55
5.3.100.0070.02712.20
5.3.90.0040.04512.34
5.3.80.0090.03712.30
5.3.70.0080.03712.32
5.3.60.0020.04312.34
5.3.50.0020.03712.42
5.3.40.0050.04012.32
5.3.30.0040.04112.17
5.3.20.0070.02612.08
5.3.10.0030.03811.98
5.3.00.0030.02511.96
5.2.170.0030.06011.04
5.2.160.0130.05011.26
5.2.150.0030.06311.18
5.2.140.0100.05311.15
5.2.130.0030.05311.24
5.2.120.0100.04011.17
5.2.110.0030.05711.23
5.2.100.0100.05311.13
5.2.90.0130.05311.20
5.2.80.0130.05711.08
5.2.70.0030.06011.09
5.2.60.0100.06011.08
5.2.50.0030.03711.02
5.2.40.0030.06310.89
5.2.30.0100.05710.97
5.2.20.0100.06011.03
5.2.10.0000.03710.98
5.2.00.0070.06010.65
5.1.60.0170.04310.07
5.1.50.0070.04310.06
5.1.40.0070.0209.83
5.1.30.0130.04010.28
5.1.20.0030.05710.22
5.1.10.0000.0609.91
5.1.00.0130.04710.11
5.0.50.0000.0508.98
5.0.40.0100.0278.98
5.0.30.0070.0438.98
5.0.20.0070.0408.98
5.0.10.0030.0478.98
5.0.00.0070.0508.98
4.4.90.0000.0208.98
4.4.80.0070.0308.98
4.4.70.0070.0178.98
4.4.60.0070.0238.98
4.4.50.0000.0208.98
4.4.40.0000.0508.98
4.4.30.0030.0338.98
4.4.20.0000.0238.98
4.4.10.0000.0378.98
4.4.00.0030.0478.98
4.3.110.0030.0178.98
4.3.100.0030.0338.98
4.3.90.0070.0308.98
4.3.80.0030.0408.98
4.3.70.0100.0208.98
4.3.60.0070.0238.98
4.3.50.0030.0338.98
4.3.40.0070.0438.98
4.3.30.0000.0338.98
4.3.20.0000.0378.98
4.3.10.0030.0378.98
4.3.00.0030.0278.98

preferences:
49.46 ms | 401 KiB | 5 Q