function Bytes::toInt

Same name in other branches
  1. 8.9.x core/lib/Drupal/Component/Utility/Bytes.php \Drupal\Component\Utility\Bytes::toInt()

Parses a given byte size.

Parameters

mixed $size: An integer or string size expressed as a number of bytes with optional SI or IEC binary unit prefix (e.g. 2, 3K, 5MB, 10G, 6GiB, 8 bytes, 9mbytes).

Return value

int An integer representation of the size in bytes.

Deprecated

in drupal:9.1.0 and is removed from drupal:10.0.0. Use \Drupal\Component\Utility\Bytes::toNumber() instead

See also

https://www.drupal.org/node/3162663

1 call to Bytes::toInt()
BytesTest::testToInt in core/tests/Drupal/Tests/Component/Utility/BytesTest.php
Tests \Drupal\Component\Utility\Bytes::toInt().

File

core/lib/Drupal/Component/Utility/Bytes.php, line 75

Class

Bytes
Provides helper methods for byte conversions.

Namespace

Drupal\Component\Utility

Code

public static function toInt($size) {
    @trigger_error('\\Drupal\\Component\\Utility\\Bytes::toInt() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use \\Drupal\\Component\\Utility\\Bytes::toNumber() instead. See https://www.drupal.org/node/3162663', E_USER_DEPRECATED);
    return self::toNumber($size);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.