3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "Hello {first_name}, from {company}. This is your email address: {email}. Your application for {team} has been approved."; $placeholders = ["company" => "contoso inc", "name" => "john doe", "email" => "me@contoso.com"]; echo preg_replace_callback('/\s*\{([^{}}]*)\}/', function ($match) use ($placeholders) { return isset($placeholders[$match[1]]) ? " " . $placeholders[$match[1]] : ""; }, $text);
Output for git.master, git.master_jit, rfc.property-hooks
Hello, from contoso inc. This is your email address: me@contoso.com. Your application for has been approved.

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