fork download
  1. <?php
  2.  
  3. $object = new stdClass();
  4. $object->hello = 'Hello world';
  5.  
  6. var_dump($object);
  7. /*
  8. object(stdClass)#1 (1) {
  9.   ["hello"]=>
  10.   string(11) "Hello world"
  11. }
  12. */
  13. var_dump(serialize($object));
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
object(stdClass)#1 (1) {
  ["hello"]=>
  string(11) "Hello world"
}
string(50) "O:8:"stdClass":1:{s:5:"hello";s:11:"Hello world";}"