1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/Zend/tests/nullsafe_operator/032.phpt
2020-08-11 15:22:14 +02:00

26 lines
312 B
PHP

--TEST--
Nullsafe operator on $this
--FILE--
<?php
class Test {
public $foo = 42;
public function method() {
var_dump($this?->foo);
var_dump($this?->bar());
}
public function bar() {
return 24;
}
}
$test = new Test;
$test->method();
?>
--EXPECT--
int(42)
int(24)