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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
29 + 49 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 10:01:29 2024 UTC