3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo; $a = [1, 2, 3]; \in_array($b, $a, true); // not optimized because variable array \in_array($b, [1, 2, 3]); // not optimized because missing strict param in_array($b, [1, 2, 3], true); // not optimized because no leading `\` or import \in_array($b, [1, 2, 3], true); // optimized

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.150.0030.00014.05
8.4.140.0170.00317.60
8.4.130.0070.01017.64
8.4.120.0100.00922.21
8.4.110.0120.00822.34
8.4.100.0320.00817.73
8.4.90.0320.01117.75
8.4.80.0360.00717.63
8.4.70.0200.00317.74
8.4.60.0210.00217.72
8.4.50.0230.00017.38
8.4.40.0180.00517.53
8.4.30.0150.00717.39
8.4.20.0220.00417.69
8.4.10.0210.00417.50
8.3.270.0110.00916.61
8.3.260.0150.00416.77
8.3.250.0130.00518.88
8.3.240.0110.00816.54
8.3.230.0180.00316.44
8.3.220.0170.00516.50
8.3.210.0190.00216.29
8.3.200.0180.00416.59
8.3.190.0180.00416.45
8.3.180.0180.00216.66
8.3.170.0200.00216.66
8.3.160.0210.00216.84
8.3.150.0190.00416.54
8.3.140.0180.00416.79
8.3.130.0180.00116.73
8.3.120.0160.00416.63
8.3.110.0140.00716.36
8.3.100.0170.00416.38
8.3.90.0180.00616.47
8.3.80.0200.00516.22
8.3.70.0170.00716.60
8.3.60.0200.00316.44
8.3.50.0200.00416.48
8.3.40.0190.00417.16
8.3.30.0150.00417.30
8.3.20.0120.00817.29
8.3.10.0170.00117.38
8.3.00.0100.00717.00
8.2.290.0110.00520.44
8.2.280.0140.00616.54
8.2.270.0170.00316.30
8.2.260.0160.00316.56
8.2.250.0140.00516.66
8.2.240.0130.00516.33
8.2.230.0140.00616.49
8.2.220.0120.00716.40
8.2.210.0140.00516.44
8.2.200.0140.00416.63
8.2.190.0120.00716.59
8.2.180.0170.00216.41
8.2.170.0150.00517.53
8.2.160.0270.01317.44
8.2.150.0340.00717.67
8.2.140.0270.00917.37
8.2.130.0230.00817.61
8.2.120.0380.00917.57
8.2.110.0290.00617.42
8.2.100.0280.00717.40
8.2.90.0300.01017.54
8.2.80.0150.00517.45
8.2.70.0150.00517.55
8.2.60.0170.00317.44
8.2.50.0210.00617.23
8.2.40.0170.00617.44
8.2.30.0200.00217.28
8.2.20.0150.00517.49
8.2.10.0130.00417.51
8.2.00.0150.00417.41

preferences:
27.82 ms | 403 KiB | 5 Q