PHP 8.5.0 Beta 3 available for testing

MongoDB\BSON\Javascript::getScope

(mongodb >=1.2.0)

MongoDB\BSON\Javascript::getScope โ€” Returns the Javascript's scope document

่ชฌๆ˜Ž

final public MongoDB\BSON\Javascript::getScope(): ?object

ใƒ‘ใƒฉใƒกใƒผใ‚ฟ

ใ“ใฎ้–ขๆ•ฐใซใฏใƒ‘ใƒฉใƒกใƒผใ‚ฟใฏใ‚ใ‚Šใพใ›ใ‚“ใ€‚

ๆˆปใ‚Šๅ€ค

Returns the Javascript's scope document, or null if the is no scope.

ใ‚จใƒฉใƒผ / ไพ‹ๅค–

ไพ‹

ไพ‹1 MongoDB\BSON\Javascript::getScope() example

<?php

$js
= new MongoDB\BSON\Javascript('function foo(bar) { return bar; }');
var_dump($js->getScope());

$js = new MongoDB\BSON\Javascript('function foo() { return foo; }', ['foo' => 42]);
var_dump($js->getScope());

?>

ไธŠใฎไพ‹ใฎๅ‡บๅŠ›ใฏไปฅไธ‹ใจใชใ‚Šใพใ™ใ€‚

NULL
object(stdClass)#1 (1) {
  ["foo"]=>
  int(42)
}

ๅ‚่€ƒ

๏ผ‹add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top