3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'I loved you'; $from = 'love'; $to = 'lOvE'; var_dump($result1 = strtr($str, $from, $to)); var_dump($result2 = strtr($str, [$from[0] => $to[0], $from[1] => $to[1], $from[2] => $to[2], $from[3] => $to[3]])); var_dump($result2 = strtr($str, [$from => $to])); var_dump($result1===$result2);//false
Output for git.master, git.master_jit, rfc.property-hooks
string(11) "I lOvEd yOu" string(11) "I lOvEd yOu" string(11) "I lOvEd you" bool(false)

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