3v4l.org

run code in 300+ PHP versions simultaneously
<?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/YSYZk 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/YSYZk on line 5
Process exited with code 255.

preferences:
180.84 ms | 1395 KiB | 57 Q