SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict say's Avatar
    Join Date
    Sep 2003
    Location
    At work
    Posts
    371
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Funny problem when instantiating

    for example

    PHP Code:

    new myClass$param );

    Class 
    myClass
    {
         
    //

    The above works well but the below gave me non-existance myClass

    PHP Code:

    new myClass$param );

    Class 
    myClass extends another
    {
         
    //

    if I move the instantiation below the class, it stops complaining.

  2. #2
    Non-Member
    Join Date
    Jan 2004
    Location
    Planet Earth
    Posts
    1,764
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The class that you extend must be available prior to creating an object of a class that does the extending.

    Annoying yes, and I've fallen for that myself a few times, but nothing in PHP4.x you can do about it

  3. #3
    SitePoint Addict say's Avatar
    Join Date
    Sep 2003
    Location
    At work
    Posts
    371
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the heads up Widow. Glad i'm not alone.


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
  •