3v4l.org

run code in 200+ 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; } elseif (strlen($ogrn) == 15) { $verify_num = intval(substr($ogrn, 0, 14)); $check_num = intval(substr($ogrn, -1)); $res_num = $verify_num % 13; } else return false; if ($res_num > 9) $res_num = $res_num - round($res_num/10)*10; return ($res_num == $check); } print_r(checkOGRN('311333426300144'));
based on UoWeh
Output for 5.0.4 - 7.1.7
Notice: Undefined variable: check in /in/ZLF04 on line 14
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: check in /in/ZLF04 on line 14