php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58908 Variable is cleaned when use for second time
Submitted: 2009-10-21 05:03 UTC Modified: 2010-02-22 13:04 UTC
From: lycboy at gmail dot com Assigned: crobin (profile)
Status: Closed Package: spidermonkey (PECL)
PHP Version: 5.3.0 OS: Linux kernel 2.6.9 x86_64
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: lycboy at gmail dot com
New email:
PHP Version: OS:

 

 [2009-10-21 05:03 UTC] lycboy at gmail dot com
Description:
------------
Use an variable for first time in JS, then the variable is cleaned.

Reproduce code:
---------------
<?php

function test($arr) {
    print_r($arr);
}

$ctx = new JSContext();
$ctx->registerFunction('test');

$js = <<<JS
var arr = [1, null, 0, 'str'];
test(arr);
test(arr); // display nothing
JS;

$ctx->evaluateScript($js);


Expected result:
----------------
It should export print_r() result two times.

Actual result:
--------------
only one print_r() result got when run the code above.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-02-20 15:33 UTC] c dot robin at smartphp dot org
That one is weird, it seems to happen only to objects ( using 
'var arr = 7' does display '77' ). I'll take a look into it.
 [2010-02-21 17:47 UTC] c dot robin at smartphp dot org
Ok so it looks like that when we store our stdClass in the 
intern->obj_ht HashTable, this same HashTable always return a 
NULL object when trying to retrieve it.
 [2010-02-22 13:04 UTC] c dot robin at smartphp dot org
This bug has been fixed in SVN.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 13 09:01:27 2025 UTC