Skip to content

Commit 7903276

Browse files
committed
backport to 5.6 (we should not unset the default value)
1 parent 966311e commit 7903276

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ PHP NEWS
33
?? ??? 2016, PHP 5.6.25
44

55
- Core:
6+
. Fixed bug #72581 (previous property undefined in Exception after
7+
deserialization). (Laruence)
68
. Fixed bug #72024 (microtime() leaks memory). (maroszek at gmx dot net)
79

810
- Curl:

Zend/zend_exceptions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ ZEND_METHOD(exception, __construct)
230230
Exception unserialize checks */
231231
#define CHECK_EXC_TYPE(name, type) \
232232
value = zend_read_property(default_exception_ce, object, name, sizeof(name)-1, 0 TSRMLS_CC); \
233-
if(value && Z_TYPE_P(value) != type) { \
233+
if (value && Z_TYPE_P(value) != IS_NULL && Z_TYPE_P(value) != type) { \
234234
zval *tmp; \
235235
MAKE_STD_ZVAL(tmp); \
236236
ZVAL_STRINGL(tmp, name, sizeof(name)-1, 1); \

ext/standard/tests/serialize/bug69152.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ $x->test();
99

1010
?>
1111
--EXPECTF--
12-
Notice: Undefined property: Exception::$previous in %s on line %d
1312
exception 'Exception' in %s:%d
1413
Stack trace:
1514
#0 {main}

ext/standard/tests/serialize/bug69793.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ $e = unserialize('O:9:"Exception":7:{s:17:"'."\0".'Exception'."\0".'string";s:1:
77
var_dump($e."");
88
?>
99
--EXPECTF--
10-
Notice: Undefined property: Exception::$message in %s%ebug69793.php on line %d
11-
1210
Notice: Undefined property: Exception::$file in %s%ebug69793.php on line %d
1311

1412
Notice: Undefined property: Exception::$previous in %s%ebug69793.php on line %d

0 commit comments

Comments
 (0)