3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function is_odd($tmpnumber){ if ($tmpnumber < '0') $tmpnumber = gmp_mod($tmpnumber); if ($tmpnumber == '0') return(false); elseif ($tmpnumber == '1') return(true); elseif ($tmpnumber > '1'){ if (gmp_div_q($tmpnumber,'2') != '0') return(true); else return(false); } } var_dump(is_odd("123"));
Output for 5.4.10 - 5.5.34, 5.6.8 - 5.6.20, 5.6.28 - 7.0.5, 7.0.20 - 7.2.0
bool(true)
Output for 7.0.6
Fatal error: Uncaught Error: Call to undefined function gmp_div_q() in /in/dgBIW:9 Stack trace: #0 /in/dgBIW(14): is_odd('123') #1 {main} thrown in /in/dgBIW on line 9
Process exited with code 255.
Output for 5.3.20 - 5.3.29, 5.5.35, 5.6.21
Fatal error: Call to undefined function gmp_div_q() in /in/dgBIW on line 9
Process exited with code 255.