3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo "<pre>"; $A = "µPhysik I~1µ"; $Ar = explode("µµ", substr($A, 1, -1)); print_r($Ar); $A = count($Ar) > 0 ? "µ".implode("µµ", $Ar)."µ" : ""; print_r($A); $Ar = explode("µµ", substr($A, 1, -1)); print_r($Ar); print_r(explode("~", $Ar[0])); $A = count($Arrr) > 0 ? "µ".implode("µµ", $Arrr)."µ" : ""; print_r($A); echo "</pre>";
based on 3qBf3
Output for 5.0.4 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
<pre>Array ( [0] => �Physik I~1� ) µ�Physik I~1�µArray ( [0] => ��Physik I~1�� ) Array ( [0] => ��Physik I [1] => 1�� ) Notice: Undefined variable: Arrr in /in/bpsug on line 11 </pre>
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.0 - 5.0.3
<pre>Array ( [0] => �Physik I~1� ) µ�Physik I~1�µArray ( [0] => ��Physik I~1�� ) Array ( [0] => ��Physik I [1] => 1�� ) Notice: Undefined variable: Arrr in /in/bpsug on line 11 </pre>