<?php
error_reporting(E_ALL);
class Test {
private $data;
public function __construct($d){
$this->data = $d;
}
public function list(){
list($a,$b,$c) = $this->data;
echo $a,"\n";
echo $b,"\n";
echo $c,"\n";
return $this;
}
public function null(){
echo "\nData is ",is_null($this->data)? 'null' : 'not null';
}
}
$arr = array("a","b","c");
(new Test($arr))->list()->null();