• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

php sees function declaration as function call

magelus

Gawd
Joined
Oct 9, 2001
Messages
655
I have a file with 3 class definitions in it. Each of said classes have a member function called addItem($newItem) some what Like this
Code:
function addItem($newItem){  //This is line 120, see below
   $this->body->addItem($newItem);
}
Here the function is a member of class A, as is the object 'body'. However, 'body' is an object of type class B. Class B has a member function named addItem($newItem) also

When I execute the code, I get the following error

Warning: Missing argument 1 for additem() in /home2/deviantd/deviantdreaming-www/test/xhtmllib/xhtmllib.php on line 120

You, see my delema... its telling my I'm missing an argument in a function declaration, kind of weird. I've never seen an error like this. I have a vauge idea why its doing this, but I really have no clue where to start debugging. Any insight on this? Thanks! :)
 
Odds are that the previous function isn't terminiated properly and the parser doesn't realize something is broken until this line.
 
Back
Top