Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
class Oele {
function __construct() {
echo __METHOD__ . "\n";
}
function __wakeup() {
echo __METHOD__ . "\n";
}
}
$user = new Oele;
$user->oele = 'boele';
$user->x = 12344;
// $user = (object) array('oele' => 'boele', 'x' => 4523);
echo $serialized = serialize($user) . "\n\n";
$user = unserialize($serialized);
print_r($user);
class Boele {
function __construct() {
echo "FUCKER!\n";
}
function __wakeup() {
echo __METHOD__ . "\n";
}
}
$user = unserialize('O:5:"Boele":2:{s:4:"oele";s:5:"boele";s:1:"x";i:12344;}');
print_r($user);
echo var_export($user);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.