3v4l.org

run code in 300+ PHP versions simultaneously
<?php $email = \"abc123@lolhaha\"; // Invalid email address //$email = \"somebody@somesite.com\"; // Valid email address // Set up regular expression strings to evaluate the value of email variable against $regex = '/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/'; // Run the preg_match() function on regex against the email address if (preg_match($regex, $email)) { echo $email . \" is a valid email. We can accept it.\"; } else { echo $email . \" is an invalid email. Please try again.\"; }
Output for 5.4.0 - 5.4.24
Parse error: syntax error, unexpected '"', expecting identifier (T_STRING) in /in/9GGBo on line 2
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected '"', expecting T_STRING in /in/9GGBo on line 2
Process exited with code 255.

preferences:
178.69 ms | 1395 KiB | 61 Q