php 5 oop tech help needed!
Posted: Mon Jun 26, 2006 8:45 am
Pimptastic | Please use
Thanks,
Pimptastic | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi guys newbie here
How can i create a class with more than one constructor or at least constructors with different paramCode: Select all
class foo {
public $var;
// default constructot sets $var to 0
public function __construct() {
$this->var = 0;
}
//second constr. sets $var to $bar
public function __construct($bar){
$this->var = val;
}
....
}Pimptastic | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]