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 $closure = function() { echo $this->secrret; }; // rebinds the closure to the $context object $boundClosure = $closure->bindTo($test); $boundClosure(); // 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.0060.01318.27
8.3.50.0120.00822.11
8.3.40.0180.00318.97
8.3.30.0070.00719.05
8.3.20.0040.00420.42
8.3.10.0040.00422.05
8.3.00.0000.00822.58
8.2.180.0070.01116.75
8.2.170.0110.00422.96
8.2.160.0070.00720.38
8.2.150.0080.00024.18
8.2.140.0070.00724.66
8.2.130.0040.00426.16
8.2.120.0000.00819.36
8.2.110.0090.00022.30
8.2.100.0060.00617.97
8.2.90.0040.00419.04
8.2.80.0040.00417.97
8.2.70.0050.00317.38
8.2.60.0050.00317.93
8.2.50.0040.00418.07
8.2.40.0040.00418.16
8.2.30.0040.00417.98
8.2.20.0080.00017.72
8.2.10.0000.00817.54
8.2.00.0000.00817.71
8.1.280.0000.01425.92
8.1.270.0060.00322.01
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0000.00823.89
8.1.230.0070.00318.97
8.1.220.0030.00717.74
8.1.210.0090.00018.77
8.1.200.0030.00617.22
8.1.190.0040.00417.53
8.1.180.0050.00318.10
8.1.170.0050.00318.53
8.1.160.0000.00722.03
8.1.150.0000.00718.70
8.1.140.0050.00317.47
8.1.130.0040.00417.83
8.1.120.0000.00717.48
8.1.110.0000.00717.40
8.1.100.0000.00717.39
8.1.90.0000.00817.46
8.1.80.0070.00017.51
8.1.70.0040.00417.44
8.1.60.0050.00517.61
8.1.50.0000.00717.57
8.1.40.0040.00417.52
8.1.30.0070.00017.67
8.1.20.0050.00317.60
8.1.10.0000.00717.60
8.1.00.0030.00617.57
8.0.300.0000.00718.77
8.0.290.0000.00717.18
8.0.280.0030.00318.46
8.0.270.0030.00317.28
8.0.260.0070.00016.91
8.0.250.0020.00516.92
8.0.240.0000.00717.00
8.0.230.0070.00017.04
8.0.220.0050.00316.84
8.0.210.0030.00316.91
8.0.200.0050.00216.91
8.0.190.0040.00316.99
8.0.180.0000.00716.98
8.0.170.0000.00916.96
8.0.160.0080.00016.91
8.0.150.0000.00716.91
8.0.140.0040.00316.95
8.0.130.0060.00013.34
8.0.120.0040.00416.82
8.0.110.0000.00716.88
8.0.100.0040.00416.84
8.0.90.0050.00316.93
8.0.80.0000.01516.92
8.0.70.0070.00016.89
8.0.60.0070.00017.00
8.0.50.0030.00616.97
8.0.30.0120.00917.07
8.0.20.0100.01617.40
8.0.10.0000.00717.13
8.0.00.0100.01116.86
7.4.330.0000.00615.10
7.4.320.0000.00616.67
7.4.300.0030.00316.58
7.4.290.0000.00716.62
7.4.280.0000.00716.64
7.4.270.0030.00316.61
7.4.260.0040.00416.55
7.4.250.0050.00216.39
7.4.240.0020.00516.61
7.4.230.0030.00316.70
7.4.220.0140.00316.64
7.4.210.0110.00316.55
7.4.200.0040.00416.47
7.4.190.0070.00016.70
7.4.160.0090.00916.73
7.4.150.0110.00617.40
7.4.140.0070.01117.86
7.4.130.0070.01116.62
7.4.120.0090.00816.60
7.4.110.0170.00316.62
7.4.100.0110.00816.46
7.4.90.0070.01016.69
7.4.80.0130.00919.39
7.4.70.0150.00016.63
7.4.60.0070.01016.32
7.4.50.0030.00616.39
7.4.40.0080.00822.77
7.4.30.0140.00316.52
7.4.00.0110.00615.14
7.3.330.0020.00313.16
7.3.320.0050.00013.29
7.3.310.0070.00016.20
7.3.300.0000.00616.29
7.3.290.0140.00416.32
7.3.280.0040.01116.29
7.3.270.0130.00717.40
7.3.260.0070.01416.36
7.3.250.0110.00516.28
7.3.240.0100.00716.43
7.3.230.0130.01016.48
7.3.210.0100.00716.32
7.3.200.0180.00419.39
7.3.190.0030.01616.24
7.3.180.0090.01216.28
7.3.170.0080.00816.45
7.3.160.0120.00616.52
7.3.120.0030.01214.82
7.3.110.0130.00314.77
7.3.100.0060.00614.62
7.3.90.0000.01314.52
7.3.80.0120.00614.83
7.3.70.0060.00314.35
7.3.60.0060.00314.85
7.3.50.0070.01014.76
7.3.40.0040.00714.60
7.3.30.0070.00714.66
7.3.20.0120.00316.64
7.3.10.0070.00416.66
7.3.00.0030.01016.58
7.2.330.0110.00716.82
7.2.320.0170.00616.75
7.2.310.0070.01116.81
7.2.300.0030.01516.39
7.2.290.0120.00416.46
7.2.250.0030.01415.26
7.2.240.0040.01514.84
7.2.230.0040.01415.08
7.2.220.0000.01415.35
7.2.210.0110.00415.17
7.2.200.0000.01115.29
7.2.190.0060.00314.95
7.2.180.0090.00615.11
7.2.170.0070.01015.01
7.2.00.0380.00819.16
7.1.330.0090.00415.78
7.1.320.0030.01215.46
7.1.310.0140.00315.58
7.1.300.0060.00615.73
7.1.290.0030.01315.70
7.1.280.0090.00615.65
7.1.270.0060.00915.65
7.1.260.0060.00915.52
7.1.200.0040.00415.60
7.1.100.0200.01017.89
7.1.70.0040.01217.13
7.1.60.0120.00319.82
7.1.50.0120.01216.89
7.1.00.0030.07722.57
7.0.200.0060.00616.75
7.0.140.0030.07321.97
7.0.60.0070.08020.09
7.0.50.0100.07317.89
7.0.40.0070.08720.11
7.0.30.0630.06720.19
7.0.20.0200.05320.30
7.0.10.0070.05320.23
7.0.00.0070.07720.25
5.6.280.0070.07020.79
5.6.210.0030.04020.55
5.6.200.0030.08718.14
5.6.190.0100.04020.77
5.6.180.0270.07020.73
5.6.170.0270.05320.45
5.6.160.0100.08020.76
5.6.150.0000.05318.21
5.6.140.0030.07018.14
5.6.130.0100.08718.18
5.6.120.0100.08021.00
5.6.110.0170.07721.12
5.6.100.0130.07721.14
5.6.90.0070.08021.02
5.6.80.0030.08020.39
5.6.70.3330.03020.28
5.5.350.0170.07020.45
5.5.340.0070.08717.95
5.5.330.0100.04720.47
5.5.320.0300.06720.28
5.5.310.0170.04020.32
5.5.300.0030.05017.95
5.5.290.0100.07717.91
5.5.280.0000.04320.86
5.5.270.0070.08020.77
5.5.260.0200.07720.69
5.5.250.0070.07320.50
5.5.240.0030.07720.13
5.4.450.0570.06019.56
5.4.440.0170.05319.36
5.4.430.0030.06319.41
5.4.420.0130.05719.44
5.4.410.0130.05019.52
5.4.400.1100.00018.83
5.4.390.0800.00018.51
5.4.380.0170.05718.48
5.4.370.0300.04018.84
5.4.360.0000.05718.75
5.4.350.0000.06018.73
5.4.340.0200.05318.57
5.4.320.0030.04012.51
5.4.310.0050.03812.51
5.4.300.0050.03812.51
5.4.290.0040.04512.50
5.4.280.0080.03612.40
5.4.270.0100.06019.02
5.4.260.0130.06018.94
5.4.250.0000.06718.80
5.4.240.0130.08019.10
5.4.230.0130.07319.02
5.4.220.0170.07319.02
5.4.210.0100.07318.77
5.4.200.0100.05318.95
5.4.190.0070.06318.94
5.4.180.0170.05019.00
5.4.170.0100.06318.98
5.4.160.0170.06018.89
5.4.150.0100.07719.00
5.4.140.0070.05716.55
5.4.130.0200.04316.40
5.4.120.0130.05716.37
5.4.110.0130.06716.62
5.4.100.0070.06016.42
5.4.90.0230.04716.66
5.4.80.0130.06716.55
5.4.70.0000.06316.48
5.4.60.0100.05716.63
5.4.50.0130.04716.63
5.4.40.0130.04316.55
5.4.30.0100.05716.59
5.4.20.0100.05716.46
5.4.10.0200.06016.52
5.4.00.0170.06016.07
5.3.290.0110.03612.80
5.3.280.0200.05014.70
5.3.270.0030.05714.45
5.3.260.0100.07014.58
5.3.250.0170.04714.52
5.3.240.0070.06314.70
5.3.230.0130.05314.51
5.3.220.0070.06714.58
5.3.210.0070.07314.60
5.3.200.0130.06014.75
5.3.190.0130.06714.74
5.3.180.0030.06314.65
5.3.170.0100.06014.65
5.3.160.0170.06714.80
5.3.150.0200.04314.66
5.3.140.0070.06314.56
5.3.130.0030.06014.78
5.3.120.0070.07014.56
5.3.110.0200.06314.57
5.3.100.0100.05014.20
5.3.90.0130.05714.11
5.3.80.0100.05014.21
5.3.70.0100.07014.01
5.3.60.0130.05314.17
5.3.50.0170.05013.93
5.3.40.0170.05714.04
5.3.30.0100.04714.00
5.3.20.0200.04013.61
5.3.10.0100.06313.64
5.3.00.0070.07013.73
5.2.170.0030.05711.22
5.2.160.0130.04711.05
5.2.150.0130.05011.31
5.2.140.0170.04311.23
5.2.130.0200.03711.11
5.2.120.0100.04311.17
5.2.110.0000.04711.19
5.2.100.0100.04711.16
5.2.90.0170.03311.11
5.2.80.0170.03011.18
5.2.70.0100.04011.25
5.2.60.0100.04711.01
5.2.50.0070.04011.11
5.2.40.0070.05711.00
5.2.30.0070.05710.97
5.2.20.0100.04710.87
5.2.10.0200.04310.95
5.2.00.0030.05310.91
5.1.60.0070.05010.15
5.1.50.0030.04310.24
5.1.40.0130.03010.13
5.1.30.0000.06010.41
5.1.20.0200.04010.54
5.1.10.0170.0379.99
5.1.00.0070.04010.11
5.0.50.0030.0308.75
5.0.40.0000.0308.39
5.0.30.0000.0578.20
5.0.20.0030.0278.44
5.0.10.0070.0278.19
5.0.00.0070.0478.17
4.4.90.0030.0235.86
4.4.80.0070.0235.81
4.4.70.0130.0235.88
4.4.60.0070.0205.84
4.4.50.0030.0275.81
4.4.40.0000.0375.80
4.4.30.0070.0205.86
4.4.20.0070.0235.86
4.4.10.0070.0275.81
4.4.00.0200.0335.88
4.3.110.0070.0305.77
4.3.100.0100.0205.77
4.3.90.0100.0205.77
4.3.80.0000.0405.73
4.3.70.0000.0305.75
4.3.60.0000.0275.73
4.3.50.0030.0275.73
4.3.40.0070.0305.70
4.3.30.0000.0235.45
4.3.20.0070.0235.45
4.3.10.0030.0275.45
4.3.00.0130.0176.46

preferences:
44.54 ms | 401 KiB | 5 Q