- property_exists: documentation ( source)
- unserialize: documentation ( source)
<?php
class Person
{
public $name;
public function __wakeup()
{
if( property_exists( $this, 'n1ame' ) )
{
throw new Exception('oh no this data is bad');
}
}
}
try
{
unserialize('O:6:"Person":1:{s:5:"n1ame";s:4:"mark";}');
}
catch( Exception $e )
{
echo 'nope cant unserialize it: ' . $e->getMessage();
}