TypeError thrown

dirname(): Argument #1 ($path) must be of type string, bool given