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 );
Output for git.master, git.master_jit, rfc.property-hooks
Joseph : Joe, outlier year age next birthday

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
43.74 ms | 984 KiB | 4 Q