3v4l.org

run code in 300+ PHP versions simultaneously
<?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);
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Warning: Undefined variable $phone in /in/hisN5 on line 3 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/hisN5 on line 3 Warning: Undefined variable $m in /in/hisN5 on line 7 Deprecated: mb_substr(): Passing null to parameter #1 ($string) of type string is deprecated in /in/hisN5 on line 7 13290052201*****
Output for 8.0.0 - 8.0.30
Warning: Undefined variable $phone in /in/hisN5 on line 3 Warning: Undefined variable $m in /in/hisN5 on line 7 13290052201*****
Output for 7.0.12 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.25, 7.4.27 - 7.4.33
Notice: Undefined variable: phone in /in/hisN5 on line 3 Notice: Undefined variable: m in /in/hisN5 on line 7 13290052201*****
Output for 7.3.32 - 7.3.33, 7.4.26
13290052201*****
Output for 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 *****

preferences:
193.21 ms | 401 KiB | 183 Q