Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php 7.4 #534

Closed
petermoo opened this issue Mar 29, 2020 · 3 comments · May be fixed by #535
Closed

php 7.4 #534

petermoo opened this issue Mar 29, 2020 · 3 comments · May be fixed by #535

Comments

@petermoo
Copy link

petermoo commented Mar 29, 2020

Is there a Twig compatible with PHP 7.4 and PicoCMS 2.1.1?

Deprecated: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in vendor/twig/twig/lib/Twig/Node.php on line 42

Deprecated: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in vendor/twig/twig/lib/Twig/Node.php on line 198
@petermoo
Copy link
Author

A quick look at Twig 1, 2, and 3. Twig 3 requires PHP 7.2. Twig 2 requires PHP 7.0. PicoCMS version 2.1.1 requires PHP 5.3.6 and seems to work with PHP 7.4 except for the Twig problem. I will modify the Twig code and continue testing.

@PhrozenByte
Copy link
Collaborator

PhrozenByte commented Mar 29, 2020

Instead of modifying Twig's source code, I'd rather recommend one of the following:

  1. Simply hide the deprecation notice. It's no error, it's just PHP telling you that Twig is kinda outdated, so you can safely ignore it. You can do the same as described in Trying to access array offset on value of type null #528.

  2. Since the issues with our old dependencies kinda got out of hand lately (see Trying to access array offset on value of type null #528 again 😅), it's probably about time to kick-start the development of Pico 3.0. It likely won't get as big as described in Pico 4.0 and beyond #317, but the most important thing is upgrading Pico's dependencies. We'll likely upgrade to Twig 3 and Symfony YAML 5 and thus require PHP 7.2 in the future (but that's too much work for a quick fix). Since page loading still is an rather big issue with Pico we'll likely also go for lazy page discovery and loading. But that's it.

    Since you probably don't want to wait a few months, I've just created Pico v3.0.0-alpha.1. The only change is upgrading to Twig 2.12 and Symfony YAML 3.4 (thus it requires PHP 7.0.8+). Both are still officially supported and are mostly drop-in replacements ("mostly" means "should work for most users", there can still be some issues for you), since they maintain BC on a best-effort basis. Alpha 1 is meant as a fast solution for you, we'll upgrade to Twig 3 and Symfony YAML 5 later (which definitely will break BC). If you're going to try it out, please let me know about your experiences.

    Same is true for anyone else - feedback is highly appreciated! ❤️

@petermoo
Copy link
Author

Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants