3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getParts() { return json_decode(<<<EOF [ { "name": "lorem ipsum", "category": "hi", "quantity": "2", "price": "55", "id": 1756378, "shelf": "30", "slot": "173" }, { "name": "foo bar", "category": "there", "quantity": "2", "price": "90", "id": 1181335, "shelf": "", "slot": "" } ] EOF , true); } function getPartByName($name) { $matches = []; $parts = getParts(); foreach ($parts as $part) { if (str_starts_with($part['name'], $name)) { $matches[] = $part; } } return $matches; } print_r(getPartByName('lorem'));

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.140.0100.01017.45
8.4.130.0150.00517.77
8.4.120.0130.00724.37
8.4.110.0160.00320.67
8.4.100.0070.00317.86
8.4.90.0090.00717.80
8.4.80.0100.01117.48
8.4.70.0110.00517.75
8.4.60.0130.00719.02
8.4.50.0120.00819.25
8.4.40.0130.00617.77
8.4.30.0100.01022.50
8.4.20.0170.00319.67
8.4.10.0050.00522.00
8.3.260.0060.00316.45
8.3.250.0130.00616.83
8.3.240.0100.00817.38
8.3.230.0120.00916.75
8.3.220.0140.00716.68
8.3.210.0110.00718.17
8.3.200.0040.00516.73
8.3.190.0120.00617.29
8.3.180.0060.00416.60
8.3.170.0090.00917.07
8.3.160.0060.01316.73
8.3.150.0180.00020.72
8.3.140.0000.00816.72
8.3.130.0050.00318.33
8.3.120.0070.01119.17
8.3.110.0070.01120.94
8.3.100.0170.00316.79
8.3.90.0090.00626.77
8.3.80.0090.00018.43
8.3.70.0150.00318.30
8.3.60.0140.00720.19
8.3.50.0100.00718.53
8.3.40.0070.01020.33
8.3.30.0070.00720.39
8.3.20.0070.00024.18
8.3.10.0040.01124.66
8.3.00.0040.00426.16
8.2.290.0140.00420.45
8.2.280.0080.00718.73
8.2.270.0060.01317.33
8.2.260.0100.01022.22
8.2.250.0080.00018.43
8.2.240.0030.00618.83
8.2.230.0040.00422.58
8.2.220.0030.00616.48
8.2.210.0090.00026.77
8.2.200.0030.00616.75
8.2.190.0150.00616.75
8.2.180.0070.01116.63
8.2.170.0060.00918.95
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0050.00224.66
8.2.130.0040.00426.16
8.2.120.0080.00021.96
8.2.110.0090.00020.47
8.2.100.0040.00717.97
8.2.90.0050.00318.03
8.2.80.0030.00618.95
8.2.70.0040.00479.33
8.2.60.0110.00779.33
8.2.50.0090.00979.33
8.2.40.0090.00779.33
8.2.30.0170.00079.33
8.2.20.0020.00779.33
8.2.10.0150.00379.33
8.2.00.0150.00579.33
8.1.330.0110.00716.69
8.1.320.0110.00816.14
8.1.310.0080.00016.66
8.1.300.0090.00018.34
8.1.290.0090.00030.84
8.1.280.0120.00925.92
8.1.270.0050.00324.66
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0060.00323.88
8.1.230.0080.00422.63
8.1.220.0000.00917.74
8.1.210.0000.00818.77
8.1.200.0100.01079.33
8.1.190.0130.00479.33
8.1.180.0000.01779.33
8.1.170.0150.00879.33
8.1.160.0130.00479.33
8.1.150.0130.00379.33
8.1.140.0100.00579.33
8.1.130.0130.00379.33
8.1.120.0160.00079.33
8.1.110.0110.00579.33
8.1.100.0110.00579.33
8.1.90.0160.00079.33
8.1.80.0120.00579.33
8.1.70.0130.00379.33
8.1.60.0050.01479.33
8.1.50.0090.00979.33
8.1.40.0100.00879.33
8.1.30.0090.00979.33
8.1.20.0110.00779.33
8.1.10.0150.00379.33
8.1.00.0120.00679.33
8.0.300.0040.00420.00
8.0.290.0120.00479.33
8.0.280.0160.00079.33
8.0.270.0130.00379.33
8.0.260.0080.00879.33
8.0.250.0030.01379.33
8.0.240.0050.01179.33
8.0.230.0160.00079.33
8.0.220.0110.00679.33
8.0.210.0120.00979.33
8.0.200.0120.00879.33
8.0.190.0130.00579.33
8.0.180.0070.01379.33
8.0.170.0140.00579.33
8.0.160.0130.00479.33
8.0.150.0120.00479.33
8.0.140.0120.00579.33
8.0.130.0130.00379.33
8.0.120.0110.00679.33
8.0.110.0160.00079.33
8.0.100.0160.00079.33
8.0.90.0160.00079.33
8.0.80.0130.00379.33
8.0.70.0180.00079.33
8.0.60.0140.00379.33
8.0.50.0160.00079.33
8.0.30.0130.00379.33
8.0.20.0100.00779.33
8.0.10.0080.00879.33

preferences:
28.39 ms | 403 KiB | 5 Q