3v4l.org

run code in 300+ PHP versions simultaneously
<?php 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 class A{ function b(){ return function(){ return $this->secret; }; } } $a = array('a','b'); $a->bindTo($test); // 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.40.0040.01118.59
8.3.30.0090.00919.04
8.3.20.0000.00820.28
8.3.10.0000.00922.10
8.3.00.0020.00522.45
8.2.170.0110.00322.96
8.2.160.0070.01020.43
8.2.150.0050.00324.18
8.2.140.0030.00624.66
8.2.130.0070.01126.16
8.2.120.0040.00419.23
8.2.110.0060.00320.56
8.2.100.0090.00317.84
8.2.90.0080.00019.05
8.2.80.0050.00317.97
8.2.70.0000.00817.50
8.2.60.0030.00617.80
8.2.50.0000.00818.10
8.2.40.0000.00720.61
8.2.30.0120.00417.98
8.2.20.0000.00717.58
8.2.10.0000.00717.88
8.2.00.0000.00717.74
8.1.270.0000.00822.02
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00622.13
8.1.230.0060.00617.70
8.1.220.0080.00017.74
8.1.210.0030.00518.77
8.1.200.0060.00317.35
8.1.190.0100.00017.25
8.1.180.0060.00318.10
8.1.170.0060.00318.52
8.1.160.0070.00022.16
8.1.150.0070.00018.52
8.1.140.0040.00417.32
8.1.130.0030.00317.84
8.1.120.0070.00017.44
8.1.110.0000.00717.40
8.1.100.0020.00517.46
8.1.90.0040.00417.39
8.1.80.0000.00717.38
8.1.70.0040.00417.37
8.1.60.0000.00917.51
8.1.50.0070.00017.41
8.1.40.0000.00817.48
8.1.30.0000.00717.66
8.1.20.0030.00617.66
8.1.10.0000.00717.47
8.1.00.0040.00417.41
8.0.300.0050.00218.77
8.0.290.0000.00816.75
8.0.280.0000.00718.32
8.0.270.0050.00316.90
8.0.260.0030.00316.91
8.0.250.0070.00017.05
8.0.240.0040.00416.91
8.0.230.0030.00316.87
8.0.220.0000.00716.78
8.0.210.0030.00316.91
8.0.200.0030.00616.86
8.0.190.0000.00716.97
8.0.180.0070.00016.85
8.0.170.0080.00016.86
8.0.160.0020.00516.80
8.0.150.0030.00616.75
8.0.140.0030.00416.80
8.0.130.0030.00313.33
8.0.120.0050.00316.89
8.0.110.0000.00716.92
8.0.100.0000.00716.87
8.0.90.0000.00716.80
8.0.80.0130.00316.82
8.0.70.0040.00416.77
8.0.60.0000.00716.98
8.0.50.0000.00716.94
8.0.30.0070.01416.95
8.0.20.0140.00617.40
8.0.10.0040.00417.00
8.0.00.0070.01116.70
7.4.330.0000.00615.03
7.4.320.0070.00016.36
7.4.300.0000.00616.52
7.4.290.0030.00316.63
7.4.280.0070.00016.61
7.4.270.0050.00316.64
7.4.260.0040.00416.63
7.4.250.0020.00516.49
7.4.240.0060.00216.55
7.4.230.0030.00316.50
7.4.220.0030.01416.54
7.4.210.0060.00816.60
7.4.200.0030.00316.66
7.4.190.0050.00216.68
7.4.160.0120.00616.25
7.4.150.0070.01017.40
7.4.140.0090.01217.86
7.4.130.0130.00416.63
7.4.120.0120.00516.54
7.4.110.0100.00716.38
7.4.100.0030.01916.55
7.4.90.0100.01316.64
7.4.80.0120.00919.39
7.4.70.0090.00616.54
7.4.60.0110.00616.70
7.4.50.0030.00316.52
7.4.40.0140.00322.77
7.4.30.0000.01616.37
7.4.00.0090.00315.17
7.3.330.0030.00213.18
7.3.320.0030.00313.30
7.3.310.0000.00716.36
7.3.300.0000.00716.17
7.3.290.0000.01416.34
7.3.280.0070.01116.28
7.3.270.0100.00717.40
7.3.260.0080.01616.29
7.3.250.0110.00816.40
7.3.240.0060.01316.57
7.3.230.0100.00716.54
7.3.210.0140.00316.39
7.3.200.0000.01519.39
7.3.190.0080.01116.50
7.3.180.0030.01216.51
7.3.170.0080.00816.58
7.3.160.0080.00816.33
7.3.120.0030.01014.74
7.3.10.0040.00816.62
7.3.00.0050.00816.59
7.2.330.0130.01016.68
7.2.320.0030.02116.73
7.2.310.0070.01116.59
7.2.300.0070.01816.70
7.2.290.0090.00616.74
7.2.130.0090.00616.89
7.2.120.0030.00816.71
7.2.110.0020.01116.68
7.2.100.0010.01116.71
7.2.90.0090.00516.87
7.2.80.0030.01016.69
7.2.70.0080.00816.59
7.2.60.0060.00816.75
7.2.50.0090.00416.71
7.2.40.0040.00916.77
7.2.30.0060.00716.77
7.2.20.0050.00716.71
7.2.10.0060.00616.77
7.2.00.0040.00917.42
7.1.250.0080.00715.52
7.1.240.0030.00815.62
7.1.230.0050.00615.60
7.1.220.0080.00115.38
7.1.210.0050.00615.48
7.1.200.0060.00515.60
7.1.190.0040.00715.68
7.1.180.0020.01015.38
7.1.170.0070.00515.46
7.1.160.0100.00615.45
7.1.150.0120.00315.43
7.1.140.0050.00515.38
7.1.130.0100.00515.53
7.1.120.0030.00915.45
7.1.110.0080.00615.66
7.1.100.0040.00916.44
7.1.90.0050.00515.58
7.1.80.0090.00415.38
7.1.70.0050.00616.07
7.1.60.0130.00417.04
7.1.50.0060.01115.85
7.1.40.0050.00415.66
7.1.30.0040.01115.47
7.1.20.0110.00415.33
7.1.10.0030.00815.42
7.1.00.0020.03017.88
7.0.330.0070.00415.06
7.0.320.0030.00715.18
7.0.310.0040.00715.13
7.0.300.0060.00715.14
7.0.290.0010.00914.85
7.0.280.0070.00715.00
7.0.270.0060.00515.14
7.0.260.0060.00415.14
7.0.250.0030.00915.32
7.0.240.0060.00715.17
7.0.230.0070.00415.28
7.0.220.0050.00815.25
7.0.210.0110.00415.13
7.0.200.0020.00715.69
7.0.190.0060.00815.11
7.0.180.0020.01215.15
7.0.170.0110.00315.14
7.0.160.0070.01015.13
7.0.150.0090.00615.19
7.0.140.0080.02517.40
7.0.130.0010.00815.12
7.0.120.0070.00515.12
7.0.110.0070.00615.10
7.0.100.0110.00215.18
7.0.90.0040.00815.19
7.0.80.0050.00315.19
7.0.70.0060.00715.10
7.0.60.0090.02816.76
7.0.50.0050.02816.24
7.0.40.0040.01815.46
7.0.30.0140.01615.45
7.0.20.0110.03515.62
7.0.10.0120.02315.53
7.0.00.0040.03315.59
5.6.380.0070.00714.16
5.6.370.0030.01014.27
5.6.360.0060.00814.28
5.6.350.0080.00714.32
5.6.340.0100.00214.35
5.6.330.0070.00714.33
5.6.320.0020.01114.50
5.6.310.0070.00714.29
5.6.300.0000.01314.24
5.6.290.0030.00514.32
5.6.280.0030.03016.49
5.6.270.0030.01014.21
5.6.260.0090.00314.04
5.6.250.0060.00214.39
5.6.240.0070.00614.12
5.6.230.0110.00214.31
5.6.220.0060.00614.14
5.6.210.0040.01816.32
5.6.200.0040.02515.48
5.6.190.0090.03316.33
5.6.180.1360.02016.31
5.6.170.0070.02216.34
5.6.160.0080.01916.30
5.6.150.0050.01815.58
5.6.140.0060.01415.68
5.6.130.0050.01915.63
5.6.120.0070.02516.64
5.6.110.0040.03216.54
5.6.100.0100.02816.42
5.6.90.0070.02216.39
5.6.80.0060.01516.19
5.6.70.0150.02916.19
5.6.60.0090.00214.24
5.6.50.0040.00614.13
5.6.40.0030.00814.13
5.6.30.0020.00714.13
5.6.20.0080.00414.05
5.6.10.0000.01314.04
5.6.00.0110.00014.16
5.5.380.0030.00611.00
5.5.370.0020.00511.11
5.5.360.0050.00411.06
5.5.350.0030.02814.23
5.5.340.0020.02513.38
5.5.330.0030.01814.33
5.5.320.0120.02914.21
5.5.310.0200.02614.20
5.5.300.0040.02013.30
5.5.290.0050.03213.31
5.5.280.0050.02314.38
5.5.270.0030.03214.35
5.5.260.0070.02514.35
5.5.250.0060.01914.24
5.5.240.0030.02414.06
5.5.230.0050.00510.98
5.5.220.0020.00710.96
5.5.210.0030.00910.94
5.5.200.0030.00311.03
5.5.190.0030.00610.80
5.5.180.0040.00411.01
5.5.170.0070.00311.03
5.5.160.0020.00911.04
5.5.150.0030.00611.04
5.5.140.0050.00411.17
5.5.130.0030.00711.16
5.5.120.0070.00311.10
5.5.110.0020.00910.88
5.5.100.0060.00711.00
5.5.90.0050.00410.95
5.5.80.0030.00711.05
5.5.70.0040.00711.05
5.5.60.0050.00611.04
5.5.50.0020.00711.06
5.5.40.0060.00210.97
5.5.30.0050.00510.96
5.5.20.0020.01310.93
5.5.10.0070.00311.10
5.5.00.0050.00511.01
5.4.450.0130.02413.82
5.4.440.0080.02213.74
5.4.430.0130.02913.83
5.4.420.0140.02313.85
5.4.410.0200.02213.75
5.4.400.0120.02313.69
5.4.390.0170.02513.65
5.4.380.0140.02013.58
5.4.370.0190.02413.72
5.4.360.0240.01413.58
5.4.350.0160.03013.56
5.4.340.0180.02313.70
5.4.330.0060.00210.71
5.4.320.0150.01513.57
5.4.310.0150.02713.57
5.4.300.0130.01813.69
5.4.290.0140.02613.61
5.4.280.0140.02513.52
5.4.270.0130.01813.65
5.4.260.0110.01913.59
5.4.250.0140.01913.63
5.4.240.0110.01713.79
5.4.230.0100.02213.63
5.4.220.0130.02113.64
5.4.210.0180.02613.56
5.4.200.0130.02113.62
5.4.190.0150.02313.61
5.4.180.0180.02413.57
5.4.170.0110.02213.59
5.4.160.0160.02713.62
5.4.150.0140.02813.65
5.4.140.0190.01612.77
5.4.130.0190.01412.79
5.4.120.0160.02412.77
5.4.110.0170.01612.80
5.4.100.0170.02012.77
5.4.90.0140.01612.69
5.4.80.0180.02412.83
5.4.70.0170.01312.77
5.4.60.0160.01812.65
5.4.50.0150.02712.77
5.4.40.0140.01812.80
5.4.30.0140.02612.73
5.4.20.0120.01812.77
5.4.10.0130.01612.74
5.4.00.0200.01312.54
5.3.290.0160.02712.05
5.3.280.0110.01712.02
5.3.270.0120.01611.94
5.3.260.0190.01512.01
5.3.250.0140.02611.96
5.3.240.0200.02311.96
5.3.230.0200.02312.05
5.3.220.0160.02611.94
5.3.210.0170.01611.91
5.3.200.0150.02311.93
5.3.190.0170.01511.94
5.3.180.0170.01912.07
5.3.170.0110.02512.09
5.3.160.0130.01512.08
5.3.150.0180.02211.94
5.3.140.0130.02711.98
5.3.130.0170.02712.03
5.3.120.0140.01612.00
5.3.110.0160.01612.05
5.3.100.0160.02011.83
5.3.90.0110.01511.82
5.3.80.0110.01811.70
5.3.70.0140.02411.75
5.3.60.0160.02611.78
5.3.50.0150.02711.73
5.3.40.0160.02311.81
5.3.30.0190.02311.73
5.3.20.0160.02711.66
5.3.10.0130.01711.58
5.3.00.0140.01911.58
5.2.170.0150.02211.10
5.2.160.0120.01811.10
5.2.150.0120.02411.10
5.2.140.0130.02111.10
5.2.130.0100.01911.10
5.2.120.0130.02011.10
5.2.110.0100.01411.10
5.2.100.0150.01211.10
5.2.90.0140.01411.10
5.2.80.0100.02311.10
5.2.70.0120.01611.10
5.2.60.0110.02211.10
5.2.50.0210.00911.10
5.2.40.0100.02211.10
5.2.30.0080.01811.10
5.2.20.0090.01411.10
5.2.10.0150.01811.10
5.2.00.0100.01811.10
5.1.60.0080.01211.10
5.1.50.0120.01611.10
5.1.40.0100.01311.10
5.1.30.0100.02211.10
5.1.20.0120.01811.10
5.1.10.0100.01311.10
5.1.00.0110.01711.10
5.0.50.0060.01911.10
5.0.40.0080.01411.10
5.0.30.0100.02011.10
5.0.20.0060.01711.10
5.0.10.0060.01111.10
5.0.00.0080.01311.10
4.4.90.0060.00811.10
4.4.80.0070.00911.10
4.4.70.0050.01511.10
4.4.60.0070.01311.10
4.4.50.0060.01011.10
4.4.40.0070.01711.10
4.4.30.0060.01011.10
4.4.20.0050.00911.10
4.4.10.0050.01511.10
4.4.00.0080.01711.10
4.3.110.0070.00811.10
4.3.100.0070.01211.10
4.3.90.0040.00911.10
4.3.80.0050.01111.10
4.3.70.0080.00411.10
4.3.60.0060.00611.10
4.3.50.0060.00511.10
4.3.40.0070.01411.10
4.3.30.0030.01011.10
4.3.20.0020.01611.10
4.3.10.0030.01411.10
4.3.00.0050.01211.10

preferences:
44.16 ms | 400 KiB | 5 Q