Re: [PHP] Classes Constructor syntax

2002-07-17 Thread Rad0s-ław Gajewski
++>PHP does not support multiple constructors. but you can easily evade this obstacle: class A { function A($parm1,$parm2=false) { if (!$parm2) { $this->OneArgConstructor($parm1); } else { $this->TwoArg

Re: [PHP] Classes Constructor syntax

2002-07-17 Thread Analysis & Solutions
On Wed, Jul 17, 2002 at 03:26:15PM +0200, David Russell wrote: > > class issue { > function issue() { //default constructor > } > function issue($number) { //1 variable constructor > } > } > > My question is: will this work? does PHP OOP support more than one > constructor? No. But, h

Re: [PHP] Classes Constructor syntax

2002-07-17 Thread Michael Hall
I'm no guru, but here goes anyway ... default variable values can simply be set with a "var" statement: var $somevar1 = "value1"; var $somevar2 = "value2"; or with a "set" function: var $somevar1; var $somevar2; function setsomevar1() { $this->somevar1 = "value1"; } function setsome

Re: [PHP] Classes Constructor syntax

2002-07-17 Thread Michael Hall
PHP does not support multiple constructors. Michael On Wed, 17 Jul 2002, David Russell wrote: > Hi all, > > I am finally spending some time converting a million and one functions > into a class - this is for a software issue tracking system. > > I have: > > class issue { >var >var

[PHP] Classes Constructor syntax

2002-07-17 Thread David Russell
Hi all, I am finally spending some time converting a million and one functions into a class - this is for a software issue tracking system. I have: class issue { var var ... function issue() { //default constructor //initialise all variables to defaults, and start getting the