3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (true) { function test_func1($string) { return $string; } } echo test_func1("conditionally defined then unconditionally called"); echo "\n---\n"; if (true) { echo test_func2("conditionally called then defined"); function test_func2($string) { return $string; } } echo "\n---\n"; echo test_func3("called then conditionally defined"); if (true) { function test_func3($string) { return $string; } }

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.0080.00818.43
8.3.50.0100.00720.44
8.3.40.0100.00321.83
8.3.30.0140.00019.22
8.3.20.0040.00424.18
8.3.10.0080.00024.66
8.3.00.0050.00326.16
8.2.180.0030.01325.92
8.2.170.0120.00322.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.0040.00426.16
8.2.110.0090.00920.35
8.2.100.0120.00017.78
8.2.90.0050.00317.75
8.2.80.0060.00317.97
8.2.70.0090.00017.63
8.2.60.0040.00417.63
8.2.50.0080.00017.98
8.2.40.0020.00518.09
8.2.30.0040.00418.18
8.2.20.0070.00020.36
8.2.10.0040.00418.06
8.2.00.0040.00419.29
8.1.280.0040.01125.92
8.1.270.0000.00823.99
8.1.260.0070.00026.35
8.1.250.0120.00328.09
8.1.240.0040.00423.80
8.1.230.0060.00619.18
8.1.220.0000.00817.79
8.1.210.0090.00018.77
8.1.200.0050.00517.35
8.1.190.0080.00017.22
8.1.180.0050.00318.10
8.1.170.0000.00817.62
8.1.160.0050.00318.89
8.1.150.0050.00218.49
8.1.140.0000.00817.42
8.1.130.0030.00317.28
8.1.120.0050.00217.29
8.1.110.0040.00417.37
8.1.100.0040.00417.23
8.1.90.0070.00017.32
8.1.80.0000.00717.39
8.1.70.0070.00017.37
8.1.60.0160.00317.39
8.1.50.0170.00417.50
8.1.40.0130.00417.32
8.1.30.0150.00417.42
8.1.20.0130.00617.50
8.1.10.0100.01017.47
8.1.00.0090.00217.46
8.0.300.0030.00519.64
8.0.290.0040.00416.75
8.0.280.0000.00718.45
8.0.270.0070.00016.80
8.0.260.0030.00316.88
8.0.250.0070.00017.04
8.0.240.0000.00616.88
8.0.230.0030.00317.03
8.0.220.0000.00716.89
8.0.210.0040.00417.02
8.0.200.0030.00517.00
8.0.190.0050.00516.91
8.0.180.0050.00516.96
8.0.170.0000.01016.98
8.0.160.0100.00016.98
8.0.150.0120.00016.99
8.0.140.0030.00916.92
8.0.130.0150.00016.91
8.0.120.0080.00816.93
8.0.110.0110.00416.85
8.0.100.0120.00416.73
8.0.90.0130.00316.87
8.0.80.0000.01516.95
8.0.70.0100.00816.93
8.0.60.0110.00516.74
8.0.50.0070.00716.86
8.0.30.0160.00016.76
8.0.20.0130.00316.96
8.0.10.0110.00317.00
7.4.330.0040.00015.55
7.4.320.0060.00016.35
7.4.300.0000.00716.46
7.4.290.0100.00716.54
7.4.280.0140.00416.35
7.4.270.0140.00316.54
7.4.260.0140.00316.53
7.4.250.0160.00316.52
7.4.240.0120.00416.43
7.4.230.0120.00416.36
7.4.220.0070.00016.50
7.4.210.0000.00716.54
7.4.200.0070.00016.58
7.4.190.0040.00416.55
7.4.180.0040.00716.50
7.4.160.0100.00516.50
7.4.150.0100.00316.47
7.4.140.0050.00516.28
7.4.130.0100.00016.01
7.4.120.0070.00516.10
7.4.110.0060.00316.39
7.4.100.0040.00716.45
7.4.90.0050.00516.35
7.4.80.0000.01416.40
7.4.70.0120.00016.48
7.4.60.0000.01616.38
7.4.50.0050.01016.30
7.4.40.0140.00316.39
7.4.30.0100.00616.34
7.4.20.0090.00616.23
7.4.10.0030.00616.40
7.4.00.0040.00416.43

preferences:
59.54 ms | 400 KiB | 5 Q