3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $email = 'none'; $user = strstr($email, '@', true); // As of PHP 5.3.0 var_dump($user); // prints name echo PHP_EOL; $email = 'MAIL@ME!'; $user = strstr($email, '@', true); // As of PHP 5.3.0 var_dump($user); // prints name
based on GbfrP
Output for 5.3.0 - 7.2.0
bool(false) string(4) "MAIL"
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.0.5, 5.1.1 - 5.2.17
Warning: Wrong parameter count for strstr() in /in/WTkmM on line 3 NULL Warning: Wrong parameter count for strstr() in /in/WTkmM on line 9 NULL
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/WTkmM on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Warning: Wrong parameter count for strstr() in /in/WTkmM on line 3 NULL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/WTkmM on line 6 PHP_EOL Warning: Wrong parameter count for strstr() in /in/WTkmM on line 9 NULL