summaryrefslogtreecommitdiff
path: root/Zend/tests/bug78531.phpt
blob: b818afb79a863e9f9706658aad052ea9f2b2ff6c (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
--TEST--
Bug #78531 (Crash when using undefined variable as object)
--FILE--
<?php
try {
    $u1->a += 5;
} catch (Error $e) {
    echo $e->getMessage(), "\n";
}
try {
    $x = ++$u2->a;
} catch (Error $e) {
    echo $e->getMessage(), "\n";
}
try {
    $x = $u3->a++;
} catch (Error $e) {
    echo $e->getMessage(), "\n";
}
try {
    $u4->a->a += 5;
} catch (Error $e) {
    echo $e->getMessage(), "\n";
}
?>
--EXPECTF--
Warning: Undefined variable $u1 in %s on line %d
Attempt to assign property "a" on null

Warning: Undefined variable $u2 in %s on line %d
Attempt to increment/decrement property "a" on null

Warning: Undefined variable $u3 in %s on line %d
Attempt to increment/decrement property "a" on null

Warning: Undefined variable $u4 in %s on line %d
Attempt to modify property "a" on null