Results 1 to 3 of 3

Thread: A extends B which calls A which calls B...

  1. #1
    Senior Member
    Join Date
    Jun 2002
    Posts
    174

    A extends B which calls A which calls B...

    I'm working on a project, and I've hit a roadblock of sorts.

    The language of choice here is PHP (4.4)

    I have two classes, A and B. B extends A.

    "A" has a method, let us call it "addFunc", that takes the names of functions (to be declared in the child) and adds them to an instance variable, funcList.

    "B" is nothing but a collection of functions. In it's constructor, it calls addFunc(), passing it a bunch of function names. (e.g., addFunc("func1", "func2"...) )

    "A" has another function which executes these functions by going:
    Code:
    call_user_func_array(array(&this, $func_name), $args);
    Where $args is an array of arguments and $func_name is the string representation of a function from the funcList.

    So take note, these functions are in the child...

    I'm getting an error in there somewhere, and I have a feeling that may be it, but I'm not sure.

    Suggestions?
    I\'m back.

  2. #2
    Junior Member
    Join Date
    Jul 2005
    Posts
    7
    "A and B. B extends A."? So the parent of a class is the child of the class its parent of? Are you sure there isnot another way to do this?

  3. #3
    Senior Member
    Join Date
    Jun 2002
    Posts
    174
    Umm... not really sure what that means, but what I mean is I have Class A and Class B, but in reality, B extends A... so A is the parent, B is the child.
    I\'m back.

Posting Permissions

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