blob: 3b1982afa39547aa709755560c3abd95ff63beb7 (
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
|
--TEST--
Test nullsafe in new
--FILE--
<?php
class Bar {}
class Foo {
public $bar;
}
$foo = new Foo();
$foo->bar = 'bar';
var_dump(new $foo?->bar);
$foo = null;
var_dump(new $foo?->bar);
?>
--EXPECTF--
object(Bar)#2 (0) {
}
Fatal error: Uncaught Error: Class name must be a valid object or a string in %s.php:14
Stack trace:
#0 {main}
thrown in %s.php on line 14
|