Skip to content

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 :)

Copy link
Member

Choose a reason for hiding this comment

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

Update this PR to add the new example with an "Available as of PHP 8.2.0" code comment?

Copy link
Member

Choose a reason for hiding this comment

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

Update this PR to add the new example with an "Available as of PHP 8.2.0" code comment?

This would work yes.

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

Successfully merging this pull request may close these issues.

4 participants