3v4l.org

run code in 300+ PHP versions simultaneously
<?php $filename = '{date:Ymd:-4 day}trac{date2:Ymd:-1 day}king{date:Ymd:-1 day}'; $modifiers = array(); preg_match_all('|\{([^\}]+)\}|', $filename, $modifiers); foreach ($modifiers[1] as $id => $modifier) { $args = explode(':', $modifier); $method = array_shift($args); if ($method == 'date' && count($args)) { $replacement = count($args) == 2 ? date($args[0], strtotime($args[1])) : date($args[0]); $filename = str_replace($modifiers[0][$id], $replacement, $filename); } } echo $filename;
Output for git.master, git.master_jit, rfc.property-hooks
20140530trac{date2:Ymd:-1 day}king20140602

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