Re: [phplib] PHP4 Broke this From: Joseph M. Link (joelink <email protected>)
Date: 10/20/00

In php4, you can no longer do anything but simple, constant initializers in
class definitions...

to remedy this, create a constructor function named BooBoo that initializes
your common array on instantiation.

Joe

At 01:46 PM 10/20/2000, Mike Green wrote:
>I think this was intended to be sent to phplib <email protected> ...
>-------- Original Message --------
>From: Michael Vanecek <mike <email protected>>
>Subject: PHP4 Broke this - Suggestions?
>
>This worked fine in PHP3, and stopped working in PHP4. Actually, this is
>a diagnostic copy of a different class with the names changed to protect
>the innocent . :) But the code below worked in PHP3. Sorry for the silly
>names - I had to blow some steam...
>
>class BooBoo {
> var $common = array(
> anchor => "<A%s>%s</A>",
> ahref => " href=\"%s\"",
> acontent => "%s"
> );
> function Diddle($ar) {
> $anchor = $ar["anchor"];
> $ahref = $ar["ahref"];
> $acontent = $ar["acontent"];
> if(isset($ahref) && $ahref){$anattrib =
>sprintf($this->common["ahref"],$ahref);}
> if(isset($acontent) && $acontent){$str =
>sprintf($this->common["acontent"],$acontent);}
> if($anchor){$link =
> sprintf($this->common["anchor"],$anattrib,$str);
> return($link);
> }
> }
>}
> $jeepers = new BooBoo;
> $wipme = $jeepers->Diddle($ar=array(
> anchor => anchor,
> ahref => $an,
> acontent => $bn));
> echo "$wipme <BR>";
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: phplib-unsubscribe <email protected>
>For additional commands, e-mail: phplib-help <email protected>

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>