3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $separator = ' '; $old_string = 'abc def'; $new_tag = 'abc'; $tags = explode($separator, $old_string); $diffTags = array_diff($tags, array($new_tag)); var_dump(join($separator, $diffTags) . $separator . $new_tag); var_dump($tags == $diffTags);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(7) "def abc" bool(false)