MongoId::__construct Creates a new id &reftitle.description; public MongoId::__construct string|MongoIdid&null; &reftitle.parameters; id A string (must be 24 hexadecimal characters) or a MongoId instance. &reftitle.returnvalues; Returns a new id. &reftitle.changelog; &Version; &Description; 1.4.0 An exception is thrown when passed invalid string &reftitle.examples; <function>MongoId::__construct</function> example This example shows how to create a new id. This is seldom necessary, as the driver adds an id to arrays automatically before storing them in the database. ]]> &example.outputs.similar; Parameter example This example shows how to use a string parameter to initialize a MongoId with a given value. ]]> &example.outputs.similar; &reftitle.seealso; MongoId::__toString MongoId::isvalid