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

Improve example code to read ini shorthand #3084

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PPazderski
Copy link

The existing example code cannot handle any later added shorthand formats and is simply outdated when a dedicated standard function exists.

the existing example cannot handle any later added shorthand formats and is simply outdated when a dedicated standard function exists

return $val;
}
echo 'post_max_size in bytes = ' . ini_parse_quantity(ini_get('post_max_size'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is only available as of PHP 8.2, and the documentations covers PHP as of PHP 7.0.0.

So just replacing this line is not generally what we do. It might be better to rewrite the example completely to not try to compute the number of bytes.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I missed that. What brought me initial here was the kinda confusing code comment in the example which became this way from a change removing all references to PHP 5 and 7 (a0ae28d).

Made me falsely believe PHP 7 isn't relevant here anymore. So it is to early for this change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries :) That commit only removed references to PHP 7.0.0 as this is the new "baseline", There are still plenty of PHP 7.1.0 mentions :)

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

Successfully merging this pull request may close these issues.

2 participants