SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Haha, this is an odd error

    I'm debugging a couple files of code that I expanded from stubs to a beta version, and get this quaint but confusing error.
    Fatal error: Declaration of FormSelectElement::render() must be compatible with that of HTMLElement::getAttribute() in /some/path/lib/Forms/FormElements.php on line 209
    I did a double take a first. I didn't understand this, so I changed a few things and re-ran the page. Now I get this
    Fatal error: Declaration of FormSelectElement::render() must be compatible with that of ȝ::() in /some/path/lib/Forms/FormElements.php on line 209
    Now, I don't expect anyone to solve this without seeing code, which I might get to. But for now - anybody recall seeing anything like this?

    This is a pretty deep inheritance tree and I'm considering rewriting it as a decorator, but for now this is how it looks

    abstract HTMLNode -> HTMLElement -> abstract FormElement -> FormSelectElement

    This is just a technical exercise, btw.
    Last edited by beetle; Aug 16, 2006 at 08:27.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  2. #2
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what versions of PHP and OS are your running?
    Jason Sweat ZCE - jsweat_php@yahoo.com
    Book: PHP Patterns
    Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
    Detestable (adjective): software that isn't testable.

  3. #3
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP is 5.1.4. The OS is... a Linux distro of some sort - pretty sure it's RedHat.

    After some more testing I'm thinking the problem is that the grandchild class (FormElement) is abstract, but the child class (HTMLElement) is not. It's clear the parser is becoming confused by something.

    At any rate, I've been able to get rid of the error by making FormElement not abstract.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev





Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •