3v4l.org

run code in 300+ PHP versions simultaneously
<?php $vars = [ 'code_user' => 'Loz', 'code_order' => 5504 ]; $template = 'Dear [code_user] your new order code is [code_order]!'; $result = preg_replace_callback('/\[[ ]{0,}([\w\_-]{1,})[ ]{0,}\]/', function ($match) use ($vars) { return array_key_exists($match[1], $vars) ? $vars[$match[1]] : ''; }, $template); echo $result;
Output for git.master, git.master_jit, rfc.property-hooks
Dear Loz your new order code is 5504!

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:
20.15 ms | 401 KiB | 8 Q