MongoId::getPID PHP Method

getPID() public method

(PECL mongo >= 1.0.11) Gets the process ID
public getPID ( ) : integer
return integer Returns the PID of the MongoId.
    public function getPID()
    {
        $id = (string) $this->objectID;
        // PID is stored as little-endian, flip it around
        $pid = substr($id, 16, 2) . substr($id, 14, 2);
        return hexdec($pid);
    }

Usage Example

 public function testCreateWithString()
 {
     $original = '54203e08d51d4a1f868b456e';
     $id = new \MongoId($original);
     $this->assertSame($original, (string) $id);
     $this->assertSame(9127278, $id->getInc());
     $this->assertSame(1411399176, $id->getTimestamp());
     $this->assertSame(34335, $id->getPID());
 }
All Usage Examples Of MongoId::getPID