3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lookup = [ 'Name' => 'Joseph', 'Name_en' => 'Joe', 'Name_es' => 'Jose', '19' => 'age', '2019' => 'year', '20' => 'next birthday', ]; $str = "Name : Name_en, 2019 19 20"; $subpattern = implode('|', array_map('preg_quote', array_keys($lookup))); echo preg_replace_callback( "#\b($subpattern)\b#", fn($m) => $lookup[$m[0]], $str );

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.5.30.0090.00921.26
8.5.20.0090.00720.12
8.5.10.0110.00618.65
8.5.00.0130.00820.07
8.4.180.0060.00519.82
8.4.170.0130.00823.82
8.4.160.0130.01323.77
8.4.150.0080.00416.93
8.4.140.0100.01117.70
8.4.130.0060.00318.01
8.4.120.0130.00720.39
8.4.110.0130.00722.49
8.4.100.0090.01318.09
8.4.90.0120.00917.90
8.4.80.0130.00617.93
8.4.70.0120.00618.04
8.4.60.0140.00318.63
8.4.50.0080.00117.93
8.4.40.0030.00617.84
8.4.30.0100.01018.77
8.4.20.0160.00321.63
8.4.10.0000.00819.80
8.3.300.0120.00922.68
8.3.290.0110.01118.53
8.3.280.0100.00918.54
8.3.270.0090.01116.51
8.3.260.0010.00816.61
8.3.250.0070.01119.16
8.3.240.0140.00516.61
8.3.230.0110.00916.56
8.3.220.0050.00317.23
8.3.210.0080.00916.82
8.3.200.0140.00516.63
8.3.190.0100.00917.16
8.3.180.0140.00616.54
8.3.170.0120.00620.64
8.3.160.0090.00917.49
8.3.150.0030.01417.20
8.3.140.0040.00419.21
8.3.130.0040.00418.44
8.3.120.0140.00719.00
8.3.110.0100.01020.94
8.3.100.0140.00724.06
8.3.90.0060.00926.77
8.3.80.0060.00318.43
8.3.70.0250.00616.58
8.3.60.0240.00416.58
8.3.50.0080.00316.63
8.3.40.0230.00417.34
8.3.30.0150.00917.38
8.3.20.0190.00317.63
8.3.10.0180.00317.50
8.3.00.0180.00517.50
8.2.300.0090.01018.72
8.2.290.0130.00520.46
8.2.280.0090.01018.70
8.2.270.0030.00617.55
8.2.260.0130.00718.23
8.2.250.0040.00418.57
8.2.240.0070.00417.04
8.2.230.0070.00422.58
8.2.220.0060.01337.54
8.2.210.0080.00026.77
8.2.200.0040.00418.54
8.2.190.0200.00816.58
8.2.180.0180.00716.58
8.2.170.0260.00017.72
8.2.160.0200.00417.75
8.2.150.0200.00517.50
8.2.140.0180.00617.50
8.2.130.0150.00917.36
8.2.120.0090.01917.50
8.2.110.0240.00017.63
8.2.100.0190.00417.38
8.2.90.0220.00517.50
8.2.80.0210.00317.38
8.2.70.0220.00417.09
8.2.60.0240.00017.50
8.2.50.0180.00417.38
8.2.40.0260.00017.50
8.2.30.0150.01517.50
8.2.20.0280.00417.25
8.2.10.0310.00317.50
8.2.00.0200.01017.50
8.1.340.0120.00817.90
8.1.330.0100.01116.94
8.1.320.0120.00618.48
8.1.310.0040.00416.52
8.1.300.0030.00617.97
8.1.290.0040.00730.84
8.1.280.0310.00016.58
8.1.270.0200.00917.38
8.1.260.0240.01017.13
8.1.250.0210.00917.25
8.1.240.0190.00517.50
8.1.230.0150.00617.50
8.1.220.0200.00317.50
8.1.210.0230.00717.09
8.1.200.0220.00417.25
8.1.190.0200.00417.25
8.1.180.0160.00517.25
8.1.170.0190.00317.38
8.1.160.0200.00817.25
8.1.150.0180.00317.34
8.1.140.0260.00017.38
8.1.130.0210.00717.47
8.1.120.0250.00017.21
8.1.110.0180.00717.35
8.1.100.0230.00417.47
8.1.90.0190.00617.35
8.1.80.0210.00317.47
8.1.70.0170.00717.25
8.1.60.0230.00617.23
8.1.50.0100.01317.47
8.1.40.0200.00817.34
8.1.30.0230.00417.25
8.1.20.0250.00817.63
8.1.10.0280.00317.59
8.1.00.0150.01017.33

preferences:
50.8 ms | 983 KiB | 5 Q