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 5.4 code in a snippet #82

Open
slaFFik opened this issue Feb 17, 2018 · 2 comments
Open

PHP 5.4 code in a snippet #82

slaFFik opened this issue Feb 17, 2018 · 2 comments

Comments

@slaFFik
Copy link
Member

slaFFik commented Feb 17, 2018

This snippet: https://github.com/CMB2/CMB2-Snippet-Library/blob/master/options-and-settings-pages/options-pages-with-tabs-and-submenus.php - will work correctly on PHP 5.4 and above, because of this $cmb->options_page_keys()[0].

Older PHP will fatal.

@tw2113
Copy link
Contributor

tw2113 commented Oct 19, 2018

@slaFFik the way to get around this would be to assign to a variable first and then reference it via $somevar[0] correct?

@slaFFik
Copy link
Member Author

slaFFik commented Jan 13, 2019

@tw2113 yes, that's correct.

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

2 participants