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, outlier 2019 19 20"; echo preg_replace_callback( "#\b\w+\b#", fn($m) => $lookup[$m[0]] ?? $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.0100.00821.21
8.5.20.0070.01020.11
8.5.10.0130.00518.77
8.5.00.0140.00720.25
8.4.180.0120.01019.94
8.4.170.0100.01223.88
8.4.160.0070.01523.73
8.4.150.0090.00416.84
8.4.140.0130.00817.83
8.4.130.0060.00317.97
8.4.120.0080.01020.57
8.4.110.0130.00918.91
8.4.100.0130.00818.01
8.4.90.0130.00817.64
8.4.80.0040.00518.24
8.4.70.0100.00619.84
8.4.60.0100.01118.70
8.4.50.0050.00318.22
8.4.40.0040.00417.78
8.4.30.0060.01319.00
8.4.20.0130.00721.47
8.4.10.0030.00619.63
8.3.300.0040.00520.85
8.3.290.0160.00820.95
8.3.280.0110.00818.67
8.3.270.0110.00916.85
8.3.260.0080.01016.79
8.3.250.0080.01018.88
8.3.240.0130.00616.86
8.3.230.0120.00916.52
8.3.220.0050.00317.22
8.3.210.0050.00316.54
8.3.200.0130.00616.80
8.3.190.0120.00816.98
8.3.180.0110.00816.67
8.3.170.0130.00620.54
8.3.160.0110.00717.13
8.3.150.0070.00717.21
8.3.140.0040.01518.95
8.3.130.0040.00416.54
8.3.120.0080.00020.53
8.3.110.0000.00818.54
8.3.100.0060.00316.61
8.3.90.0000.00826.77
8.3.80.0030.00618.43
8.3.70.0330.01216.58
8.3.60.0390.01016.63
8.3.50.0160.00616.84
8.3.40.0320.00917.63
8.3.30.0240.01017.75
8.3.20.0320.00617.59
8.3.10.0260.01317.38
8.3.00.0340.00317.36
8.2.300.0130.00818.57
8.2.290.0100.00820.48
8.2.280.0080.00918.86
8.2.270.0000.00816.91
8.2.260.0070.01118.68
8.2.250.0040.00416.97
8.2.240.0190.00017.00
8.2.230.0080.00020.94
8.2.220.0040.00424.06
8.2.210.0040.00426.77
8.2.200.0030.00618.66
8.2.190.0300.00316.59
8.2.180.0220.00016.58
8.2.170.0110.01118.00
8.2.160.0250.00017.73
8.2.150.0220.00517.61
8.2.140.0150.00917.63
8.2.130.0250.00317.63
8.2.120.0150.00917.59
8.2.110.0210.00417.38
8.2.100.0210.00317.47
8.2.90.0160.00817.88
8.2.80.0190.00517.88
8.2.70.0260.00617.36
8.2.60.0230.00017.87
8.2.50.0180.00317.63
8.2.40.0180.00317.75
8.2.30.0120.01217.38
8.2.20.0190.00417.37
8.2.10.0250.00017.63
8.2.00.0250.00017.50
8.1.340.0120.00821.82
8.1.330.0120.00716.89
8.1.320.0150.00418.13
8.1.310.0080.00017.02
8.1.300.0000.00818.41
8.1.290.0040.00430.84
8.1.280.0170.00616.58
8.1.270.0170.00817.48
8.1.260.0340.00617.13
8.1.250.0210.00317.36
8.1.240.0170.01117.48
8.1.230.0200.00617.38
8.1.220.0190.00317.35
8.1.210.0240.00717.38
8.1.200.0310.00617.25
8.1.190.0350.00417.38
8.1.180.0320.00017.13
8.1.170.0210.00517.34
8.1.160.0190.00017.47
8.1.150.0120.00917.23
8.1.140.0250.00417.25
8.1.130.0220.00617.23
8.1.120.0190.00517.38
8.1.110.0210.00317.50
8.1.100.0140.01017.50
8.1.90.0270.00017.11
8.1.80.0140.01017.13
8.1.70.0170.00717.00
8.1.60.0150.00817.50
8.1.50.0160.00517.47
8.1.40.0220.00017.46
8.1.30.0200.00717.50
8.1.20.0190.00717.60
8.1.10.0130.01017.36
8.1.00.0170.00617.32

preferences:
71.45 ms | 984 KiB | 5 Q