3v4l.org

run code in 300+ PHP versions simultaneously
<?php $origin = ['value1', 'value2', 'value3', '-2', '2', '22']; $replace_map = [ 'value1' => 'replace1', 'value2' => 'replace2', 'value8' => 'replace8', 2 => 77 ]; var_export( array_map( function($value) use ($replace_map) { return str_replace( array_keys($replace_map), array_values($replace_map), $value ); }, $origin ) );
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => 'replace1', 1 => 'replace77', 2 => 'value3', 3 => '-77', 4 => '77', 5 => '7777', )

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