3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Variable to check $emailA = "john1.doe@example.com"; $emailB = "john1.doe@example#.com"; // Remove all illegal characters from email $emailValid = filter_var($emailA, FILTER_SANITIZE_EMAIL); $emailInvalid = filter_var($emailB, FILTER_SANITIZE_EMAIL); // Validate e-mail if (filter_var($emailValid, FILTER_VALIDATE_EMAIL)) { echo("$emailValid is a valid email address"),"\n"; } else { echo("$emailValid is not a valid email address"); } if (filter_var($emailInvalid, FILTER_VALIDATE_EMAIL)) { echo("$emailInvalid is a valid email address"); } else { echo("$emailInvalid is not a valid email address"); }
Output for git.master, git.master_jit, rfc.property-hooks
john1.doe@example.com is a valid email address john1.doe@example#.com is not a valid email address

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:
154.31 ms | 405 KiB | 5 Q