3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $in = "10001101"; $out = preg_split('/(?:(.)(?!\1|$)\K)/', $in); print_r($out);
based on rM4Ip
Output for 5.6.13 - 7.2.0
Array ( [0] => 1 [1] => 000 [2] => 11 [3] => 0 [4] => 1 )
Output for 5.3.19 - 5.6.12
Array ( [0] => 1 [1] => 000 [2] => 11 [3] => 01 )