Created
January 25, 2013 08:44
-
-
Save mgng/4632887 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
$xml = new SimpleXMLElement('<root />'); | |
$_SESSION['xml'] = $xml; | |
// Fatal error: Uncaught exception 'Exception' with message 'Serialization of 'SimpleXMLElement' is not allowed' in [no active file]:0 | |
// Stack trace: | |
// #0 {main} | |
// thrown in [no active file] on line 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
$xml = json_decode( json_encode( new SimpleXMLElement('<root />') ) ); | |
$_SESSION['xml'] = $xml; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment