d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Php Parse Error...
Prev12
Add Reply New Topic New Poll
Member
Posts: 6,522
Joined: Jun 5 2008
Gold: 0.00
Jul 17 2012 01:12pm
Quote (eagl3s1ght @ Jul 17 2012 01:33pm)
It's not so much about the defining of a variable as it is calling another function.


Oh I see.
You have to call a function inside a function.
:bonk:
Member
Posts: 2,736
Joined: Nov 28 2009
Gold: 34.00
Jul 17 2012 02:07pm
Quote (DeadShell @ 17 Jul 2012 21:12)
Oh I see.
You have to call a function inside a function.
:bonk:


Well.. that's what constructors are for, aren't they..?

Why would you want to hack OOP to not use something which was put there to fill the wanted function?

This post was edited by eagl3s1ght on Jul 17 2012 02:17pm
Member
Posts: 591
Joined: Apr 29 2009
Gold: 6,525.00
Jul 17 2012 07:46pm
do something like

class{

public myvar;

__construct(){
parent::__contruct();
$this->myvar = myFunction();
}
Go Back To Programming & Development Topic List
Prev12
Add Reply New Topic New Poll