3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function checkOGRN($ogrn){ if (strlen($ogrn) == 13) { $verify_num = intval(substr($ogrn, 0, 12)); $check_num = intval(substr($ogrn, -1)); $res_num = $verify_num % 11; if ($res_num > 9) $res_num - round($res_num/10)*10; if ($result == $check) return true; } elseif (strlen($ogrn) == 15) { $verify_num = intval(substr($ogrn, 0, 14)); $check_num = intval(substr($ogrn, -1)); $res_num = $verify_num % 13; if ($res_num > 9) $res_num - round($res_num/10)*10; if ($result == $check) return true; } else return false; } print_r(checkOGRN('311333426300144'));
based on YEadJ
Output for 5.0.4 - 5.0.5, 7.0.0 - 7.1.0
Notice: Undefined variable: result in /in/FJRml on line 14 Notice: Undefined variable: check in /in/FJRml on line 14 1
Output for 5.1.0 - 5.6.28
Notice: Undefined variable: check in /in/FJRml on line 14 Notice: Undefined variable: result in /in/FJRml on line 14 1
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: result in /in/FJRml on line 14 Notice: Undefined variable: check in /in/FJRml on line 14 1