3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "My starting year is {{current_year}} and my grad year is {{grad_year}}"; array_walk([ // List of placeholders and their values "{{current_year}}" => date("Y"), "{{grad_year}}" => date("Y") + 4 ], function($value, $key) use ($string) { $string = str_replace($key, $value, $string); }); echo $string;
Output for git.master_jit, git.master
Fatal error: Uncaught Error: array_walk(): Argument #1 ($array) could not be passed by reference in /in/gEv82:6 Stack trace: #0 {main} thrown in /in/gEv82 on line 6
Process exited with code 255.

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