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 $fn = function(){ return $this->foo = 'hello'; }; $fn1 = $fn->bindTo($test, 'Test'); // specify class name $test->callback = array($fn1); // 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.0040.01118.68
8.3.50.0190.01222.11
8.3.40.0070.01118.98
8.3.30.0070.01019.09
8.3.20.0070.00020.04
8.3.10.0080.00021.92
8.3.00.0080.00022.52
8.2.180.0140.00717.00
8.2.170.0070.01422.96
8.2.160.0130.00720.44
8.2.150.0040.00424.18
8.2.140.0030.00624.66
8.2.130.0100.01026.16
8.2.120.0030.00619.30
8.2.110.0040.00422.20
8.2.100.0090.00919.10
8.2.90.0000.00919.41
8.2.80.0080.00018.05
8.2.70.0030.00617.75
8.2.60.0080.00017.80
8.2.50.0120.00018.07
8.2.40.0000.00818.16
8.2.30.0060.00618.20
8.2.20.0000.00717.85
8.2.10.0040.00417.88
8.2.00.0040.00417.88
8.1.280.0150.00625.92
8.1.270.0030.00522.20
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0000.00823.80
8.1.230.0040.00819.09
8.1.220.0050.00317.74
8.1.210.0090.00018.77
8.1.200.0070.00317.48
8.1.190.0040.00417.52
8.1.180.0040.00418.10
8.1.170.0050.00318.53
8.1.160.0050.00322.08
8.1.150.0060.00318.59
8.1.140.0040.00417.47
8.1.130.0030.00317.71
8.1.120.0070.00017.45
8.1.110.0000.00817.46
8.1.100.0040.00417.40
8.1.90.0040.00417.42
8.1.80.0040.00417.47
8.1.70.0030.00517.37
8.1.60.0040.00417.50
8.1.50.0040.00417.44
8.1.40.0070.00017.43
8.1.30.0050.00317.59
8.1.20.0000.00817.70
8.1.10.0000.00717.64
8.1.00.0000.00717.57
8.0.300.0020.00518.77
8.0.290.0000.00717.05
8.0.280.0000.00718.48
8.0.270.0030.00317.18
8.0.260.0080.00016.76
8.0.250.0000.00717.02
8.0.240.0000.00716.94
8.0.230.0030.00317.00
8.0.220.0030.00317.00
8.0.210.0000.00716.96
8.0.200.0030.00617.02
8.0.190.0000.00816.94
8.0.180.0070.00017.03
8.0.170.0000.00717.02
8.0.160.0000.00716.85
8.0.150.0050.00316.96
8.0.140.0000.00716.92
8.0.130.0050.00013.44
8.0.120.0050.00316.98
8.0.110.0000.00816.96
8.0.100.0040.00417.04
8.0.90.0040.00416.75
8.0.80.0150.01017.02
8.0.70.0050.00216.87
8.0.60.0040.00416.82
8.0.50.0000.00816.84
8.0.30.0120.00817.21
8.0.20.0100.00817.40
8.0.10.0000.00717.09
8.0.00.0130.00616.85
7.4.330.0060.00015.14
7.4.320.0040.00416.54
7.4.300.0060.00016.60
7.4.290.0030.00316.53
7.4.280.0000.00916.59
7.4.270.0000.00716.55
7.4.260.0030.00316.58
7.4.250.0000.00816.48
7.4.240.0030.00416.48
7.4.230.0040.00416.60
7.4.220.0080.00816.54
7.4.210.0090.00716.62
7.4.200.0000.00716.43
7.4.190.0030.00316.49
7.4.160.0070.01016.87
7.4.150.0120.00617.40
7.4.140.0080.01317.86
7.4.130.0120.00816.53
7.4.120.0090.01016.54
7.4.110.0120.00616.40
7.4.100.0090.00916.53
7.4.90.0100.01316.52
7.4.80.0150.00619.39
7.4.70.0070.01016.34
7.4.60.0110.00416.46
7.4.50.0040.00416.68
7.4.40.0070.01022.77
7.4.30.0070.01016.33
7.4.00.0100.00714.98
7.3.330.0020.00213.45
7.3.320.0050.00013.39
7.3.310.0030.00316.49
7.3.300.0030.00316.30
7.3.290.0060.00916.38
7.3.280.0090.00916.37
7.3.270.0160.00317.40
7.3.260.0100.01016.56
7.3.250.0070.00916.43
7.3.240.0160.00016.38
7.3.230.0030.01616.52
7.3.210.0100.00716.42
7.3.200.0090.00619.39
7.3.190.0140.00616.45
7.3.180.0140.00616.39
7.3.170.0120.00616.64
7.3.160.0030.01316.44
7.3.120.0060.00914.68
7.3.10.0070.00516.64
7.3.00.0110.00216.58
7.2.330.0080.00816.48
7.2.320.0060.01616.70
7.2.310.0060.01216.55
7.2.300.0170.00716.47
7.2.290.0000.01516.79
7.2.130.0000.00816.94
7.2.120.0040.00617.04
7.2.110.0030.00816.80
7.2.100.0060.00616.74
7.2.90.0080.00616.86
7.2.80.0080.00516.77
7.2.70.0050.00816.80
7.2.60.0050.00816.71
7.2.50.0050.00916.94
7.2.40.0090.00716.71
7.2.30.0050.00816.77
7.2.20.0060.00416.70
7.2.10.0060.00916.66
7.2.00.0050.00617.60
7.1.250.0060.00615.87
7.1.240.0060.00315.74
7.1.230.0030.00915.52
7.1.220.0030.00615.58
7.1.210.0070.00415.86
7.1.200.0090.00415.73
7.1.190.0000.01315.81
7.1.180.0100.00315.98
7.1.170.0030.01015.86
7.1.160.0070.00715.64
7.1.150.0060.00915.78
7.1.140.0080.00415.73
7.1.130.0060.00915.91
7.1.120.0030.01015.92
7.1.110.0110.00415.87
7.1.100.0030.00717.04
7.1.90.0080.00015.83
7.1.80.0100.01015.89
7.1.70.0060.00516.34
7.1.60.0070.01017.79
7.1.50.0050.01016.42
7.1.40.0070.00715.60
7.1.30.0000.00815.80
7.1.20.0000.01315.84
7.1.10.0100.00715.67
7.1.00.0080.03819.14
7.0.330.0070.00715.56
7.0.320.0080.00315.42
7.0.310.0090.00015.36
7.0.300.0110.00315.29
7.0.290.0060.00614.94
7.0.280.0100.00315.24
7.0.270.0100.00315.44
7.0.260.0030.01015.36
7.0.250.0060.00615.53
7.0.240.0110.00315.25
7.0.230.0040.00415.45
7.0.220.0040.01115.30
7.0.210.0030.00915.57
7.0.200.0040.00715.88
7.0.190.0090.00315.45
7.0.180.0070.00715.55
7.0.170.0060.00915.40
7.0.160.0100.00315.45
7.0.150.0030.01415.52
7.0.140.0050.03918.70
7.0.130.0060.00615.31
7.0.120.0060.00615.45
7.0.110.0060.00715.32
7.0.100.0030.00715.41
7.0.90.0030.00715.37
7.0.80.0040.01215.19
7.0.70.0030.00615.37
7.0.60.0080.03917.62
7.0.50.0140.04016.64
7.0.40.0100.04216.76
7.0.30.0150.03916.81
7.0.20.0160.03316.82
7.0.10.0160.04816.91
7.0.00.0030.02516.73
5.6.380.0080.00014.50
5.6.370.0060.00914.08
5.6.360.0070.00414.20
5.6.350.0000.01314.61
5.6.340.0060.00814.11
5.6.330.0070.00714.41
5.6.320.0080.00414.27
5.6.310.0070.00714.55
5.6.300.0150.00014.24
5.6.290.0030.00614.49
5.6.280.0020.04217.58
5.6.270.0030.00614.40
5.6.260.0120.00314.51
5.6.250.0070.01014.25
5.6.240.0000.00814.37
5.6.230.0060.00314.50
5.6.220.0040.01114.38
5.6.210.0110.02817.41
5.6.200.0070.02416.51
5.6.190.0020.03417.45
5.6.180.1670.02017.34
5.6.170.0180.02517.20
5.6.160.0050.04517.25
5.6.150.0030.03116.10
5.6.140.0070.03916.20
5.6.130.0090.04416.35
5.6.120.0090.04617.74
5.6.110.0070.04517.66
5.6.100.0100.04017.76
5.6.90.0150.02517.61
5.6.80.0090.02317.34
5.6.70.0090.00613.91
5.6.60.0070.00714.14
5.6.50.0060.00614.10
5.6.40.0070.00714.23
5.6.30.0100.00614.07
5.6.20.0070.01014.37
5.6.10.0100.00613.95
5.6.00.0080.00413.97
5.5.380.0040.00711.32
5.5.370.0000.01111.10
5.5.360.0000.00711.05
5.5.350.0030.04515.70
5.5.340.0060.03114.60
5.5.330.0060.03615.87
5.5.320.0080.04415.55
5.5.310.0170.02015.80
5.5.300.0130.03914.56
5.5.290.0070.03514.44
5.5.280.0090.04015.96
5.5.270.0050.03715.95
5.5.260.0100.04016.02
5.5.250.0050.03615.81
5.5.240.0050.02315.80
5.5.230.0030.00711.05
5.5.220.0000.01110.79
5.5.210.0000.00811.06
5.5.200.0060.00611.08
5.5.190.0060.00310.75
5.5.180.0070.00011.10
5.5.170.0000.01010.96
5.5.160.0030.00311.09
5.5.150.0030.00710.84
5.5.140.0090.00010.88
5.5.130.0070.00310.88
5.5.120.0080.00411.00
5.5.110.0090.00311.17
5.5.100.0080.00410.70
5.5.90.0070.00010.78
5.5.80.0070.00710.89
5.5.70.0000.01010.91
5.5.60.0060.00611.36
5.5.50.0000.00910.99
5.5.40.0000.00810.96
5.5.30.0050.00510.87
5.5.20.0060.00310.76
5.5.10.0070.00010.98
5.5.00.0000.00711.14
5.4.450.0230.03315.17
5.4.440.0400.03215.20
5.4.430.0100.02615.31
5.4.420.0100.02815.13
5.4.410.0100.03215.23
5.4.400.0410.00114.99
5.4.390.0490.00214.68
5.4.380.0150.02714.95
5.4.370.0080.02914.96
5.4.360.0130.02714.72
5.4.350.0110.02814.91
5.4.340.0170.02314.98
5.4.330.0050.00010.71
5.4.320.0070.02711.60
5.4.310.0050.02711.79
5.4.300.0020.02411.82
5.4.290.0060.03011.66
5.4.280.0060.02011.62
5.4.270.0080.04215.09
5.4.260.0030.03914.96
5.4.250.0050.04214.84
5.4.240.0050.03414.89
5.4.230.0030.03115.02
5.4.220.0080.03415.00
5.4.210.0080.03114.98
5.4.200.0070.02815.07
5.4.190.0050.03114.93
5.4.180.0120.03614.84
5.4.170.0070.03014.84
5.4.160.0020.04414.84
5.4.150.0070.03515.00
5.4.140.0070.03213.76
5.4.130.0030.03313.78
5.4.120.0080.03013.63
5.4.110.0080.03513.70
5.4.100.0040.03313.89
5.4.90.0080.02313.74
5.4.80.0070.03113.71
5.4.70.0080.03313.63
5.4.60.0100.02313.57
5.4.50.0030.03513.63
5.4.40.0030.04113.59
5.4.30.0020.03013.53
5.4.20.0060.02813.62
5.4.10.0080.02713.63
5.4.00.0070.02713.45
5.3.290.0070.02311.70
5.3.280.0100.03212.40
5.3.270.0050.03312.48
5.3.260.0070.04012.57
5.3.250.0080.02512.69
5.3.240.0080.04012.51
5.3.230.0070.03712.64
5.3.220.0060.03012.52
5.3.210.0090.02812.56
5.3.200.0030.04112.44
5.3.190.0050.02812.38
5.3.180.0110.03212.58
5.3.170.0050.03312.60
5.3.160.0030.04012.60
5.3.150.0100.03012.62
5.3.140.0130.03012.49
5.3.130.0060.03512.54
5.3.120.0030.03212.50
5.3.110.0080.02812.66
5.3.100.0050.03612.17
5.3.90.0060.02512.21
5.3.80.0040.04112.09
5.3.70.0070.02912.24
5.3.60.0050.04012.27
5.3.50.0090.02312.20
5.3.40.0080.02712.19
5.3.30.0060.02812.26
5.3.20.0050.03112.07
5.3.10.0090.02711.85
5.3.00.0130.03212.01
5.2.170.0080.02610.34
5.2.160.0000.02810.23
5.2.150.0080.03010.13
5.2.140.0070.03010.21
5.2.130.0040.02810.19
5.2.120.0090.02210.19
5.2.110.0050.02310.27
5.2.100.0070.02310.28
5.2.90.0030.02310.17
5.2.80.0070.02810.29
5.2.70.0050.02310.18
5.2.60.0050.0239.98
5.2.50.0000.02910.04
5.2.40.0080.02310.05
5.2.30.0070.02510.24
5.2.20.0070.0189.88
5.2.10.0080.02010.00
5.2.00.0030.0259.83
5.1.60.0060.0169.01
5.1.50.0030.0209.25
5.1.40.0060.0209.07
5.1.30.0030.0239.52
5.1.20.0070.0239.50
5.1.10.0030.0219.33
5.1.00.0030.0219.03
5.0.50.0060.0188.19
5.0.40.0020.0198.06
5.0.30.0030.0298.04
5.0.20.0040.0148.06
5.0.10.0050.0158.05
5.0.00.0030.0238.03
4.4.90.0070.0137.29
4.4.80.0050.0177.29
4.4.70.0010.0157.29
4.4.60.0050.0157.29
4.4.50.0030.0147.29
4.4.40.0050.0257.27
4.4.30.0000.0177.25
4.4.20.0070.0177.24
4.4.10.0010.0137.24
4.4.00.0040.0247.24
4.3.110.0080.0127.24
4.3.100.0050.0117.24
4.3.90.0100.0107.24
4.3.80.0020.0197.24
4.3.70.0050.0137.24
4.3.60.0000.0167.24
4.3.50.0040.0177.24
4.3.40.0080.0187.24
4.3.30.0030.0137.24
4.3.20.0000.0197.24
4.3.10.0070.0107.24
4.3.00.0050.0147.15

preferences:
39.25 ms | 401 KiB | 5 Q