3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function isPhoneNumber($number) { return preg_match("/^\+[0-9]{2}\.[0-9]{10}$/", $phone); } var_dump(isPhoneNumber("+44.1202535689")); var_dump(isPhoneNumber("aaa+44.1202535689aa")); var_dump(isPhoneNumber("foo"));
Output for 5.0.4 - 5.6.28, hhvm-3.10.0, 7.0.0 - 7.1.0
Notice: Undefined variable: phone in /in/Bknp5 on line 4 int(0) Notice: Undefined variable: phone in /in/Bknp5 on line 4 int(0) Notice: Undefined variable: phone in /in/Bknp5 on line 4 int(0)
Output for hhvm-3.12.0
Notice: Undefined variable: phone in /in/Bknp5 on line -1 int(0) Notice: Undefined variable: phone in /in/Bknp5 on line -1 int(0) Notice: Undefined variable: phone in /in/Bknp5 on line -1 int(0)
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: phone in /in/Bknp5 on line 4 int(0) Notice: Undefined variable: phone in /in/Bknp5 on line 4 int(0) Notice: Undefined variable: phone in /in/Bknp5 on line 4 int(0)