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 - Trying to access array offset on value of type bool #722

Open
landbryo opened this issue Mar 5, 2020 · 5 comments
Open

PHP 7.4 - Trying to access array offset on value of type bool #722

landbryo opened this issue Mar 5, 2020 · 5 comments

Comments

@landbryo
Copy link

landbryo commented Mar 5, 2020

I was getting a bunch of notices that I couldn't ignore. Looked into this notice a bit and it appears to be related to some changes in PHP 7.4. It should be a relatively easy fix that I'll go ahead and look into resolving.

( ! ) Notice: Trying to access array offset on value of type bool in option-tree\includes\class-ot-settings.php on line 395

Call Stack
#	Time	Memory	Function	Location
1	0.0002	363080	{main}( )	...\admin.php:0
2	3.4280	14123000	do_action( )	...\admin.php:170
3	3.4281	14123272	WP_Hook->do_action( )	...\plugin.php:478
4	3.4281	14123272	WP_Hook->apply_filters( )	...\class-wp-hook.php:312
5	5.4509	16605920	OT_Settings->add_sections( )	...\class-wp-hook.php:288
@codemonkeynorth
Copy link

codemonkeynorth commented Jan 18, 2021

Hi @landbryo

use Null Coalescing Operator ?? maybe?
https://stackoverflow.com/questions/59674903/trying-to-access-array-offset-on-value-of-type-bool-in-php-7-4

thanks
J

[update: sorry I see you've added a fix.. will this be deployed to the wordpress plugin repo at some point?)

@landbryo
Copy link
Author

@codemonkeynorth that would be a question for @valendesigns since he was going to review and potentially merge the fix.

@fellipeleao
Copy link

fellipeleao commented Nov 19, 2021

Thanks @landbryo, I implemented your change to my code and I'm not getting the notice anymore!

@crudoy
Copy link

crudoy commented Jun 19, 2023

Sorry, I'm confused. What was the fix? I'm getting the same error.

@landbryo
Copy link
Author

@crudoy you can view the proposed fix here, but it hasn't been merged yet, so you'd have to manually apply it.

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

4 participants