略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: MongoCode::__toString

2024-05-02

MongoCode::__toString

(PECL mongo >= 0.8.3)

MongoCode::__toString返回代码的字符串形式

说明

public MongoCode::__toString ( void ) : string

参数

此函数没有参数。

返回值

该代码,不会返回作用域。

范例

Example #1 MongoCode::__toString() 例子

<?php

$code 
= new MongoCode('return x;', array("x"=>"hi"));
echo 
"$code\n";

$code = new MongoCode('function() { for(i=0;i<10;i++) { db.foo.update({x:i}, {x:i+1}); } }');
echo 
"$code\n";

?>

以上例程的输出类似于:

return x;
function() { for(i=0;i<10;i++) { db.foo.update({x:i}, {x:i+1}); } }
add a note add a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/mongocode.tostring.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3