Optimized php check

Fixed in new branch