3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array ( 'AZ' => array ( 1 => '2020-01', 2 => '2020-02' ), 'BY' => array ( 0 => '2020-03', 1 => '2020-04' ), 'CX' => array ( 1 => '2020-05', 2 => '2020-06', 3 => '2020-07' ), 'DW' => array ( 106 => '2019-01', 107 => '2019-02', 108 => '2019-03' ) ); array_walk_recursive($array, function (&$v) { $v = preg_replace('/^(\d{4})-\d\d$/', '$1', $v); }); print_r($array);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [AZ] => Array ( [1] => 2020 [2] => 2020 ) [BY] => Array ( [0] => 2020 [1] => 2020 ) [CX] => Array ( [1] => 2020 [2] => 2020 [3] => 2020 ) [DW] => Array ( [106] => 2019 [107] => 2019 [108] => 2019 ) )

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:
27.11 ms | 406 KiB | 5 Q