3v4l.org

run code in 300+ PHP versions simultaneously
<?php $name1 = 'no_gravity'; $name2 = 'n0_gr4v1ty'; function stringDiff($string1, $string2) { $x = str_split($string1); $y = str_split($string2); $diff = array_diff($x, $y); foreach ($diff as $letter) { $string1 = str_replace($letter, '-', $string1); } return $string1; } var_dump(stringDiff($name1, $name2));
Output for git.master, git.master_jit, rfc.property-hooks
string(10) "n-_gr-v-ty"

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.9 ms | 401 KiB | 8 Q