Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PdoSessionHandler.php

function PdoSessionHandler::convertStringToInt

Encodes the first 4 (when PHP_INT_SIZE == 4) or 8 characters of the string as an integer.

Keep in mind, PHP integers are signed.

1 call to PdoSessionHandler::convertStringToInt()
PdoSessionHandler::doAdvisoryLock in vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php
Executes an application-level lock on the database.

File

vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php, line 744

Class

PdoSessionHandler
Session handler using a PDO connection to read and write data.

Namespace

Symfony\Component\HttpFoundation\Session\Storage\Handler

Code

private function convertStringToInt(string $string) : int {
    if (4 === \PHP_INT_SIZE) {
        return (\ord($string[3]) << 24) + (\ord($string[2]) << 16) + (\ord($string[1]) << 8) + \ord($string[0]);
    }
    $int1 = (\ord($string[7]) << 24) + (\ord($string[6]) << 16) + (\ord($string[5]) << 8) + \ord($string[4]);
    $int2 = (\ord($string[3]) << 24) + (\ord($string[2]) << 16) + (\ord($string[1]) << 8) + \ord($string[0]);
    return $int2 + ($int1 << 32);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal