php8 compatibility?

680 views
Skip to first unread message

v.

unread,
Mar 31, 2021, 6:02:09 AM3/31/21
to Fat-Free Framework

Has anyone tested f3 on php 8 yet?

Tsab Xiong

unread,
Mar 31, 2021, 8:17:39 AM3/31/21
to v. via Fat-Free Framework
Yes, but all got error 

On Wed, Mar 31, 2021, 17:02 v. via Fat-Free Framework <f3-fra...@googlegroups.com> wrote:

Has anyone tested f3 on php 8 yet?

--
-- You've received this message because you are subscribed to the Google Groups group. To post to this group, send an email to f3-fra...@googlegroups.com. To unsubscribe from this group, send an email to f3-framework...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/f3-framework?hl=en
---
You received this message because you are subscribed to the Google Groups "Fat-Free Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to f3-framework...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/f3-framework/cb9f947d-92ca-4096-89d2-07bb15e72a48n%40googlegroups.com.

Paul Herring

unread,
Mar 31, 2021, 9:43:28 AM3/31/21
to v. via Fat-Free Framework
I just had another attempt - I don't think it's ready yet (the <check> I added in here after I previously got the same error, to see if I could mitigate it; obviously not):

Template code:
<check if="{{@META}}"><repeat group="{{@META}}" value="{{@M}}">
<meta name="{{@M.name}}" content="{{@M.content}}" />
</repeat></check>



After translation:
<?php if ($META): ?><?php foreach (($META?:[]) as $M): ?>
               <meta name="<?= ($M['name']) ?>" content="<?= ($M['content']) ?>" />
<?php endforeach; ?><?php endif; ?>

Error from front end:

Undefined variable $META

500: Internal Server Error

Error details:
[beerfax/lib/fatfree/lib/base.php:2347] Base->error()
[beerfax/tmp/1rimg6efy87ua.1agpg8w7zurmj.php:26] Base->{closure}()
[beerfax/lib/fatfree/lib/base.php:2908] require('/var/www/html/beerfax/tmp/1rimg6efy87ua.1agpg8w7zurmj.php')
[beerfax/lib/fatfree/lib/base.php:3152] View->sandbox()
[beerfax/app/resources/beerfax.php:166] Preview->render()
[beerfax/app/resources/user.php:489] MyApp->render()
[beerfax/lib/fatfree/lib/base.php:1960] User->login()
[beerfax/lib/fatfree/lib/base.php:1759] Base->call()
[beerfax/index.php:208] Base->run()


On Wed, Mar 31, 2021 at 11:02 AM v. via Fat-Free Framework <f3-fra...@googlegroups.com> wrote:

Has anyone tested f3 on php 8 yet?

--
-- You've received this message because you are subscribed to the Google Groups group. To post to this group, send an email to f3-fra...@googlegroups.com. To unsubscribe from this group, send an email to f3-framework...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/f3-framework?hl=en
---
You received this message because you are subscribed to the Google Groups "Fat-Free Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to f3-framework...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/f3-framework/cb9f947d-92ca-4096-89d2-07bb15e72a48n%40googlegroups.com.


--
PJH

ikkez

unread,
Apr 1, 2021, 6:44:00 AM4/1/21
to Fat-Free Framework
lower your error_reporting setting or use the correct existence check: <check if="isset(@META)">

Paul Herring

unread,
Apr 1, 2021, 10:37:51 AM4/1/21
to ikkez über Fat-Free Framework
> lower your error_reporting setting

Just had to do that in two separate places so far (since doing it after require('base.php') seemingly wasn't enough,) until I just hit #1220

> or use the correct existence check: <check if="isset(@META)">




--
PJH

ikkez

unread,
Apr 1, 2021, 1:08:19 PM4/1/21
to Fat-Free Framework
Well perhaps this is more a personal preference, but I like it more to fail hard if something is missing than to silently skip something. So actually it woud be better to define that missing variable with NULL before rendering the template.. in that way your <check if="{{@META}}"> would be fine. If you dont like that nor the isset check or the adjusted error reporting setting, you can also ignore the error here with a double @  like <check if="{{@@META}}"> .. that would work as well

v.

unread,
Apr 2, 2021, 4:34:16 AM4/2/21
to Fat-Free Framework
So I have tested PHP8 compatibility with my Fat Free Login script.
F3 seems to be working, I had to modify my script with additional isset-checks for it to work.
Reply all
Reply to author
Forward
0 new messages