Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jul 2005
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Can I Extend Class Without Definition?

    Hi,
    Can I do the following? It doesn't have definition of the child class.

    class child extend parent;

    Many thanks.

  • #2
    Regular Coder
    Join Date
    Jun 2004
    Posts
    565
    Thanks
    0
    Thanked 18 Times in 18 Posts
    Instead of asking, you could've simply tried it. But no, you cannot do it that way. However, you can do this:
    PHP Code:
    class child extends parent {} 
    Oh, and use "extends" instead of "extend", because PHP doesn't like it, if you use undefined keywords.

    dumpfi

  • #3
    Regular Coder
    Join Date
    Aug 2004
    Location
    The US of A
    Posts
    767
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Here is the PHP Documentation on Classes and Objects, it'll answer a lot of questions for you.

    PHP 4
    PHP 5


  •  

    Posting Permissions

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