public function __construct($limit = null)
{
if ($limit === null) {
$phpLimit = ini_get('memory_limit');
if ($phpLimit <= 0) {
$this->limit = PHP_INT_MAX;
} else {
$this->limit = (int) ($this->shorthandToBytes($phpLimit) / 10);
}
} else {
$this->limit = $this->shorthandToBytes($limit);
}
}