3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function getFunc($text) { return function() use ($text) { $withNewLine = $text.PHP_EOL; printf("From the inside: %s", $withNewLine); return $withNewLine; }; } } $b = new A(); $func = $b->getFunc('can i has var'); $func(); $c = $b->getFunc('can i has var')(); echo 'From the outside:'.PHP_EOL; echo $c; var_dump($func = $b->getfunc("can i has var")());

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.01116.50
8.3.50.0110.00721.21
8.3.40.0110.00418.85
8.3.30.0110.00418.84
8.3.20.0070.00020.34
8.3.10.0000.00821.76
8.3.00.0040.00421.79
8.2.180.0080.00816.75
8.2.170.0110.00422.96
8.2.160.0100.00320.53
8.2.150.0030.00624.18
8.2.140.0040.00424.66
8.2.130.0080.00021.04
8.2.120.0040.00426.35
8.2.110.0100.00022.13
8.2.100.0090.00318.04
8.2.90.0050.00319.22
8.2.80.0080.00017.97
8.2.70.0040.00417.50
8.2.60.0040.00417.80
8.2.50.0040.00718.09
8.2.40.0030.00522.41
8.2.30.0000.00819.43
8.2.20.0000.00717.56
8.2.10.0000.00817.99
8.2.00.0050.00317.93
8.1.280.0190.00625.92
8.1.270.0070.00022.19
8.1.260.0040.00428.09
8.1.250.0000.00728.09
8.1.240.0040.00424.03
8.1.230.0090.00317.83
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0040.00417.22
8.1.180.0000.00818.10
8.1.170.0030.00518.63
8.1.160.0040.00420.77
8.1.150.0000.00719.02
8.1.140.0030.00519.57
8.1.130.0030.00317.75
8.1.120.0070.00017.40
8.1.110.0040.00417.34
8.1.100.0040.00417.43
8.1.90.0000.00917.49
8.1.80.0030.00317.37
8.1.70.0070.00017.34
8.1.60.0050.00217.63
8.1.50.0080.00017.51
8.1.40.0040.00417.50
8.1.30.0030.00617.68
8.1.20.0000.00717.54
8.1.10.0030.00617.51
8.1.00.0000.00717.57
8.0.300.0000.00818.77
8.0.290.0070.00016.75
8.0.280.0030.00318.48
8.0.270.0070.00017.13
8.0.260.0000.00617.13
8.0.250.0000.00716.80
8.0.240.0040.00416.85
8.0.230.0040.00416.98
8.0.220.0040.00416.86
8.0.210.0000.00716.80
8.0.200.0060.00016.84
8.0.190.0040.00416.91
8.0.180.0000.00716.91
8.0.170.0080.00016.80
8.0.160.0070.00016.90
8.0.150.0040.00416.86
8.0.140.0040.00416.89
8.0.130.0030.00313.31
8.0.120.0030.00616.86
8.0.110.0070.00016.80
8.0.100.0040.00416.94
8.0.90.0040.00416.93
8.0.80.0120.00316.86
8.0.70.0040.00416.80
8.0.60.0000.00816.71
8.0.50.0050.00316.77
8.0.30.0140.00316.94
8.0.20.0100.01217.40
8.0.10.0050.00317.02
8.0.00.0110.00816.70
7.4.330.0020.00316.83
7.4.320.0030.00316.49
7.4.300.0030.00316.51
7.4.290.0030.00316.59
7.4.280.0100.00016.59
7.4.270.0050.00216.53
7.4.260.0070.00016.60
7.4.250.0000.00816.57
7.4.240.0000.00716.56
7.4.230.0030.00316.41
7.4.220.0150.00316.59
7.4.210.0070.00916.47
7.4.200.0000.00716.32
7.4.160.0110.00516.64
7.4.150.0120.00617.40
7.4.140.0090.01317.86
7.4.130.0100.00816.40
7.4.120.0140.00316.53
7.4.110.0070.01016.38
7.4.100.0140.00316.64
7.4.90.0040.01516.41
7.4.80.0150.00919.39
7.4.70.0070.01416.41
7.4.60.0100.00616.63
7.4.50.0060.00916.25
7.4.40.0060.01116.54
7.4.30.0080.01516.60
7.4.00.0090.00914.83
7.3.330.0000.00613.30
7.3.320.0030.00313.16
7.3.310.0040.00416.34
7.3.300.0000.00716.29
7.3.290.0040.00416.35
7.3.280.0100.00616.29
7.3.270.0080.00817.40
7.3.260.0140.00316.34
7.3.250.0100.00916.53
7.3.240.0110.00616.30
7.3.230.0090.01316.39
7.3.210.0070.01016.52
7.3.200.0030.01719.39
7.3.190.0120.00416.19
7.3.180.0130.00316.22
7.3.170.0080.00816.40
7.3.160.0060.00916.36
7.3.10.0030.01016.36
7.3.00.0080.00816.39
7.2.330.0030.01316.84
7.2.320.0080.00916.75
7.2.310.0150.00616.66
7.2.300.0050.01116.75
7.2.290.0090.01216.51
7.2.130.0050.00716.74
7.2.120.0100.00716.88
7.2.110.0090.00916.65
7.2.100.0080.00616.74
7.2.90.0140.00816.79
7.2.80.0150.00516.58
7.2.70.0110.00516.69
7.2.60.0080.00716.86
7.2.50.0030.01016.55
7.2.40.0070.01016.49
7.2.30.0170.00816.69
7.2.20.0120.01216.73
7.2.10.0180.00716.79
7.2.00.0090.00917.67
7.1.250.0100.00815.46
7.1.200.0090.00015.95
7.1.100.0030.01017.92
7.1.70.0000.00717.26
7.1.60.0160.00919.40
7.1.50.0070.01517.04
7.1.00.0000.08022.36
7.0.200.0200.00714.55
7.0.60.0070.05021.83
7.0.50.0130.06017.88
7.0.40.0030.08720.14
7.0.30.0300.06020.25
7.0.20.0330.07020.23
7.0.10.0100.08320.15
7.0.00.0030.06020.22
5.6.280.0030.06721.11
5.6.210.0100.07020.57
5.6.200.0070.05318.25
5.6.190.0070.08720.67
5.6.180.0170.05320.46
5.6.170.0500.06020.49
5.6.160.0130.03720.68
5.6.150.0070.07718.18
5.6.140.0030.04718.17
5.6.130.0030.05318.28
5.6.120.0130.04321.01
5.6.110.0170.07021.01
5.6.100.0000.04321.00
5.6.90.0100.08720.99
5.6.80.0130.07320.29
5.5.350.0000.08720.42
5.5.340.0030.04717.95
5.5.330.0100.07320.19
5.5.320.0530.07320.25
5.5.310.0130.04320.32
5.5.300.0000.04017.96
5.5.290.0030.08317.98
5.5.280.0030.09020.78
5.5.270.0100.05720.87
5.5.260.0130.08320.84
5.5.250.0070.07020.70
5.5.240.0100.07320.16
5.4.450.0700.06319.43
5.4.440.0500.05019.26
5.4.430.0700.06719.43
5.4.420.0870.07019.43
5.4.410.0730.06319.32
5.4.400.0830.04718.94
5.4.390.0730.05319.19
5.4.380.0600.05319.23
5.4.370.0670.04719.24
5.4.360.0600.06319.11
5.4.350.0600.05719.20
5.4.340.0830.04319.33
5.4.320.0670.06019.29
5.4.310.0670.05319.13
5.4.300.0700.05019.32
5.4.290.0700.05319.16
5.4.280.0100.06018.98
5.4.270.0830.05019.12
5.4.260.0770.05019.28
5.4.250.0800.04718.93
5.4.240.0700.05018.98
5.4.230.0800.04719.26
5.4.220.0830.06018.94
5.4.210.0930.04719.26
5.4.200.0600.05019.16
5.4.190.0700.05319.18
5.4.180.0700.06019.09
5.4.170.0930.04719.18
5.4.160.0100.05019.21
5.4.150.0270.06319.08
5.4.140.0770.05316.60
5.4.130.0670.04716.59
5.4.120.0200.05016.57
5.4.110.0770.07316.64
5.4.100.0830.04316.69
5.4.90.0830.05016.37
5.4.80.0730.05016.66
5.4.70.0400.05016.25
5.4.60.0430.04716.52
5.4.50.0100.05016.50
5.4.40.0230.06016.49
5.4.30.0230.04016.61
5.4.20.0130.05316.51
5.4.10.0370.04016.56
5.4.00.0600.04015.70
5.3.290.0700.06314.66
5.3.280.0800.06314.52
5.3.270.0830.05014.68
5.3.260.0270.05314.64
5.3.250.0930.05014.58
5.3.240.0630.05314.68
5.3.230.0600.05314.64
5.3.220.0230.06314.60
5.3.210.0330.05014.40
5.3.200.1030.06314.55
5.3.190.0570.05314.58
5.3.180.0830.05314.58
5.3.170.0670.05014.73
5.3.160.0130.05314.54
5.3.150.0070.06014.54
5.3.140.0130.06714.61
5.3.130.0170.05714.53
5.3.120.0200.05014.71
5.3.110.0100.05314.59
5.3.100.0630.05314.05
5.3.90.0430.05313.98
5.3.80.0600.04314.04
5.3.70.0500.05014.04
5.3.60.0130.05013.96
5.3.50.0300.05313.96
5.3.40.0400.04713.95
5.3.30.0100.05013.90
5.3.20.0030.05713.75
5.3.10.0230.05313.48
5.3.00.0200.04713.80
5.2.170.0500.04711.16
5.2.160.0370.04011.30
5.2.150.0100.04311.16
5.2.140.0100.04011.18
5.2.130.0100.04311.05
5.2.120.0130.04311.07
5.2.110.0200.05311.09
5.2.100.0100.03711.16
5.2.90.0230.04711.02
5.2.80.0100.05711.14
5.2.70.0130.05011.09
5.2.60.0030.05011.12
5.2.50.0030.04311.06
5.2.40.0230.03010.95
5.2.30.0130.04310.92
5.2.20.0130.03310.85
5.2.10.0270.05010.78
5.2.00.0330.04710.76
5.1.60.0370.0379.98
5.1.50.0330.03710.02
5.1.40.0070.0339.96
5.1.30.0270.03310.33
5.1.20.0170.03010.50
5.1.10.0170.03310.07
5.1.00.0030.04310.07
5.0.50.0130.0208.57
5.0.40.0200.0308.41
5.0.30.0100.0508.07
5.0.20.0100.0238.17
5.0.10.0130.0338.19
5.0.00.0100.0478.14
4.4.90.0070.0206.50
4.4.80.0070.0176.50
4.4.70.0070.0206.50
4.4.60.0100.0236.50
4.4.50.0170.0206.50
4.4.40.0230.0306.50
4.4.30.0030.0206.50
4.4.20.0030.0236.50
4.4.10.0070.0206.50
4.4.00.0070.0436.50
4.3.110.0070.0336.50
4.3.100.0030.0306.50
4.3.90.0100.0206.50
4.3.80.0130.0476.50
4.3.70.0100.0336.50
4.3.60.0130.0206.50
4.3.50.0070.0276.50
4.3.40.0100.0276.50
4.3.30.0070.0206.50
4.3.20.0030.0236.50
4.3.10.0100.0236.50
4.3.00.0030.0236.50

preferences:
70.96 ms | 401 KiB | 5 Q