First of all, I would take several days to read the most important pages on OWASP to understand hopefully all threats that will keep you busy for the next decade. Even if you learn a framework, this comes first. https://owasp.org/www-project-top-ten/
PHP versions don’t differ much. Some features are introduced, some deprecated, some ended.
You should not learn or use any version prior to 7.1