That is weird, I can’t reproduce this problem on my end. I tried 400M and it works for me.
The only difference is that I formatted the output after reading it.
Could you try this piece of code for me?
<?php
function format_filesize($rawSize) {
if($rawSize / 1099511627776 > 1) {
return number_format($rawSize/1099511627776, 1).' TiB';
} elseif($rawSize / 1073741824 > 1) {
return number_format($rawSize/1073741824, 1).' GiB';
} elseif($rawSize / 1048576 > 1) {
return number_format($rawSize/1048576, 1).' MiB';
} elseif($rawSize / 1024 > 1) {
return number_format($rawSize/1024, 1).' KiB';
} elseif($rawSize > 1) {
return number_format($rawSize, 0).' bytes';
} else {
return 'unknown';
}
}
function format_php_size($size) {
if (!is_numeric($size)) {
if (strpos($size, 'M') !== false) {
$size = intval($size)*1024*1024;
} elseif (strpos($size, 'K') !== false) {
$size = intval($size)*1024;
} elseif (strpos($size, 'G') !== false) {
$size = intval($size)*1024*1024*1024;
}
}
return is_numeric($size) ? format_filesize($size) : $size;
}
echo format_php_size(ini_get('memory_limit'));
?>