There is a typo in the second var $realpath !== $realPath