Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions reference/info/functions/ini-get.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,7 @@ echo 'display_errors = ' . ini_get('display_errors') . "\n";
echo 'register_globals = ' . ini_get('register_globals') . "\n";
echo 'post_max_size = ' . ini_get('post_max_size') . "\n";
echo 'post_max_size+1 = ' . (ini_get('post_max_size')+1) . "\n";
echo 'post_max_size in bytes = ' . return_bytes(ini_get('post_max_size'));

function return_bytes($val) {
$val = trim($val);
$last = strtolower($val[strlen($val)-1]);
switch($last) {
// The 'G' modifier is available
case 'g':
$val *= 1024;
case 'm':
$val *= 1024;
case 'k':
$val *= 1024;
}

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.


?>
]]>
Expand Down