$ 0 0 What version of PHP are you using? As of PHP 7.2 method count will throw an error if you try to use it on an unset variable.