3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $phone = '0312345678'; $phone = '09012345678'; echo strlen($phone), "\n"; $return[] = substr($phone, -4); $return[] = substr($phone, -4, 8); echo $phone, "\n"; var_dump($return);
based on ZsgLV
Output for 5.5.0 - 7.3.0rc4
11 09012345678 array(2) { [0]=> string(4) "5678" [1]=> string(4) "5678" }