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->$callback = array('secret', 'it is a 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.70.0120.00316.63
8.3.60.0110.00718.43
8.3.50.0060.01221.21
8.3.40.0070.00718.79
8.3.30.0110.00320.38
8.3.20.0000.00720.29
8.3.10.0070.00021.90
8.3.00.0080.00022.33
8.2.180.0140.00025.92
8.2.170.0060.00918.94
8.2.160.0100.00322.96
8.2.150.0030.00625.66
8.2.140.0110.00724.66
8.2.130.0080.00026.16
8.2.120.0040.00419.41
8.2.110.0060.00320.93
8.2.100.0060.00617.63
8.2.90.0040.00419.05
8.2.80.0050.00317.97
8.2.70.0040.00417.63
8.2.60.0080.00017.92
8.2.50.0060.00318.07
8.2.40.0030.00618.20
8.2.30.0040.00418.12
8.2.20.0080.00017.77
8.2.10.0050.00217.82
8.2.00.0080.00017.72
8.1.280.0110.00425.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0000.01023.86
8.1.230.0000.01119.15
8.1.220.0080.00017.80
8.1.210.0000.00818.77
8.1.200.0030.00617.48
8.1.190.0040.00417.38
8.1.180.0040.00418.10
8.1.170.0000.00822.48
8.1.160.0040.00422.03
8.1.150.0030.00618.55
8.1.140.0040.00417.45
8.1.130.0000.01017.85
8.1.120.0050.00317.36
8.1.110.0030.00617.48
8.1.100.0040.00417.35
8.1.90.0050.00317.47
8.1.80.0040.00417.30
8.1.70.0040.00417.43
8.1.60.0030.00617.57
8.1.50.0040.00417.35
8.1.40.0050.00217.52
8.1.30.0070.00017.69
8.1.20.0040.00417.59
8.1.10.0050.00317.60
8.1.00.0030.00817.45
8.0.300.0000.00718.77
8.0.290.0050.00216.75
8.0.280.0000.00818.46
8.0.270.0070.00017.18
8.0.260.0030.00316.88
8.0.250.0030.00317.05
8.0.240.0030.00617.04
8.0.230.0000.00717.04
8.0.220.0050.00317.02
8.0.210.0000.00716.93
8.0.200.0000.00617.07
8.0.190.0070.00017.01
8.0.180.0040.00416.98
8.0.170.0030.00516.97
8.0.160.0080.00016.91
8.0.150.0050.00316.81
8.0.140.0040.00417.01
8.0.130.0050.00013.43
8.0.120.0030.00516.94
8.0.110.0040.00417.04
8.0.100.0070.00017.01
8.0.90.0030.00517.01
8.0.80.0060.01016.89
8.0.70.0050.00316.82
8.0.60.0040.00416.98
8.0.50.0050.00216.86
8.0.30.0140.00517.28
8.0.20.0080.01017.40
8.0.10.0000.00717.07
8.0.00.0090.01116.88
7.4.330.0000.00515.00
7.4.320.0060.00016.52
7.4.300.0000.00716.42
7.4.290.0030.00316.54
7.4.280.0040.00416.51
7.4.270.0030.00316.54
7.4.260.0000.00716.54
7.4.250.0000.00816.47
7.4.240.0030.00316.54
7.4.230.0070.00016.71
7.4.220.0090.00616.68
7.4.210.0070.00916.64
7.4.200.0040.00416.68
7.4.190.0000.00716.68
7.4.160.0090.00616.70
7.4.150.0060.01117.40
7.4.140.0100.00717.86
7.4.130.0110.00716.59
7.4.120.0110.00616.45
7.4.110.0110.00616.62
7.4.100.0160.00316.67
7.4.90.0000.01716.60
7.4.80.0090.00919.39
7.4.70.0110.00616.45
7.4.60.0140.00716.46
7.4.50.0000.00816.31
7.4.40.0040.01222.77
7.4.30.0130.00316.41
7.4.10.0070.01014.89
7.4.00.0030.01314.92
7.3.330.0000.00613.25
7.3.320.0050.00013.24
7.3.310.0050.00216.47
7.3.300.0000.00716.31
7.3.290.0070.01316.34
7.3.280.0110.00516.32
7.3.270.0030.01317.40
7.3.260.0130.01016.37
7.3.250.0080.01116.51
7.3.240.0140.00316.50
7.3.230.0120.00516.47
7.3.210.0120.00616.46
7.3.200.0060.01019.39
7.3.190.0140.00316.48
7.3.180.0030.01616.59
7.3.170.0120.00716.43
7.3.160.0150.00316.30
7.3.130.0060.00914.80
7.3.120.0020.01114.87
7.3.110.0120.00314.68
7.3.100.0050.01014.82
7.3.90.0040.01114.73
7.3.80.0050.01014.94
7.3.70.0050.01014.90
7.3.60.0050.01014.83
7.3.50.0050.00814.58
7.3.40.0060.00914.86
7.3.30.0040.01014.65
7.3.20.0050.00616.67
7.3.10.0030.01116.70
7.3.00.0050.00916.61
7.2.330.0110.00716.49
7.2.320.0140.00416.45
7.2.310.0030.01416.44
7.2.300.0030.01316.82
7.2.290.0060.01416.51
7.2.260.0130.00715.33
7.2.250.0080.00915.04
7.2.240.0070.01215.18
7.2.230.0070.00715.11
7.2.220.0050.01315.12
7.2.210.0040.01115.08
7.2.200.0070.00515.15
7.2.190.0030.00914.98
7.2.180.0080.00315.11
7.2.170.0030.01414.83
7.2.160.0030.01314.98
7.2.150.0070.00716.99
7.2.140.0080.00516.88
7.2.130.0090.00916.92
7.2.120.0030.00916.84
7.2.110.0070.00416.76
7.2.100.0070.00717.07
7.2.90.0060.00616.99
7.2.80.0090.00616.72
7.2.70.0040.01216.77
7.2.60.0070.00916.81
7.2.50.0140.00417.14
7.2.40.0000.01117.16
7.2.30.0070.01116.86
7.2.20.0030.00616.87
7.2.10.0060.00316.74
7.2.00.0030.01018.12
7.1.330.0030.01115.74
7.1.320.0060.01115.84
7.1.310.0070.00715.84
7.1.300.0080.00815.67
7.1.290.0020.01015.54
7.1.280.0050.00815.57
7.1.270.0070.00515.69
7.1.260.0040.00915.73
7.1.250.0100.00715.34
7.1.240.0000.00915.70
7.1.230.0000.01515.41
7.1.220.0060.00915.75
7.1.210.0030.01315.67
7.1.200.0070.00715.56
7.1.190.0060.00915.83
7.1.180.0030.01215.74
7.1.170.0110.00415.91
7.1.160.0040.01115.68
7.1.150.0040.00815.58
7.1.140.0030.01015.49
7.1.130.0030.00715.42
7.1.120.0000.00815.66
7.1.110.0070.00415.89
7.1.100.0070.00816.79
7.1.90.0080.00415.85
7.1.80.0040.00915.82
7.1.70.0060.00616.28
7.1.60.0030.00817.54
7.1.50.0100.00916.27
7.1.40.0090.00015.74
7.1.30.0000.01415.87
7.1.20.0060.00915.66
7.1.10.0030.00615.40
7.1.00.0050.02718.96
7.0.330.0040.00715.47
7.0.320.0040.01115.32
7.0.310.0030.01215.06
7.0.300.0050.00515.36
7.0.290.0070.00715.27
7.0.280.0040.00415.17
7.0.270.0040.00415.19
7.0.260.0000.01215.49
7.0.250.0030.00915.45
7.0.240.0000.01015.49
7.0.230.0000.01015.08
7.0.220.0030.01015.55
7.0.210.0080.00415.25
7.0.200.0160.00816.05
7.0.190.0030.00915.44
7.0.180.0100.00315.07
7.0.170.0070.00715.45
7.0.160.0070.00415.50
7.0.150.0030.00715.44
7.0.140.0050.03918.76
7.0.130.0070.00715.18
7.0.120.0030.00815.31
7.0.110.0100.00315.41
7.0.100.0110.00315.44
7.0.90.0030.00815.14
7.0.80.0040.00815.33
7.0.70.0070.01015.37
7.0.60.0040.04518.47
7.0.50.0090.04018.81
7.0.40.0020.04616.80
7.0.30.0080.03416.76
7.0.20.0060.03516.86
7.0.10.0040.04916.80
7.0.00.0090.04216.56
5.6.400.0110.00714.41
5.6.390.0040.00814.71
5.6.380.0070.01014.14
5.6.370.0110.00414.02
5.6.360.0030.00914.55
5.6.350.0040.00914.24
5.6.340.0030.00614.40
5.6.330.0030.00914.52
5.6.320.0090.00614.53
5.6.310.0090.00314.25
5.6.300.0030.00614.62
5.6.290.0040.01114.22
5.6.280.0040.03817.54
5.6.270.0030.00814.16
5.6.260.0030.00514.35
5.6.250.0000.01014.36
5.6.240.0040.00714.52
5.6.230.0070.00414.50
5.6.220.0060.00914.50
5.6.210.0070.04017.35
5.6.200.0050.04317.77
5.6.190.0040.04317.66
5.6.180.0050.02717.70
5.6.170.0050.04417.67
5.6.160.0020.05117.98
5.6.150.0030.04617.65
5.6.140.0020.04217.88
5.6.130.0070.04217.77
5.6.120.0090.04417.61
5.6.110.0060.03517.85
5.6.100.0030.04517.70
5.6.90.0090.05017.72
5.6.80.0020.04517.24
5.6.70.0090.02617.49
5.6.60.0020.04417.38
5.6.50.0050.04617.48
5.6.40.0050.04317.58
5.6.30.0100.03517.22
5.6.20.0060.04217.25
5.6.10.0070.03717.47
5.6.00.0020.04817.50
5.5.380.0100.00314.23
5.5.370.0090.00614.67
5.5.360.0030.00514.16
5.5.350.0050.03717.28
5.5.340.0030.04317.58
5.5.330.0070.04217.66
5.5.320.0080.03817.67
5.5.310.0050.04317.72
5.5.300.0060.03717.64
5.5.290.0080.04017.61
5.5.280.0040.03517.63
5.5.270.0020.04617.61
5.5.260.0080.03417.44
5.5.250.0050.04017.53
5.5.240.0050.04117.26
5.5.230.0020.03417.16
5.5.220.0000.03717.10
5.5.210.0070.03717.17
5.5.200.0060.04317.26
5.5.190.0030.04017.31
5.5.180.0040.03217.15
5.5.170.0070.00714.21
5.5.160.0090.02717.27
5.5.150.0050.04317.24
5.5.140.0050.03017.20
5.5.130.0070.04217.20
5.5.120.0020.02617.25
5.5.110.0030.04717.14
5.5.100.0070.02717.12
5.5.90.0030.02517.08
5.5.80.0020.02517.27
5.5.70.0030.04317.15
5.5.60.0100.03217.26
5.5.50.0000.04517.17
5.5.40.0000.03517.12
5.5.30.0080.03317.15
5.5.20.0060.03217.08
5.5.10.0060.02417.24
5.5.00.0080.03817.12
5.4.450.0030.04016.14
5.4.440.0030.04316.16
5.4.430.0050.04016.04
5.4.420.0050.03016.12
5.4.410.0000.03416.04
5.4.400.0020.04215.93
5.4.390.0030.03016.02
5.4.380.0050.02815.95
5.4.370.0040.02016.01
5.4.360.0060.03915.92
5.4.350.0030.03315.88
5.4.340.0070.03115.95
5.4.330.0030.01012.82
5.4.320.0020.02515.95
5.4.310.0020.03116.01
5.4.300.0040.03215.92
5.4.290.0020.03015.92
5.4.280.0050.02515.94
5.4.270.0080.03815.92
5.4.260.0060.03315.86
5.4.250.0030.04015.87
5.4.240.0040.02215.97
5.4.230.0030.03216.01
5.4.220.0050.04215.94
5.4.210.0040.04115.92
5.4.200.0050.03815.86
5.4.190.0100.03515.99
5.4.180.0020.03415.94
5.4.170.0050.02515.99
5.4.160.0030.02515.90
5.4.150.0050.02515.91
5.4.140.0050.04014.62
5.4.130.0050.02214.63
5.4.120.0040.03614.64
5.4.110.0060.03214.61
5.4.100.0050.03814.63
5.4.90.0050.04014.59
5.4.80.0020.02214.60
5.4.70.0020.02014.56
5.4.60.0020.02014.62
5.4.50.0040.01814.59
5.4.40.0040.01714.68
5.4.30.0000.02114.66
5.4.20.0040.01714.53
5.4.10.0010.01914.65
5.4.00.0030.01814.30
5.3.290.0080.02713.74
5.3.280.0040.03913.71
5.3.270.0050.04113.74
5.3.260.0040.02513.70
5.3.250.0040.03213.74
5.3.240.0060.03013.67
5.3.230.0030.04213.77
5.3.220.0040.03713.68
5.3.210.0030.02813.73
5.3.200.0070.02513.72
5.3.190.0020.03013.72
5.3.180.0040.02513.70
5.3.170.0050.02213.66
5.3.160.0030.02213.72
5.3.150.0030.02013.74
5.3.140.0030.02113.72
5.3.130.0050.01913.72
5.3.120.0010.02313.62
5.3.110.0000.01813.73
5.3.100.0000.01913.48
5.3.90.0030.01713.42
5.3.80.0020.01713.45
5.3.70.0030.01613.46
5.3.60.0020.01713.44
5.3.50.0020.01813.42
5.3.40.0020.03913.34
5.3.30.0000.02313.39
5.3.20.0000.01913.28
5.3.10.0020.02013.28
5.3.00.0000.02713.26
5.2.170.0030.02311.25
5.2.160.0030.02311.15
5.2.150.0030.03311.24
5.2.140.0070.05711.24
5.2.130.0000.02310.95
5.2.120.0000.02711.16
5.2.110.0030.02711.15
5.2.100.0000.02711.17
5.2.90.0030.04311.01
5.2.80.0000.03011.15
5.2.70.0070.05711.19
5.2.60.0000.02311.05
5.2.50.0070.01711.11
5.2.40.0000.02310.99
5.2.30.0000.02711.02
5.2.20.0000.02311.02
5.2.10.0000.02310.87
5.2.00.0030.02010.76
5.1.60.0030.01710.05
5.1.50.0030.0179.98
5.1.40.0070.0139.81
5.1.30.0000.02310.36
5.1.20.0000.02310.38
5.1.10.0000.02310.11
5.1.00.0030.02010.18
5.0.50.0070.0109.09
5.0.40.0030.0139.09
5.0.30.0030.0239.09
5.0.20.0000.0179.09
5.0.10.0000.0179.09
5.0.00.0030.0279.09
4.4.90.0000.0209.09
4.4.80.0000.0139.09
4.4.70.0000.0139.09
4.4.60.0030.0109.09
4.4.50.0030.0109.09
4.4.40.0000.0209.09
4.4.30.0000.0139.09
4.4.20.0030.0109.09
4.4.10.0000.0139.09
4.4.00.0030.0239.09
4.3.110.0030.0109.09
4.3.100.0000.0139.09
4.3.90.0030.0109.09
4.3.80.0000.0239.09
4.3.70.0070.0079.09
4.3.60.0000.0179.09
4.3.50.0000.0139.09
4.3.40.0000.0209.09
4.3.30.0000.0139.09
4.3.20.0000.0139.09
4.3.10.0000.0239.09
4.3.00.0000.0179.09

preferences:
74.35 ms | 401 KiB | 5 Q