3v4l.org

run code in 300+ PHP versions simultaneously
<?php function maskString($string) { return preg_replace('/(?<=.).(?=.*)/u','*',$string); } function maskEmail($email) { $arremail = explode('@',$email); $arrdomain = explode('.',$arremail[1]); $jumdomain = count($arrdomain); echo $jumdomain; $dom = array(); for($i=0; $i<$jumdomain-1; $i++) { $dom[] = maskString($jumdomain[$i]); } $domain = implode('.',$dom); //$email1 = preg_replace('/(?<=.).(?=.*@)/u','*',$arremail[0].'@'); //$email2 = preg_replace('/(?<=.).(?=.*[.])/u','*',$arremail[1]); //return $email1.$email2; return maskString($arremail[0]).'@'.$domain; } $email = 'facebook@yahoo.co.id'; $result = maskEmail($email); echo $result;
Output for git.master, git.master_jit
3 Warning: Trying to access array offset on value of type int in /in/gkCEi on line 16 Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /in/gkCEi on line 4 Warning: Trying to access array offset on value of type int in /in/gkCEi on line 16 Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /in/gkCEi on line 4 f*******@.
Output for rfc.property-hooks
3 Warning: Trying to access array offset on int in /in/gkCEi on line 16 Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /in/gkCEi on line 4 Warning: Trying to access array offset on int in /in/gkCEi on line 16 Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /in/gkCEi on line 4 f*******@.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
44.78 ms | 401 KiB | 8 Q