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 = "All your Base are Belong to us."; // 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.00416.63
8.3.50.0070.01018.39
8.3.40.0100.01318.76
8.3.30.0000.01518.92
8.3.20.0080.00018.90
8.3.10.0060.00320.52
8.3.00.0040.00419.51
8.2.180.0110.00325.92
8.2.170.0120.00918.91
8.2.160.0100.00322.96
8.2.150.0040.00425.66
8.2.140.0090.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00020.50
8.2.110.0040.00721.14
8.2.100.0040.00817.91
8.2.90.0060.00319.32
8.2.80.0040.00419.40
8.2.70.0050.00317.63
8.2.60.0000.00817.91
8.2.50.0030.00618.07
8.2.40.0000.00718.09
8.2.30.0040.00418.12
8.2.20.0030.00519.61
8.2.10.0040.00417.82
8.2.00.0040.00417.68
8.1.280.0100.01325.92
8.1.270.0070.00724.66
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0030.00622.59
8.1.230.0040.00821.04
8.1.220.0060.00317.79
8.1.210.0000.00920.75
8.1.200.0000.00917.35
8.1.190.0030.00617.43
8.1.180.0060.00318.10
8.1.170.0040.00418.81
8.1.160.0040.00418.84
8.1.150.0000.00818.63
8.1.140.0000.00717.41
8.1.130.0000.00817.36
8.1.120.0040.00417.42
8.1.110.0060.00317.38
8.1.100.0040.00417.48
8.1.90.0070.00017.42
8.1.80.0000.00917.35
8.1.70.0070.00017.32
8.1.60.0040.00417.63
8.1.50.0040.00417.46
8.1.40.0000.00817.44
8.1.30.0000.00817.70
8.1.20.0040.00417.73
8.1.10.0000.00817.61
8.1.00.0040.00417.41
8.0.300.0050.00319.98
8.0.290.0070.00016.63
8.0.280.0040.00418.32
8.0.270.0000.00716.79
8.0.260.0030.00516.71
8.0.250.0040.00416.93
8.0.240.0000.00816.89
8.0.230.0000.00716.86
8.0.220.0040.00416.89
8.0.210.0040.00416.91
8.0.200.0000.00716.95
8.0.190.0000.00716.98
8.0.180.0000.00716.90
8.0.170.0060.00316.80
8.0.160.0000.00716.93
8.0.150.0000.00816.94
8.0.140.0080.00016.76
8.0.130.0030.00313.34
8.0.120.0080.00016.80
8.0.110.0000.00716.92
8.0.100.0050.00216.74
8.0.90.0070.00016.95
8.0.80.0100.00616.88
8.0.70.0000.00717.03
8.0.60.0070.00016.89
8.0.50.0030.00617.02
8.0.30.0160.01017.34
8.0.20.0090.01117.07
8.0.10.0040.00416.92
8.0.00.0090.01116.79
7.4.330.0050.00012.93
7.4.320.0040.00416.47
7.4.300.0030.00316.52
7.4.290.0040.00416.56
7.4.280.0000.00816.60
7.4.270.0050.00316.66
7.4.260.0030.00313.30
7.4.250.0000.00916.61
7.4.240.0020.00516.64
7.4.230.0000.00716.68
7.4.220.0060.01316.43
7.4.210.0070.00816.55
7.4.200.0000.00716.40
7.4.190.0000.00716.41
7.4.160.0000.01616.44
7.4.150.0120.00916.48
7.4.140.0080.01016.57
7.4.130.0100.00816.58
7.4.120.0110.00516.64
7.4.110.0060.01016.36
7.4.100.0090.00916.50
7.4.90.0000.01716.47
7.4.80.0100.00616.52
7.4.70.0120.01016.63
7.4.60.0090.00616.38
7.4.50.0070.00316.61
7.4.40.0040.01016.17
7.4.30.0070.01316.66
7.4.00.0110.00614.87
7.3.330.0000.00713.46
7.3.320.0000.00613.37
7.3.310.0030.00316.24
7.3.300.0000.00716.42
7.3.290.0150.00016.39
7.3.280.0130.00416.35
7.3.270.0090.00916.41
7.3.260.0140.01016.46
7.3.250.0090.00916.35
7.3.240.0080.00816.36
7.3.230.0110.00516.53
7.3.210.0130.00416.46
7.3.200.0090.01719.39
7.3.190.0030.01616.48
7.3.180.0110.00516.64
7.3.170.0140.00716.34
7.3.160.0110.00616.39
7.3.120.0030.01414.80
7.3.110.0070.01014.66
7.3.100.0070.01314.75
7.3.90.0030.01014.52
7.3.80.0030.00614.88
7.3.70.0100.00714.89
7.3.60.0060.01014.64
7.3.50.0030.01414.95
7.3.40.0060.00314.88
7.3.30.0040.01114.76
7.3.20.0130.00316.67
7.3.10.0090.00916.76
7.3.00.0000.01416.61
7.2.330.0120.00616.47
7.2.320.0080.01416.70
7.2.310.0170.01316.45
7.2.300.0100.00716.64
7.2.290.0100.00716.73
7.2.250.0120.00914.88
7.2.240.0100.01015.08
7.2.230.0040.00815.09
7.2.220.0060.00614.76
7.2.210.0070.00714.88
7.2.200.0040.01215.13
7.2.190.0110.00615.17
7.2.180.0070.00315.02
7.2.170.0050.00515.07
7.2.160.0090.00315.09
7.2.150.0070.01016.59
7.2.140.0040.01516.93
7.2.130.0060.00916.68
7.2.120.0040.01116.94
7.2.110.0100.00716.85
7.2.100.0040.01016.80
7.2.90.0070.00716.79
7.2.80.0030.00616.63
7.2.70.0060.00616.95
7.2.60.0050.01017.01
7.2.50.0030.01016.95
7.2.40.0110.00416.89
7.2.30.0100.00716.93
7.2.20.0000.01316.88
7.2.10.0030.00816.64
7.2.00.0000.01018.19
7.1.330.0030.01515.79
7.1.320.0060.01015.80
7.1.310.0060.00615.84
7.1.300.0030.01015.70
7.1.290.0030.00615.77
7.1.280.0030.00715.83
7.1.270.0040.01115.77
7.1.260.0000.01215.83
7.1.250.0000.01515.61
7.1.240.0070.00715.80
7.1.230.0130.00315.69
7.1.220.0100.00315.88
7.1.210.0070.00715.58
7.1.200.0050.00515.64
7.1.190.0030.00915.79
7.1.180.0030.00615.59
7.1.170.0040.00815.46
7.1.160.0040.00415.61
7.1.150.0040.01215.87
7.1.140.0000.00815.84
7.1.130.0030.01015.88
7.1.120.0140.00015.70
7.1.110.0000.01315.62
7.1.100.0060.00916.95
7.1.90.0030.01015.93
7.1.80.0060.00615.90
7.1.70.0020.01216.56
7.1.60.0080.00817.56
7.1.50.0080.00716.39
7.1.40.0070.00315.88
7.1.30.0030.00615.77
7.1.20.0000.01315.59
7.1.10.0100.00715.55
7.1.00.0050.02719.12
7.0.330.0000.00915.49
7.0.320.0090.00315.40
7.0.310.0070.00715.39
7.0.300.0030.00615.44
7.0.290.0030.01015.30
7.0.280.0110.00715.45
7.0.270.0060.00915.32
7.0.260.0070.00315.23
7.0.250.0140.00015.07
7.0.240.0030.00715.56
7.0.230.0000.01115.55
7.0.220.0060.00315.55
7.0.210.0100.00315.50
7.0.200.0120.00815.77
7.0.190.0080.00815.27
7.0.180.0070.00715.38
7.0.170.0030.01015.29
7.0.160.0040.00715.36
7.0.150.0110.00315.35
7.0.140.0110.03518.77
7.0.130.0030.00815.13
7.0.120.0080.03518.79
7.0.110.0090.00315.47
7.0.100.0030.01215.42
7.0.90.0050.00315.47
7.0.80.0000.00815.14
7.0.70.0080.00415.27
7.0.60.0080.02817.78
7.0.50.0090.02316.76
7.0.40.0050.04515.62
7.0.30.0050.03815.57
7.0.20.0050.03515.63
7.0.10.0050.02515.43
7.0.00.0050.04215.48
5.6.400.0080.00414.30
5.6.390.0070.00714.70
5.6.380.0030.00514.14
5.6.370.0050.00314.23
5.6.360.0030.01014.39
5.6.350.0120.00314.21
5.6.340.0110.00714.32
5.6.330.0080.00014.29
5.6.320.0100.00714.46
5.6.310.0100.00014.54
5.6.300.0090.00614.23
5.6.290.0070.00414.43
5.6.280.0020.04317.65
5.6.270.0040.00814.27
5.6.260.0100.00614.18
5.6.250.0000.01514.47
5.6.240.0090.00614.28
5.6.230.0100.00714.38
5.6.220.0000.01514.68
5.6.210.0080.02217.30
5.6.200.0070.04516.21
5.6.190.0050.04316.19
5.6.180.0100.04116.35
5.6.170.0060.02416.40
5.6.160.0050.02816.30
5.6.150.0030.04016.15
5.6.140.0120.03816.31
5.6.130.0030.03716.14
5.6.120.0030.04216.37
5.6.110.0030.04016.25
5.6.100.0040.03916.31
5.6.90.0030.04716.30
5.6.80.0100.04015.92
5.6.70.0090.03015.96
5.6.60.0030.04016.07
5.6.50.0040.04615.91
5.6.40.0030.03515.94
5.6.30.0060.04115.87
5.6.20.0100.03315.86
5.6.10.0110.03215.96
5.6.00.0070.02815.93
5.5.380.0070.01014.34
5.5.370.0070.00313.98
5.5.360.0030.01013.98
5.5.350.0180.03317.41
5.5.340.0070.03316.14
5.5.330.0080.03816.10
5.5.320.0030.03015.97
5.5.310.0110.04116.27
5.5.300.0080.02616.02
5.5.290.0060.04216.20
5.5.280.0020.03616.13
5.5.270.0050.03116.15
5.5.260.0080.04216.27
5.5.250.0100.04315.93
5.5.240.0100.02815.90
5.5.230.0110.03515.88
5.5.220.0070.04215.68
5.5.210.0030.04615.63
5.5.200.0090.02615.70
5.5.190.0080.02515.81
5.5.180.0070.03815.66
5.5.170.0000.00914.04
5.5.160.0050.02515.74
5.5.150.0120.03715.72
5.5.140.0120.03715.84
5.5.130.0090.04215.72
5.5.120.0080.03515.62
5.5.110.0090.03915.67
5.5.100.0080.04015.73
5.5.90.0060.03115.71
5.5.80.0060.02315.64
5.5.70.0100.03715.57
5.5.60.0030.04415.80
5.5.50.0080.02115.78
5.5.40.0070.02615.68
5.5.30.0090.04115.68
5.5.20.0000.05115.63
5.5.10.0080.02715.79
5.5.00.0080.02215.79
5.4.450.0040.02915.14
5.4.440.0060.03915.43
5.4.430.0090.03715.17
5.4.420.0000.04514.95
5.4.410.0050.03815.01
5.4.400.0080.03815.05
5.4.390.0050.04114.97
5.4.380.0060.03315.10
5.4.370.0050.02815.12
5.4.360.0050.02815.02
5.4.350.0030.03215.16
5.4.340.0030.04214.88
5.4.330.0030.00311.05
5.4.320.0080.04214.99
5.4.310.0080.03814.93
5.4.300.0090.03514.99
5.4.290.0060.03114.98
5.4.280.0020.03015.08
5.4.270.0090.03714.97
5.4.260.0070.03615.06
5.4.250.0100.03714.97
5.4.240.0080.04215.11
5.4.230.0040.03515.12
5.4.220.0040.04114.99
5.4.210.0080.02714.87
5.4.200.0030.02514.92
5.4.190.0080.03815.16
5.4.180.0020.04114.89
5.4.170.0030.03815.07
5.4.160.0030.03614.96
5.4.150.0080.04014.97
5.4.140.0050.04113.67
5.4.130.0050.02013.74
5.4.120.0080.03613.73
5.4.110.0020.04413.50
5.4.100.0050.02413.56
5.4.90.0070.03313.72
5.4.80.0030.03913.73
5.4.70.0050.02713.64
5.4.60.0080.02613.53
5.4.50.0060.03613.52
5.4.40.0050.02213.63
5.4.30.0010.02113.70
5.4.20.0000.03313.67
5.4.10.0070.03313.73
5.4.00.0080.03413.32
5.3.290.0050.03212.68
5.3.280.0050.04012.68
5.3.270.0050.03412.67
5.3.260.0080.04012.51
5.3.250.0020.04512.60
5.3.240.0090.02412.42
5.3.230.0060.04012.45
5.3.220.0050.02612.52
5.3.210.0000.02712.51
5.3.200.0020.04412.55
5.3.190.0100.02012.56
5.3.180.0090.02212.71
5.3.170.0030.03612.54
5.3.160.0010.04412.65
5.3.150.0050.04012.74
5.3.140.0030.02812.56
5.3.130.0060.03912.60
5.3.120.0030.02812.43
5.3.110.0050.04012.47
5.3.100.0050.02212.29
5.3.90.0020.04312.34
5.3.80.0050.04012.21
5.3.70.0080.02712.28
5.3.60.0080.03612.17
5.3.50.0030.03112.19
5.3.40.0070.03912.29
5.3.30.0100.03312.22
5.3.20.0080.03612.11
5.3.10.0050.03711.99
5.3.00.0020.03812.02
5.2.170.0000.05311.05
5.2.160.0130.05311.12
5.2.150.0070.06311.19
5.2.140.0030.04711.17
5.2.130.0030.03711.15
5.2.120.0070.06311.21
5.2.110.0030.04311.12
5.2.100.0100.02311.32
5.2.90.0000.03311.17
5.2.80.0030.05011.11
5.2.70.0100.05711.06
5.2.60.0070.06011.10
5.2.50.0000.05310.87
5.2.40.0030.04011.06
5.2.30.0030.03310.97
5.2.20.0030.03711.02
5.2.10.0070.05710.91
5.2.00.0030.03010.82
5.1.60.0030.05710.07
5.1.50.0030.04710.05
5.1.40.0000.0579.98
5.1.30.0170.04710.32
5.1.20.0070.05010.20
5.1.10.0100.05010.17
5.1.00.0000.04010.13
5.0.50.0070.0178.67
5.0.40.0030.0338.47
5.0.30.0000.0338.22
5.0.20.0000.0308.41
5.0.10.0000.0478.00
5.0.00.0030.0508.08
4.4.90.0070.0337.87
4.4.80.0000.0237.87
4.4.70.0000.0407.87
4.4.60.0030.0237.87
4.4.50.0030.0177.87
4.4.40.0030.0537.87
4.4.30.0030.0377.87
4.4.20.0070.0237.87
4.4.10.0000.0177.87
4.4.00.0100.0507.87
4.3.110.0000.0207.87
4.3.100.0070.0237.87
4.3.90.0000.0237.87
4.3.80.0000.0307.87
4.3.70.0030.0207.87
4.3.60.0000.0207.87
4.3.50.0030.0137.87
4.3.40.0030.0307.87
4.3.30.0000.0177.87
4.3.20.0000.0377.87
4.3.10.0030.0237.87
4.3.00.0000.0377.87

preferences:
51.22 ms | 401 KiB | 5 Q