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-- session object serialization --EXTENSIONS-- session --SKIPIF-- <?php include('ski..

Decoded Output download

--TEST--
session object serialization
--EXTENSIONS--
session
--SKIPIF--
<?php include('skipif.inc'); ?>
--INI--
session.use_cookies=0
session.cache_limiter=
session.serialize_handler=php
session.save_handler=files
--FILE--
<?php
error_reporting(E_ALL);

class foo {
    public $bar = "ok";

    function method() { $this->yes = "done"; }
}

$baz = new foo;
$baz->method();

$arr[3] = new foo;
$arr[3]->method();
session_start();
$_SESSION["baz"] = $baz;
$_SESSION["arr"] = $arr;
var_dump(session_encode());
session_destroy();
?>
--EXPECT--
string(126) "baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}}"

Did this file decode correctly?

Original Code

--TEST--
session object serialization
--EXTENSIONS--
session
--SKIPIF--
<?php include('skipif.inc'); ?>
--INI--
session.use_cookies=0
session.cache_limiter=
session.serialize_handler=php
session.save_handler=files
--FILE--
<?php
error_reporting(E_ALL);

class foo {
    public $bar = "ok";

    function method() { $this->yes = "done"; }
}

$baz = new foo;
$baz->method();

$arr[3] = new foo;
$arr[3]->method();
session_start();
$_SESSION["baz"] = $baz;
$_SESSION["arr"] = $arr;
var_dump(session_encode());
session_destroy();
?>
--EXPECT--
string(126) "baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}}"

Function Calls

None

Variables

None

Stats

MD5 ab7fc28fd7b78be21a643bd88e35a701
Eval Count 0
Decode Time 89 ms