3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/(\bLAB_[0-9A-F]{2}\b)|(\bLAB_[0-9A-F]{4}\b)/'; $str = 'LAB_FF12'; preg_match($re, $str, $matches); var_dump($matches); $substitutes = ["", "DAB", "HAD"]; For($i=1; $i<count($matches); $i++){ If($matches[$i] != ""){ $result = $substitutes[$i] . substr($matches[$i],3); Break; } } Echo $result;
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { [0]=> string(8) "LAB_FF12" [1]=> string(0) "" [2]=> string(8) "LAB_FF12" } HAD_FF12

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