3v4l.org

run code in 200+ 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 7.2.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 Warning: count(): Parameter must be an array or an object that implements Countable in /in/bpsug on line 11 </pre>
Output for 5.0.4 - 7.1.10
<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 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>