3v4l.org

run code in 300+ PHP versions simultaneously
<?php // questo test è stato usato nel 2002 // lo si vuole avere aggiornato per il 2003 $text = "April fools day is 04/01/2002\n"; $text.= "Last christmas was 12/24/2001\n"; // la funzione di callback function next_year($matches) { // come solito: $matches[0] è il testo riconosciuto completo // $matches[1] la parte riconosciuta per il primo criterio // racchiuso in '(...)' e così via return $matches[1].($matches[2]+1); } echo preg_replace_callback( "|(\d{2}/\d{2}/)(\d{4})|", "next_year", $text); // il risultato sarà: // April fools day is 04/01/2003 // Last christmas was 12/24/2002 ?>
Output for git.master, git.master_jit, rfc.property-hooks
April fools day is 04/01/2003 Last christmas was 12/24/2002

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