MongoDB\BSON\Javascript::__construct Construit un nouvel objet Javascript &reftitle.description; final public MongoDB\BSON\Javascript::__construct stringcode arrayobjectnullscope&null; &reftitle.parameters; code (string) Le code Javascript. scope (arrayobject) La portée du Javascript. &reftitle.errors; &mongodb.throws.argumentparsing; Lève MongoDB\Driver\Exception\InvalidArgumentException si code contient un octet nul. &reftitle.changelog; &Version; &Description; PECL mongodb 1.2.0 MongoDB\Driver\Exception\InvalidArgumentException est levée si code contient un octet nul. Auparavant, les valeurs étaient tronquées au premier octet nul. &reftitle.examples; <function>MongoDB\BSON\Javascript::__construct</function> example 'bar']); var_dump($codews); ?> ]]> &example.outputs; string(24) "function() { return 1; }" ["scope"]=> object(stdClass)#2 (0) { } } object(MongoDB\BSON\Javascript)#2 (2) { ["javascript"]=> string(26) "function() { return foo; }" ["scope"]=> object(stdClass)#1 (1) { ["foo"]=> string(3) "bar" } } ]]> &reftitle.seealso; Les types BSON