ber 28, 2004 8:30 PM
Subject: Re: [PHP] classes in php5
> class Foo
> { }
> $className = "Foo";
> $fooInstance = new $className;
> ?>
> Works fine for me. It still works if you add methods or properties to
> Foo as well, I'm not sure why it wouldn't work for y
Works fine for me. It still works if you add methods or properties to
Foo as well, I'm not sure why it wouldn't work for you, possibly you
have another error along the lines somewhere. I am on PHP 5.0.1 BTW
On Tue, 2004-09-28 at 19:42, Curt Zirzow wrote:
> * Thus wrote Daniel Watrous:
> > Hello
* Thus wrote Daniel Watrous:
> Hello all,
>
> I have a class Foo. In PHP4 I could create an instance of Foo in the following
> manner:
> $className = "Foo";
> $fooInstance = new $className;
>
> This would yield the same result as:
> $fooInstance = new Foo;
Can you provide the definition of you
* Thus wrote Maciek Ruckgaber Bielecki:
> you are just missing the (); it wont work either in php4 or php5 that
> way.
>
>
> $className = "Foo";
> $fooInstance = new $className();
$a = new Foo;
Is perfectly valid.
Curt
--
The above comments may offend you. flame at will.
--
PHP General
you are just missing the (); it wont work either in php4 or php5 that
way.
$className = "Foo";
$fooInstance = new $className();
Cheers
On Tue, Sep 28, 2004 at 01:46:27PM -0600, Daniel Watrous wrote:
> Hello all,
>
> I have a class Foo. In PHP4 I could create an instance of Foo in the follow
On Tue, 28 Sep 2004 13:46:27 -0600, Daniel Watrous
<[EMAIL PROTECTED]> wrote:
> In my efforts to port this over to PHP5 I am having trouble. Not only do I not get
> back an
> instance of my Foo class, but the script execution stops entirely without so much as
> a
> warning.
My first suggesti
Hello all,
I have a class Foo. In PHP4 I could create an instance of Foo in the following manner:
$className = "Foo";
$fooInstance = new $className;
This would yield the same result as:
$fooInstance = new Foo;
In my efforts to port this over to PHP5 I am having trouble. Not only do I not get
7 matches
Mail list logo