blob: cb016b78443201a7a146e0af4581ad18fedba5d0 (
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
--TEST--
Bug #75921: Inconsistent error when creating stdObject from empty variable
--FILE--
<?php
try {
$null->a = 42;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
var_dump($null);
unset($null);
try {
$null->a['hello'] = 42;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
var_dump($null);
unset($null);
try {
$null->a->b = 42;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
var_dump($null);
unset($null);
try {
$null->a['hello']->b = 42;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
var_dump($null);
unset($null);
try {
$null->a->b['hello'] = 42;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
var_dump($null);
unset($null);
?>
--EXPECTF--
Attempt to assign property 'a' on null
Warning: Undefined variable $null in %s on line %d
NULL
Attempt to modify property 'a' on null
Warning: Undefined variable $null in %s on line %d
NULL
Attempt to modify property 'a' on null
Warning: Undefined variable $null in %s on line %d
NULL
Attempt to modify property 'a' on null
Warning: Undefined variable $null in %s on line %d
NULL
Attempt to modify property 'a' on null
Warning: Undefined variable $null in %s on line %d
NULL
|