mirror of
https://github.com/php/php-src.git
synced 2026-04-23 07:58:20 +02:00
1179686f62
Closes GH-5446 Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
39 lines
693 B
PHP
39 lines
693 B
PHP
--TEST--
|
|
Trying to create an object from dereferencing uninitialized variable
|
|
--FILE--
|
|
<?php
|
|
|
|
error_reporting(E_ALL);
|
|
|
|
class foo {
|
|
public $x;
|
|
static public $y;
|
|
|
|
public function a() {
|
|
return $this->x;
|
|
}
|
|
|
|
static public function b() {
|
|
return self::$y;
|
|
}
|
|
}
|
|
|
|
$foo = new foo;
|
|
$h = $foo->a()[0]->a;
|
|
var_dump($h);
|
|
|
|
$h = foo::b()[1]->b;
|
|
var_dump($h);
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Warning: Trying to access array offset on value of type null in %s on line %d
|
|
|
|
Warning: Attempt to read property 'a' on null in %s on line %d
|
|
NULL
|
|
|
|
Warning: Trying to access array offset on value of type null in %s on line %d
|
|
|
|
Warning: Attempt to read property 'b' on null in %s on line %d
|
|
NULL
|