3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Se { public $data1; public function setData(array ($data)){ if (empty($data)) { throw new InvalidArgumentException('The name of an employee cannot be empty.'); } $data1 = $data; $data1 = array_values($data1); var_dump($data1); } public function getE(){ return $data1[0]; } }; $tmpaaa= array('3333','222'); $ttt = new Se(); $ttt->setData($tmpaaa); echo $ttt->getE();
Output for 5.4.0 - 5.4.21
Parse error: syntax error, unexpected '(', expecting '&' or variable (T_VARIABLE) in /in/XZijk on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected '(', expecting '&' or T_VARIABLE in /in/XZijk on line 5
Process exited with code 255.