RE: [PHP] Expand variable in comparison

2008-01-18 Thread Andrés Robinet
> -Original Message- > From: news [mailto:[EMAIL PROTECTED] On Behalf Of Marcus > Sent: Friday, January 18, 2008 4:51 PM > To: php-general@lists.php.net > Subject: [PHP] Expand variable in comparison > > Hi! > > > Is there any way to get the foll

Re: [PHP] Expand variable in comparison

2008-01-19 Thread Jochem Maas
Marcus schreef: Hi! Is there any way to get the following snippet returning a true? ... $this->var = ? $this->var = $preDefinedStringToTestWith; echo $preDefinedStringToTestWith; if ($this->var == $preDefinedStringToTestWith) return true; else false; what are you trying to

Re: [PHP] Expand variable in comparison

2008-01-19 Thread Richard Lynch
You can cheat like this: define('DEBUG', 1); if (DEBUG || $this->var == $preDefinedStringToTestWith) return true; else return false; At some later date, you change the 1 to 0 in the define() statement. Please tell us WHY you want do what you want to do... On Fri, January 18, 2008 1:50 pm,

Re: [PHP] Expand variable in comparison

2008-01-19 Thread Casey
On Jan 19, 2008 9:52 AM, Richard Lynch <[EMAIL PROTECTED]> wrote: > You can cheat like this: > > define('DEBUG', 1); > > if (DEBUG || $this->var == $preDefinedStringToTestWith) > return true; > else > return false; > > At some later date, you change the 1 to 0 in the define() statement. > > Ple