3v4l.org

run code in 300+ PHP versions simultaneously
<?php function parseDbString(string $value = 'Looking for a good {{ $pippo }}'){ $pippo='Pizza'; return preg_replace_callback('/{{(.*?)}}/', function($res) use ($pippo) { return $res;//trim($res[1]); // $val=${trim($res[1])}; Returns "Undefined variable: $pippo" $val=${trim($res[1])}; // Returns "Looking for a good Pizza" return isset($val) ? $val : $res[0]; },$value); } var_dump(parseDbString());
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Array to string conversion in /in/n45ZN on line 5 string(24) "Looking for a good Array"

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