语法错误.代码提示.找不到解决方案


Syntax error. Code hinting. Can't find solution

我正在关注有关 OOP 的教程:http://www.phptuts.nl/view/45/8/

但是在下面的代码段中,第 2 行似乎有一个错误。既然看起来不像是在第二行,它一定在剧本的某个地方,是不是我做错了什么?(对此是新的)。

代码如下:

<?php
public function draw() {
    echo '<table border="1">'.PHP_EOL; // Begin van de tabel, border voor de duidelijkheid
    foreach($this->_rows as $row) {
        echo '<tr>'.PHP_EOL;
        foreach($row->getCells() as $cell) {
            echo '<td>'.$cell->getContent().'</td>'.PHP_EOL;
        }
        echo '</tr>'.PHP_EOL;
    }
    echo '</table>'.PHP_EOL;
}
?>
public只能在

类中使用。该函数不在类中。删除它,您的错误应该消失。