3v4l.org

run code in 300+ PHP versions simultaneously
<?php function show4($p) : void { if ((string) $p) { echo 1; } elseif ($p) { echo 2; } else { echo 3; } } show4('php'); show4('0'); show4([]); show4(0000); class Foo { public function __toString() { return '0'; } } show4(new Foo());

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.130.0070.01118.16
8.4.120.0050.00420.80
8.4.110.0120.00822.60
8.4.100.0140.00717.67
8.4.90.0110.00918.70
8.4.80.0080.00919.58
8.4.70.0140.00718.02
8.4.60.0150.00518.42
8.4.50.0090.00717.97
8.4.40.0130.00717.51
8.4.30.0090.01020.58
8.4.20.0170.00719.74
8.4.10.0000.00919.43
8.3.260.0060.00516.55
8.3.250.0130.00618.86
8.3.240.0090.01116.79
8.3.230.0060.00416.57
8.3.220.0100.00916.98
8.3.210.0120.00716.66
8.3.200.0020.00716.97
8.3.190.0110.00717.18
8.3.180.0100.00516.78
8.3.170.0170.00018.65
8.3.160.0120.00320.76
8.3.150.0070.01116.72
8.3.140.0000.00816.48
8.3.130.0060.00318.64
8.3.120.0090.00020.84
8.3.110.0190.00816.47
8.3.100.0150.00416.84
8.3.90.0150.00716.39
8.3.80.0120.00916.50
8.3.70.0150.00016.63
8.3.60.0070.00316.63
8.3.50.0200.00316.88
8.3.40.0120.00317.25
8.3.30.0070.00517.38
8.3.20.0080.00517.38
8.3.10.0060.00617.38
8.3.00.0130.00817.38
8.2.290.0090.01020.58
8.2.280.0090.00818.23
8.2.270.0040.00416.79
8.2.260.0070.01116.62
8.2.250.0040.00416.99
8.2.240.0130.00618.70
8.2.230.0060.00616.47
8.2.220.0040.00816.50
8.2.210.0100.00316.20
8.2.200.0080.00516.25
8.2.190.0060.00616.50
8.2.180.0120.00016.82
8.2.170.0080.00417.75
8.2.160.0040.00717.75
8.2.150.0080.00817.38
8.2.140.0060.00617.25
8.2.130.0060.00617.50
8.2.120.0050.00517.50
8.2.110.0060.00617.47
8.2.100.0070.00317.50
8.2.90.0080.00417.50
8.2.80.0080.00417.50
8.2.70.0070.00417.50
8.2.60.0060.00317.38
8.2.50.0100.00017.38
8.2.40.0100.00017.50
8.2.30.0100.00017.38
8.2.20.0070.00317.13
8.2.10.0070.00317.50
8.2.00.0110.00417.25
8.1.330.0120.00720.16
8.1.320.0130.00716.28
8.1.310.0050.00316.28
8.1.300.0030.00616.07
8.1.290.0070.00716.00
8.1.280.0060.00316.25
8.1.270.0110.00017.22
8.1.260.0070.00317.13
8.1.250.0080.00417.23
8.1.240.0050.00517.23
8.1.230.0070.00517.25
8.1.220.0070.00317.36
8.1.210.0070.00417.23
8.1.200.0030.00717.23
8.1.190.0070.00417.11
8.1.180.0030.00717.10
8.1.170.0060.00317.23
8.1.160.0000.01117.09
8.1.150.0030.00717.10
8.1.140.0090.00616.75
8.1.130.0060.01116.35
8.1.120.0100.00817.38
8.1.110.0140.00217.00
8.1.100.0140.00316.84
8.1.90.0090.00916.49
8.1.80.0150.00316.88
8.1.70.0110.00816.62
8.1.60.0110.00517.34
8.1.50.0150.00317.13
8.1.40.0170.00317.00
8.1.30.0150.00317.13
8.1.20.0160.00016.87
8.1.10.0140.00417.13
8.1.00.0140.00517.22

preferences:
30.33 ms | 403 KiB | 5 Q