3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dom = new \DOMDocument('1.0', 'UTF-8'); $dom->loadHTML($this->list()); $element = $dom->getElementsByTagName('table'); var_dump($element->item(0));die; function list() { return '<table id="foobar"> <tr> <td>1</td> <td>2</td> <td>3</td> </tr> <tr> <td>4</td> <td>5</td> <td>6</td> </tr> <tr> <td>7</td> <td>8</td> <td>9</td> </tr> </table>'; }
Output for 5.4.0 - 5.4.19
Parse error: syntax error, unexpected 'list' (T_LIST), expecting identifier (T_STRING) or '(' in /in/Istq4 on line 10
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_LIST, expecting T_STRING or '(' in /in/Istq4 on line 10
Process exited with code 255.

preferences:
175.06 ms | 1395 KiB | 55 Q