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

Undefined array keys warnings. #924

Open
jackie-t opened this issue Jan 8, 2024 · 2 comments
Open

Undefined array keys warnings. #924

jackie-t opened this issue Jan 8, 2024 · 2 comments

Comments

@jackie-t
Copy link

jackie-t commented Jan 8, 2024

Hey guys,

Just a quick question, because I updated to PHP 8 and had "undefined array key" warnings all over the place.
I didn't see anything in the notes, so I checked the Smarty code, and I found there is a muteUndefinedOrNullWarnings() that I can call. It says it's for "PHP7 compatibility mode", but I guess it's also needed for PHP8? PHP7 is EOL now anyway.

While I can do that, and it removes the warnings, this is hacky as all hell. Instead of doing isset() using this function installs a custom error handler, that preg_matches the error messages and ignores them, if they look like the messages above.

Am I doing something wrong? Where is this project headed, anyway? I mean, I'm not too involved into the code, so I wouldn't know where in the template generation the isset needs to go, but is this even worth investing time anymore? The smarty website has casino spam all over its front page, the code feels like an old shed held together by duct tape lol so it just kind of but barely performs still.

@barisyazganc
Copy link

Hi,

I have the same problem,

muteUndefinedOrNullWarnings() works great for php version below 8.3, i accidently updated to 8.3 and it doesnt work anymore because even it works internally for smarty, php throws warnings unless i set display_errors to 0

any idea?

@wisskid
Copy link
Contributor

wisskid commented Jan 23, 2024

Hi,

I have the same problem,

muteUndefinedOrNullWarnings() works great for php version below 8.3, i accidently updated to 8.3 and it doesnt work anymore because even it works internally for smarty, php throws warnings unless i set display_errors to 0

any idea?

Should have been fixed in latest 4.3 release!

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

No branches or pull requests

3 participants