RE: [PHP4BETA] A quick clarification question about PHP4...
| From: | William Ahern | Date: | Mon, 30 Aug 1999 14:45:32 +0000 |
| Subject: | RE: [PHP4BETA] A quick clarification question about PHP4... | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-3880@lists.php.net to get a copy of this message | ||
Apologies if i missed something, but I'm doing an entire site
where all of the document managment code relies on wrapper
classes. i.e. if a new document is uploaded, it is instantiaited
as new Document($_type), where $_type is a string "html" or
"gif" or the like. its not referenced. Document class then
instantiates a new class of the proper type inside itself, and everything is
transparent from the outside, i.e. Document->view() will return the file for
html, or an <img> tag for a gif. will this still work?
tia
Bill Ahern
On Mon, 30 Aug 1999, you wrote:
> It does work fine in PHP3, and I think it will work in PHP4 as well, as long
> as the values passed in the init code are not variables, just values of some
> type that can be determined at "compile" (or parse) time.
>
> -----Original Message-----
> From: Scott Stevenson [mailto:scott@maxify.com]
> Sent: Friday, August 27, 1999 9:41 PM
> To: php4beta@lists.php.net
> Subject: Re: [PHP4BETA] A quick clarification question about PHP4...
>
> Jim Brain said:
>
> > As for the init code, it seems you really can't pass anything useful to an
> > init function, which implies that:
> >
> > $jim=new junk;
> >
> > Would work better than
> >
> > $jim=new junk();
>
> I'm not sure why you wouldn't want to pass stuff there. For example, this
> seems useful, and works fine in PHP3:
>
> --------
>
> class myClass {
> function myClass($name) {
> $this->myVar = "Hello, $name!";
> }
> }
>
> $myInstance = new myClass(Scott);
> echo $myInstance->myVar;
>
> --------
>
> Maybe I missed something in this exchange?
>
> - Scott