blob: fff2c99f6201c10d366fcf84d987f6b9c24ab0ca (
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
|
--TEST--
Trying assign value to property when an object is not returned in a function
--FILE--
<?php
class foo {
public function a() {
}
}
$test = new foo;
$test->a()->a;
print "ok\n";
try {
$test->a()->a = 1;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
print "ok\n";
?>
--EXPECTF--
Warning: Attempt to read property "a" on null in %s on line %d
ok
Attempt to assign property "a" on null
ok
|