3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array( 'Dup.A.123' => 1, 'D' => 4, ); $replacements = array( 'A.123' => 'A123', 'Dup.A' => 'DD', ); foreach (array_keys($array) as $key) { foreach ($replacements as $from => $to) { if (!strncmp($key, $from, strlen($from))) { $rkey = $to . substr($key, strlen($from)); $array[] = $array[$key]; unset($array[$key]); } } } print_r($array);
Output for 5.4.0 - 5.4.21
Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW) in /in/v8MRb on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_DOUBLE_ARROW in /in/v8MRb on line 3
Process exited with code 255.