3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $identifier = "a@z.com"; $identifier2 = "another"; echo "Original\n"; echo "B: " . (strpos($identifier, '@') === false ? 0 : 1) ."\n"; echo "B: " . (strpos($identifier2, '@') === false ? 0 : 1) ."\n"; echo "\n"; echo "Improve\n"; echo "B: " . ((int) strpos($identifier, '@') !== false) ."\n"; echo "B: " . ((int) strpos($identifier2, '@') !== false) ."\n";
Output for 4.3.0 - 7.1.0
Original B: 1 B: 0 Improve B: 1 B: 1