summaryrefslogtreecommitdiff
path: root/ext/standard/tests/serialize/bug73367.phpt
blob: c0c19d2b6ad48e9bb94a3e4b95e0b52cf400ec9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--TEST--
Bug #73367: Create an Unexpected Object and Don't Invoke __wakeup() in Deserialization
--FILE--
<?php

class obj {
	var $ryat;
	function __wakeup() {
		$this->ryat = null;
        echo "wakeup\n";
		throw new Exception("Not a serializable object");
	}
	function __destruct() {
        echo "dtor\n";
		if ($this->ryat == 1) {
            echo "dtor ryat==1\n";
		}
	}
}

$poc = 'O:3:"obj":2:{s:4:"ryat";i:1;i:0;O:3:"obj":1:{s:4:"ryat";R:1;}}';
try {
    unserialize($poc);
} catch (Exception $e) {
    echo $e->getMessage(), "\n";
}

?>
--EXPECT--
wakeup
Not a serializable object