PHP Code:
$foo = null;
PHP value:
NULL
Serialized in PHP:
N;
Unserialized in JS:
PHP Code:
$foo = true;
PHP value:
bool(true)
Serialized in PHP:
b:1;
Unserialized in JS:
PHP Code:
$foo = "foobar";
PHP value:
string(6) "foobar"
Serialized in PHP:
s:6:"foobar";
Unserialized in JS:
PHP Code:
$foo = 337;
PHP value:
int(337)
Serialized in PHP:
i:337;
Unserialized in JS:
PHP Code:
$foo = 99.99;
PHP value:
float(99.99)
Serialized in PHP:
d:99.9899999999999948840923025272786617279052734375;
Unserialized in JS:
PHP Code:
$foo = array("a" => 1, "b" => 2, 3);
PHP value:
array(3) {
["a"]=>
int(1)
["b"]=>
int(2)
[0]=>
int(3)
}
Serialized in PHP:
a:3:{s:1:"a";i:1;s:1:"b";i:2;i:0;i:3;}
Unserialized in JS:
PHP Code:
$foo = array(1,2,array(1,2,3));
PHP value:
array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
}
Serialized in PHP:
a:3:{i:0;i:1;i:1;i:2;i:2;a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}}
Unserialized in JS:
PHP Code:
class Foo { var $foo; var $bar; }$foo = new Foo; $foo->foo = "hello"; $foo->bar = array("world","universe");
PHP value:
object(Foo)#1 (2) {
["foo"]=>
string(5) "hello"
["bar"]=>
array(2) {
[0]=>
string(5) "world"
[1]=>
string(8) "universe"
}
}
Serialized in PHP:
O:3:"Foo":2:{s:3:"foo";s:5:"hello";s:3:"bar";a:2:{i:0;s:5:"world";i:1;s:8:"universe";}}
Unserialized in JS:
Invalidly serialized:
x
Unserialized in JS:
Invalidly serialized:
x:1
Unserialized in JS:
Invalidly serialized:
N
Unserialized in JS:
Invalidly serialized:
Nx
Unserialized in JS:
Invalidly serialized:
b:f;
Unserialized in JS:
Invalidly serialized:
b:1
Unserialized in JS:
Invalidly serialized:
i:foo;
Unserialized in JS:
Invalidly serialized:
i:1
Unserialized in JS:
Invalidly serialized:
d:foo;
Unserialized in JS:
Invalidly serialized:
d:1.1.1;
Unserialized in JS:
Invalidly serialized:
d:1.1
Unserialized in JS:
Invalidly serialized:
s:6:"foo";
Unserialized in JS:
Invalidly serialized:
s:6:"foofoo"
Unserialized in JS:
Invalidly serialized:
s:1:"foo";
Unserialized in JS:
Invalidly serialized:
s:0:""
Unserialized in JS:
Invalidly serialized:
a:3:{s:1:"aa";i:1;s:1:"b";i:2;i:0;i:3;}
Unserialized in JS:
Invalidly serialized:
a:4:{s:1:"a";i:1;s:1:"b";i:2;i:0;i:3;
Unserialized in JS:
Invalidly serialized:
a:3:{i:1;s:1:"b";i:2;i:0;i:3;}
Unserialized in JS:
Invalidly serialized:
a:3:{}
Unserialized in JS:
Invalidly serialized:
O:3:"Fooo":2:{s:3:"foo";s:5:"hello";s:3:"bar";a:2:{i:0;s:5:"world";i:1;s:8:"universe";}}
Unserialized in JS:
Invalidly serialized:
O:3:"Foo":3:{s:3:"foo";s:5:"hello";s:3:"bar";a:2:{i:0;s:5:"world";i:1;s:8:"universe";}}
Unserialized in JS:
Invalidly serialized:
O:3:"Foo":2:{s:5:"hello";s:3:"bar";a:2:{i:0;s:5:"world";i:1;s:8:"universe";}}
Unserialized in JS:
Invalidly serialized:
O:3:"Foo":2:{s:3:"foo";s:5:"hello";s:3:"bar";a:2:{i:0;s:5:"world";i:1;s:8:"universe";}
Unserialized in JS:
Invalidly serialized:
O:3:"Foo":2:{s:3:"foo";s:5:"hello";s:3:"bar";a:2:{i:0;s:5:"world";i:1;s:8:"universe"}}
Unserialized in JS: