3v4l.org

run code in 300+ PHP versions simultaneously
<?php public function getSomething(string $sql, array $params): array { $result = []; $statement = $this->connection->prepare($sql); $statement->bind_param(str_repeat("s", count($params)), ...$params); $statement->execute(); $statement->store_result(); $statement->bind_result($id, $mark, $model, $form); while ($rij = $statement->fetch()) { $result[] = new Housemark($id, $mark, $model, $form); } return $result; }
Output for 8.0.0
Parse error: syntax error, unexpected token "public", expecting end of file in /in/sQPoi on line 4
Process exited with code 255.
Output for 7.3.0 - 7.3.26, 7.4.0 - 7.4.14
Parse error: syntax error, unexpected 'public' (T_PUBLIC), expecting end of file in /in/sQPoi on line 4
Process exited with code 255.

preferences:
172.81 ms | 1399 KiB | 50 Q