3v4l.org

run code in 300+ PHP versions simultaneously
<?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); } if(checkOGRN('311333426300144')) echo 'OK'; else echo 'Error';
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $check in /in/v4bSL on line 14 Error

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
51.81 ms | 401 KiB | 8 Q