summaryrefslogtreecommitdiff
path: root/Zend/tests/bug71841.phpt
blob: f32b0e9b231f4e797a003d0698858c2124160522 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--TEST--
Bug #71841 (EG(error_zval) is not handled well)
--FILE--
<?php
$z = unserialize('O:1:"A":0:{}');
try {
    var_dump($z->e.=0);
} catch (Error $e) {
    echo $e->getMessage(), "\n";
}
try {
    var_dump(++$z->x);
} catch (Error $e) {
    echo $e->getMessage(), "\n";
}
try {
    var_dump($z->y++);
} catch (Error $e) {
    echo $e->getMessage(), "\n";
}

$y = array(PHP_INT_MAX => 0);
try {
    var_dump($y[] .= 0);
} catch (Error $e) {
    echo $e->getMessage(), "\n";
}
try {
    var_dump(++$y[]);
} catch (Error $e) {
    echo $e->getMessage(), "\n";
}
try {
    var_dump($y[]++);
} catch (Error $e) {
    echo $e->getMessage(), "\n";
}
?>
--EXPECT--
The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition
Cannot add element to the array as the next element is already occupied
Cannot add element to the array as the next element is already occupied
Cannot add element to the array as the next element is already occupied