3v4l.org

run code in 300+ PHP versions simultaneously
<?php function bar() { echo "da blyaaa\n"; } $bar = function() { echo "voobshe ohuet\n"; }; class Foo { public const bar = 'bar'; public static string $bar = 'bar'; public function bar(): string { return 'bar'; } } $foo = new Foo; echo "1) This is {Foo::$bar}\n"; echo "2) This is {$foo::$bar()}\n"; echo "3) This is {Foo::bar}\n"; echo "4) This is {Foo->bar()}\n"; echo "5) This is {$foo->bar()}\n"; echo "6) This is ${Foo::bar}\n"; echo "7) This is ${Foo::$bar}\n"; echo "8) This is {$foo::bar()}\n";

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.4.120.0060.00322.30
8.4.110.0140.00622.60
8.4.100.0090.00917.70
8.4.90.0100.01120.53
8.4.80.0140.00619.02
8.4.70.0120.00918.08
8.4.60.0130.00818.82
8.4.50.0090.01220.33
8.4.40.0130.00718.70
8.4.30.0040.00422.61
8.4.20.0030.00522.53
8.4.10.0150.00623.71
8.3.250.0110.00819.05
8.3.240.0050.00416.59
8.3.230.0100.01116.87
8.3.220.0060.00218.84
8.3.210.0110.00618.53
8.3.200.0050.00316.69
8.3.190.0130.00617.04
8.3.180.0140.00417.07
8.3.170.0120.00620.34
8.3.160.0090.00918.83
8.3.150.0040.01416.92
8.3.140.0060.00317.00
8.3.130.0080.00018.52
8.3.120.0100.00018.93
8.3.110.0100.00720.94
8.3.100.0060.00316.92
8.3.90.0000.00926.77
8.3.80.0070.00318.68
8.3.70.0120.00316.50
8.3.60.0140.00718.41
8.3.50.0120.00318.71
8.3.40.0120.00321.97
8.3.30.0070.00720.35
8.3.20.0040.00424.18
8.3.10.0000.00824.66
8.3.00.0070.00026.16
8.2.290.0050.00316.75
8.2.280.0090.00718.78
8.2.270.0040.00417.39
8.2.260.0150.00418.93
8.2.250.0080.00016.90
8.2.240.0110.00820.71
8.2.230.0030.00722.58
8.2.220.0090.00024.06
8.2.210.0110.00426.77
8.2.200.0060.00616.63
8.2.190.0110.00716.63
8.2.180.0090.00918.54
8.2.170.0120.00618.96
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0070.00019.95
8.2.110.0050.00519.34
8.2.100.0110.00017.71
8.2.90.0220.00618.30
8.2.80.0180.00918.34
8.2.70.0220.00618.35
8.2.60.0240.00518.21
8.2.50.0230.00518.10
8.2.40.0160.00918.21
8.2.30.0210.00318.33
8.2.20.0190.00618.23
8.2.10.0180.00718.14
8.2.00.0210.00418.25
8.1.330.0120.00922.04
8.1.320.0060.00216.38
8.1.310.0100.00016.82
8.1.300.0060.00318.20
8.1.290.0090.00030.84
8.1.280.0140.00025.92
8.1.270.0080.00024.66
8.1.260.0000.00926.35
8.1.250.0040.00428.09
8.1.240.0070.00323.79
8.1.230.0040.00720.96
8.1.220.0200.00518.02
8.1.210.0180.00618.01
8.1.200.0220.00317.95
8.1.190.0180.00618.01
8.1.180.0200.00417.97
8.1.170.0190.00618.10
8.1.160.0200.00418.06
8.1.150.0220.00418.12
8.1.140.0180.00718.14
8.1.130.0150.00917.88
8.1.120.0200.00318.22
8.1.110.0200.00418.13
8.1.100.0150.00918.20
8.1.90.0190.00618.17
8.1.80.0170.00618.07
8.1.70.0170.00718.07
8.1.60.0220.00418.30
8.1.50.0210.00418.15
8.1.40.0210.00518.25
8.1.30.0230.00418.20
8.1.20.0210.00318.15
8.1.10.0210.00418.14
8.1.00.0210.00518.05
8.0.300.0230.00417.66
8.0.290.0240.00417.70
8.0.280.0170.01017.72
8.0.270.0200.00517.78
8.0.260.0220.00317.66
8.0.250.0190.00517.73
8.0.240.0220.00217.78
8.0.230.0210.00317.69
8.0.220.0190.00417.61
8.0.210.0160.00917.63
8.0.200.0210.00417.70
8.0.190.0190.00617.67
8.0.180.0210.00417.78
8.0.170.0180.00717.81
8.0.160.0180.00617.77
8.0.150.0200.00417.60
8.0.140.0160.00817.59
8.0.130.0190.00417.68
8.0.120.0220.00317.75
8.0.110.0200.00317.65
8.0.100.0190.00517.62
8.0.90.0160.00717.75
8.0.80.0200.00417.77
8.0.70.0180.00517.59
8.0.60.0170.00617.73
8.0.50.0170.00717.61
8.0.30.0180.00717.59
8.0.20.0200.00517.79
8.0.10.0160.00717.90
7.2.340.0190.01025.66

preferences:
27.21 ms | 403 KiB | 5 Q