Re: [PHP4BETA] eval'ing a method
| From: | Mitch Vincent | Date: | Fri, 05 May 2000 19:40:56 +0000 |
| Subject: | Re: [PHP4BETA] eval'ing a method | ||
| References: | 1 2 3 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-14551@lists.php.net to get a copy of this message | ||
This was more a comment in general than anything, you're right though, he
did try it!
Sorry Mark(?)!
----- Original Message -----
From: Faisal Nasim <faisal@nasim.org>
To: Mitch Vincent <mitch@venux.net>; Mark Constable <markc@renta.net>;
<php4beta@lists.php.net>
Sent: Friday, May 05, 2000 2:22 PM
Subject: Re: [PHP4BETA] eval'ing a method
> | Just a comment, I don't know in theory if this will work, I really doubt
> it
> | will as-is.. I see some problems with scope and special characters that
I
> | won't get into..
>
> If you looked at this for a moment, you would understand exactly
> what he is asking for! And he gave the error showing that it wasn't
> working and if there is a possible workaround to that (see other
> message).
>
> | Still. People posting actual code here and asking if it works seems a
bit
> | silly to me. Try it! Then you'll KNOW if your code works! Someone once
> told
>
>
> He tried it!
>
> <cut>
>
> | > I this possible ? ($m is really coming from an SQL lookup)
> | >
> | > <?php
> | > class blah {
> | > var $somevar = 1;
> | >
> | > function somemethod() {
> | > $m = "function somefunc() { $this->somevar = 2; }";
> | > eval($m);
> | > $this->somefunc();
> | > echo "this->somevar=$this->somevar<br>\n";
> | > }
>
>
> Enjoy!
>
> Faisal
>
>