Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Bug #22224 (implode changes object references in array) --INI-- error_reporting=0..

Decoded Output download

--TEST--
Bug #22224 (implode changes object references in array)
--INI--
error_reporting=0
--FILE--
<?php
class foo
{
    function __toString()
    {
        return "Object";
    }
}


$a = new foo();

$arr = array(0=>&$a, 1=>&$a);
var_dump(implode(",",$arr));
var_dump($arr)
?>
--EXPECTF--
string(13) "Object,Object"
array(2) {
  [0]=>
  &object(foo)#%d (0) {
  }
  [1]=>
  &object(foo)#%d (0) {
  }
}

Did this file decode correctly?

Original Code

--TEST--
Bug #22224 (implode changes object references in array)
--INI--
error_reporting=0
--FILE--
<?php
class foo
{
    function __toString()
    {
        return "Object";
    }
}


$a = new foo();

$arr = array(0=>&$a, 1=>&$a);
var_dump(implode(",",$arr));
var_dump($arr)
?>
--EXPECTF--
string(13) "Object,Object"
array(2) {
  [0]=>
  &object(foo)#%d (0) {
  }
  [1]=>
  &object(foo)#%d (0) {
  }
}

Function Calls

None

Variables

None

Stats

MD5 4b79c4ee6c3db51cfa38894a63af2396
Eval Count 0
Decode Time 107 ms