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 #70959 (ArrayObject unserialize does not restore protected fields) --FILE-- <..
Decoded Output download
--TEST--
Bug #70959 (ArrayObject unserialize does not restore protected fields)
--FILE--
<?php
class testObject extends ArrayObject {
protected $test;
public function getTest() {
return $this->test;
}
public function setTest($test) {
$this->test = $test;
}
}
$obj = new testObject();
$obj->setTest('test');
var_dump($obj->getTest());
$obj2 = unserialize(serialize($obj));
var_dump($obj2->getTest());
?>
--EXPECT--
string(4) "test"
string(4) "test"
Did this file decode correctly?
Original Code
--TEST--
Bug #70959 (ArrayObject unserialize does not restore protected fields)
--FILE--
<?php
class testObject extends ArrayObject {
protected $test;
public function getTest() {
return $this->test;
}
public function setTest($test) {
$this->test = $test;
}
}
$obj = new testObject();
$obj->setTest('test');
var_dump($obj->getTest());
$obj2 = unserialize(serialize($obj));
var_dump($obj2->getTest());
?>
--EXPECT--
string(4) "test"
string(4) "test"
Function Calls
None |
Stats
MD5 | 1f3e7e87b6a7541384f9ce546d0ab749 |
Eval Count | 0 |
Decode Time | 87 ms |