3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = '13290052201'; $string_length = mb_strlen($phone); $mark_length = 5; $head_length = ceil(($string-$mark_length)/2); $foot_length = $string_length-$head_length-$mark_length; echo mb_substr($string , 0, $head_length) . str_repeat('*', $mark_length) . mb_substr($m, -$foot_length, $foot_length);
based on WvC1A
Output for 5.6.26 - 5.6.30, 7.0.12 - 7.3.0alpha1
Notice: Undefined variable: phone in /in/hisN5 on line 3 Notice: Undefined variable: m in /in/hisN5 on line 7 13290052201*****
Output for 5.6.0 - 5.6.25, 7.0.0 - 7.0.11
Notice: Undefined variable: phone in /in/hisN5 on line 3 Notice: Undefined variable: m in /in/hisN5 on line 7 *****
Output for hhvm-3.15.4
Notice: Undefined variable: phone in /in/hisN5 on line 3 Warning: mb_strlen() expects parameter 1 to be string, null given in /in/hisN5 on line 3 Notice: Undefined variable: m in /in/hisN5 on line 7 Warning: mb_substr() expects parameter 1 to be string, null given in /in/hisN5 on line 7 *****