mirror of
https://github.com/php/php-src.git
synced 2026-03-26 01:02:25 +01:00
RFC: https://wiki.php.net/rfc/nullsafe_operator Closes GH-5619. Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
20 lines
315 B
PHP
20 lines
315 B
PHP
--TEST--
|
|
Test nullsafe on undefined variable
|
|
--FILE--
|
|
<?php
|
|
|
|
var_dump($foo?->bar);
|
|
var_dump($foo?->bar());
|
|
var_dump($foo);
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Warning: Undefined variable $foo in %s.php on line 3
|
|
NULL
|
|
|
|
Warning: Undefined variable $foo in %s.php on line 4
|
|
NULL
|
|
|
|
Warning: Undefined variable $foo in %s.php on line 5
|
|
NULL
|