3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "23 St John Apt 92 rer 4, Wellington Country Block 5 No value test 54545 tt 232"; echo preg_replace_callback( '/\b(?:Ap(?:artmen)?t|Block|Department|Lot|Number|Villa)\s*\K\d{1,3}\b/i', fn($m) => sprintf('%04s', $m[0]), $str );
Output for git.master, git.master_jit, rfc.property-hooks
23 St John Apt 0092 rer 4, Wellington Country Block 0005 No value test 54545 tt 232

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:
33.75 ms | 405 KiB | 5 Q