Re: [PHP] Assignment in Conditional - How are they evaluated?

2009-10-29 Thread Eddie Drapkin
On Thu, Oct 29, 2009 at 10:23 AM, Martin Scotta wrote: > On Thu, Oct 29, 2009 at 11:11 AM, Robert Cummings wrote: > >> Ashley Sheridan wrote: >> >>> On Thu, 2009-10-29 at 13:58 +, Mark Skilbeck wrote: >>> >>>  How is the following evaluated: [code] if ($data = somefunc()) ... >>

Re: [PHP] Assignment in Conditional - How are they evaluated?

2009-10-29 Thread Robert Cummings
Ashley Sheridan wrote: On Thu, 2009-10-29 at 13:58 +, Mark Skilbeck wrote: How is the following evaluated: [code] if ($data = somefunc()) ... [/code] Ignoring the 'assignment inside condition' arguments, is the return value of somefunc() assigned to $data, and then $data's value is eval

Re: [PHP] Assignment in Conditional - How are they evaluated?

2009-10-29 Thread Martin Scotta
On Thu, Oct 29, 2009 at 10:58 AM, Mark Skilbeck wrote: > How is the following evaluated: > > [code] > if ($data = somefunc()) ... > [/code] > > Ignoring the 'assignment inside condition' arguments, is the return value > of somefunc() assigned to $data, and then $data's value is evaluated (to > tru

Re: [PHP] Assignment in Conditional - How are they evaluated?

2009-10-29 Thread Ashley Sheridan
On Thu, 2009-10-29 at 13:58 +, Mark Skilbeck wrote: > How is the following evaluated: > > [code] > if ($data = somefunc()) ... > [/code] > > Ignoring the 'assignment inside condition' arguments, is the return > value of somefunc() assigned to $data, and then $data's value is > evaluated (t

Re: [PHP] assignment

2004-12-11 Thread Chris
That's a variable variable name. http://us2.php.net/manual/en/language.variables.variable.php So $temp3 = 'valueoftemp3'; $temp2 = 'temp3'; $temp = $$temp2; $$temp2 === $temp3; Song Ken Vern wrote: Hi, Tried searching for what this $$ operator means. But can't get the right results by using $$ a

Re: [PHP] assignment

2004-12-11 Thread Jason Wong
On Friday 10 December 2004 12:02, Song Ken Vern wrote: > Tried searching for what this $$ operator means. > But can't get the right results by using $$ as search string in php manual. > > $temp = $$temp2; Search for "variable variables" > Is this an array assignment? No, but in most cases where

Re: [PHP] assignment

2004-12-11 Thread Ryan King
On Dec 9, 2004, at 10:02 PM, Song Ken Vern wrote: Hi, Tried searching for what this $$ operator means. But can't get the right results by using $$ as search string in php manual. $temp = $$temp2; Is this an array assignment? No, its a variable varible: http://us2.php.net/manual/en/language.variab

Re: [PHP] assignment

2004-12-11 Thread Sebastian
variables variable? http://us2.php.net/manual/en/language.variables.variable.php - Original Message - From: "Song Ken Vern" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, December 09, 2004 11:02 PM Subject: [PHP] assignment > Hi, > > Tried searching for what this $$ operato

RE: [PHP] Assignment operator questions

2003-05-31 Thread Joe Stump
Exactly what you just did will work ... $a, $b and $c all are 1 now. --Joe -- Joe Stump <[EMAIL PROTECTED]> http://www.joestump.net "Label makers are proof God wants Sys Admins to be happy." -Original Message- From: Andrew D. Luebke [mailto:[EMAIL PROTECTED] Sent: Friday, May 30, 200

RE: [PHP] assignment by reference bug? (update)

2002-12-21 Thread reynardmh
just a little update after playing arround with this stuffs, I think this behavior happens when there is nothing else pointing to variable $a. so for example, this works also: $tmp =& $a; $a =& $a->next; I'm wondering how php does garbage collection? does it immediately delete variables th

Re: [PHP] Assignment operator proposal

2002-03-21 Thread Rasmus Lerdorf
> Please note, there are many German PHP developers. Most of them are > not so stupid ... Oh, I don't know about that. I have met a bunch of them... ;) -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Assignment operator proposal

2002-03-21 Thread Bogdan Stancescu
[EMAIL PROTECTED] wrote: > I think this is a nice idea for php8 (or some release, I´ll never have > to use) > The main thing in using php is that it is close to c. > As there are so many new functions, some of them are not really > necessary, > I would not prefer shortcuts like these. Who shoul

