3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php error_reporting(E_ALL); function true(){ echo "\n", 1; } 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(); true();
based on ZNPOi
Output for 7.0.0 - 7.2.0
a b c Data is not null 1
Output for 5.4.0 - 5.6.28
Parse error: syntax error, unexpected 'list' (T_LIST), expecting identifier (T_STRING) in /in/dTTPm on line 14
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected T_LIST, expecting T_STRING in /in/dTTPm on line 14
Process exited with code 255.