3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = array( 'Bag' => 'Cart', 'Cart' => 'Bag', ); $strings = 'Bag Cart Cart Bag Miscellaneous'; $strings = implode(" ", array_map(fn($v) => $text[$v] ?? $v, explode(" ", $strings))); echo $strings;

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.140.0000.00716.53
8.3.130.0030.00618.50
8.3.120.0030.00618.86
8.3.110.0000.01120.94
8.3.100.0040.00418.37
8.3.90.0110.00426.77
8.3.80.0100.00018.18
8.3.70.0090.00616.75
8.3.60.0000.01518.30
8.3.50.0170.00316.42
8.3.40.0110.00620.39
8.3.30.0100.00320.50
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0030.00526.16
8.2.250.0040.00416.89
8.2.240.0080.00017.27
8.2.230.0080.00022.58
8.2.220.0060.00324.06
8.2.210.0070.00726.77
8.2.200.0060.00317.00
8.2.190.0090.00916.60
8.2.180.0170.00316.88
8.2.170.0070.00722.96
8.2.160.0100.00322.96
8.2.150.0050.00225.66
8.2.140.0150.00024.66
8.2.130.0030.00521.12
8.2.120.0030.00726.16
8.2.110.0060.00321.03
8.2.100.0040.01117.97
8.2.90.0040.00417.75
8.2.80.0040.00818.79
8.2.70.0030.00517.63
8.2.60.0110.00717.50
8.2.50.0100.00617.13
8.2.40.0000.01617.60
8.2.30.0180.00017.59
8.2.20.0140.00317.46
8.2.10.0090.00917.38
8.2.00.0170.00017.25
8.1.300.0030.00616.38
8.1.290.0070.00330.84
8.1.280.0060.00925.92
8.1.270.0120.00624.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0120.00921.93
8.1.230.0070.00420.85
8.1.220.0000.00918.63
8.1.210.0000.00918.77
8.1.200.0040.00717.35
8.1.190.0100.00717.23
8.1.180.0130.00416.88
8.1.170.0050.01017.25
8.1.160.0120.00517.10
8.1.150.0130.00317.10
8.1.140.0100.00717.38
8.1.130.0100.00717.00
8.1.120.0070.01017.38
8.1.110.0120.00417.25
8.1.100.0110.00617.13
8.1.90.0160.00017.34
8.1.80.0110.00817.38
8.1.70.0130.00317.10
8.1.60.0120.00617.50
8.1.50.0140.00517.36
8.1.40.0140.00617.23
8.1.30.0110.00717.36
8.1.20.0110.00817.50
8.1.10.0040.01317.25
8.1.00.0110.00717.13
8.0.300.0070.00020.02
8.0.290.0000.00716.75
8.0.280.0120.00516.75
8.0.270.0050.01016.52
8.0.260.0100.00516.71
8.0.250.0100.00716.52
8.0.240.0100.00716.71
8.0.230.0110.00516.84
8.0.220.0160.00016.63
8.0.210.0090.00916.52
8.0.200.0100.00716.52
8.0.190.0100.00716.61
8.0.180.0000.01616.52
8.0.170.0160.00016.73
8.0.160.0170.00016.52
8.0.150.0080.00816.60
8.0.140.0100.00716.52
8.0.130.0100.00516.52
8.0.120.0160.00016.75
8.0.110.0110.00516.63
8.0.100.0120.00416.63
8.0.90.0110.00516.63
8.0.80.0100.00716.63
8.0.70.0170.00016.52
8.0.60.0140.00316.52
8.0.50.0170.00016.73
8.0.30.0160.00316.63
8.0.20.0150.00316.52
8.0.10.0140.00316.52

preferences:
15.4 ms | 403 KiB | 5 Q