Re: [PHP] Assignment operator proposal

2002-03-21 Thread Bogdan Stancescu
Egon Schmid wrote: >From: "Enrico Weigelt" <[EMAIL PROTECTED]> > > >Please note, there are many German PHP developers. Most of them are >not so stupid ... > I must say I fail to understand both the meaning and the reason for the harsness in your reply. Bogdan -- PHP General Mailing List (h

Re: [PHP] Assignment operator proposal

2002-03-20 Thread Egon Schmid
From: "Enrico Weigelt" <[EMAIL PROTECTED]> > On Thu, Mar 21, 2002 at 12:36:26AM +0200, Bogdan Stancescu wrote: > > > Hi all! > > > > I'd like to hear from a single one of you who isn't tired of code similar to > > i'm solving this with some little knowledge of shortcuts evaluation ... > > > > i

Re: [PHP] Assignment operator proposal

2002-03-20 Thread heinisch
At 21.03.2002 00:36, you wrote: >Hi all! > >I'd like to hear from a single one of you who isn't tired of code similar to > > if (!$whatever) { >$whatever=something; > } >?> > >or else > > if ($whatever) > { >$somethingelse=$whatever; > } >?> > >How about a new asignment operator whic

RE: [PHP] Assignment operator proposal

2002-03-20 Thread Kevin Stone
There seems to be a parse error in your code. The words "Python" and "enthusiast" can not exist together in the same substr. This will result in the "LMAO error" you've been receiving. :) -Kevin -Original Message- From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]] Sent: Wednesday, Marc

Re: [PHP] Assignment operator proposal

2002-03-20 Thread Enrico Weigelt
On Thu, Mar 21, 2002 at 12:36:26AM +0200, Bogdan Stancescu wrote: > Hi all! > > I'd like to hear from a single one of you who isn't tired of code similar to i'm solving this with some little knowledge of shortcuts evaluation ... > if (!$whatever) { >$whatever=something; > } > ?> (($wh

Re: [PHP] assignment operator works for comparison??

2001-04-11 Thread Renze Munnik
Dan wrote: > > This confused me for awhile, because the single equal sign seemed to work > for comparison, but created inexplicable errors in my programs. It seems > strange to me that a successful variable value assignment does not return > true. > > example: > > > $shiny = 1; > if($shiny

Re: [PHP] assignment operator works for comparison??

2001-04-11 Thread Harshdeep S Jawanda
Hi, Dan wrote: > > > if($shiny = 0){ > > This does not compare anyting, it assigns 0 to $shiny > > yes i know, but shouldnt this operation return true? No, it doesn't return true. The "=" operator returns the value of the expression on its right hand side. Therefore, the statement given above

Re: [PHP] assignment operator works for comparison??

2001-04-10 Thread Yasuo Ohgaki
> if($shiny = 0) This line is the same as if ((shiny = 0) == TRUE) It's common error with PHP and C. You could make use of this like if ($fp = fopen($filename,'r')) since this is the same as if (($fp = fopen($filename,'r')) == TRUE) code after this line is executed when fopen() success to

Re: [PHP] assignment operator works for comparison??

2001-04-10 Thread Dan
You are right, thank you. > It looks to me like the value of an assignment is the value assigned, as in > Perl. But I don't know for sure, haven't come across this in the manual. > > Kirk > > > > > if($shiny = 0){ > > > This does not compare anyting, it assigns 0 to $shiny > > > > yes i know, bu

RE: [PHP] assignment operator works for comparison??

2001-04-10 Thread Johnson, Kirk
L PROTECTED] > Subject: Re: [PHP] assignment operator works for comparison?? > > > > > > > > if($shiny = 0){ > > This does not compare anyting, it assigns 0 to $shiny > > yes i know, but shouldnt this operation return true? -- PHP General Mailing List (

Re: [PHP] assignment operator works for comparison??

2001-04-10 Thread Dan
> > > if($shiny = 0){ > This does not compare anyting, it assigns 0 to $shiny yes i know, but shouldnt this operation return true? > > > echo( $shiny ) // this will return 0 > That's normal, you just assign 0 to it ;) > > = assignment operator > == comparison operator > > py > > > At 01:53 PM

Re: [PHP] assignment operator works for comparison??

2001-04-10 Thread Pierre-Yves Lemaire
> if($shiny = 0){ This does not compare anyting, it assigns 0 to $shiny > echo( $shiny ) // this will return 0 That's normal, you just assign 0 to it ;) = assignment operator == comparison operator py At 01:53 PM 4/10/01 -0700, you wrote: >This confused me for awhile, because the single eq