[ create a new paste ] login | about

Link: http://codepad.org/QhrikNgY    [ raw code | output | fork ]

PHP, pasted on Sep 8:
<?php
class base {
    function traverseTable($table) {
        foreach($table->getElementsByTagName('tr') {
            $rowCnt++;
            $this->uniqueSearch($rowCnt);
        }
    }
}

class child1 extends base {
    function search($input) {
        //parse input, get $table
        $this->traverseTable($table);
    }

    function uniqueSearch($rowCnt) {
         echo 'child1';
        //Do different things
    }
}

class child2 extends base {
    function search($input) {
        //parse input, get $table
        $this->traverseTable($table);
    }

    function uniqueSearch($rowCnt) {
         echo 'child2';
        //Do different things
    }
}
?>


Output:
1
2

Parse error: syntax error, unexpected '{' on line 4


Create a new paste based on this one


Comments: