|
MongoDB\BSON\Javascript::__constructConstruct a new Javascript Beschreibung
final public MongoDB\BSON\Javascript::__construct
( string
$code
[, array|object $scope
] )
Parameter-Liste
Fehler/Exceptions
Changelog
BeispieleBeispiel #1 MongoDB\BSON\Javascript::__construct example
<?phpDas oben gezeigte Beispiel erzeugt folgende Ausgabe:
object(MongoDB\BSON\Javascript)#1 (2) {
["javascript"]=>
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"
}
}
Siehe auch |