mirror of
https://github.com/php/php-src.git
synced 2026-03-26 09:12:14 +01:00
Dereference the value before checking the type. As the happy path necessarily has to check for references, I'm not bothering to delay the comparison.
19 lines
244 B
PHP
19 lines
244 B
PHP
--TEST--
|
|
Nullsafe operator on referenced value
|
|
--FILE--
|
|
<?php
|
|
|
|
$val = null;
|
|
$ref =& $val;
|
|
var_dump($ref?->foo);
|
|
|
|
$val = new stdClass;
|
|
var_dump($ref?->foo);
|
|
|
|
?>
|
|
--EXPECTF--
|
|
NULL
|
|
|
|
Warning: Undefined property: stdClass::$foo in %s on line %d
|
|
NULL
|