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()) ...
>>
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()) ...
>>> [/code]
>>>
>>> Ignoring the 'assignment inside condition' argume
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
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
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
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 true or false), or is the actual assignment tested (does
the assignment
At 9:10 AM +1100 12/23/08, Clancy wrote:
Schlossnagle (in "Advanced PHP Programming") advises:
$i = 0; while ($i < $j)
{
++$i;
}
rather than:
$i = 0; while ($i < $j)
{
...
$i++;
}
as the former apparently uses less m
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
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
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
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,
>
>
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?
Thanx.
Ken
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
: Friday, May 30, 2003 11:47 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Assignment operator questions
Is it possible to do the following in PHP a = b = c; Which in C, for
instance would set b and a equal to c. Thanks.
Andrew.
--
PHP General Mailing List (http://www.php.net/)
To unsubscr
Is it possible to do the following in PHP a = b = c; Which in C, for
instance would set b and a equal to c. Thanks.
Andrew.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
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
hi,
I just found this behavior when trying to implement a linked list with php.
In linked list it's common to say:
$a =& $a->next;
when traversing the list. but this doesn't work (it gives segmentation fault when
trying to access the $head->next object (after the above assignment).
but this w
Let's begin with a small code snippet:
class A {
function A( $selector ) {
switch( $selector ) {
case 1: $obj = new A_1(); break;
case 2: $obj = new A_2(); break;
...
}
$this = $obj;
}
}
class A_1 {
...
}
class A_2 {
.
> 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
[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
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
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
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
[EMAIL PROTECTED]]
Sent: Wednesday, March 20, 2002 3:36 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Assignment operator proposal
Hi all!
I'd like to hear from a single one of you who isn't tired of code
similar to
or else
How about a new asignment operator which would shut up all those Pyt
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
Hi all!
I'd like to hear from a single one of you who isn't tired of code similar to
or else
How about a new asignment operator which would shut up all those Python
enthusiasts - let's say the new operator would be caret - and we could
replace the first example with
and the second exam
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
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
Hello Dan,
Wednesday, April 11, 2001, 1:29:22 AM, you wrote:
>>
>> > if($shiny = 0){
>> This does not compare anyting, it assigns 0 to $shiny
D> yes i know, but shouldnt this operation return true?
No. This operator returns the value assigned (0 in this case, which is
false). This expression
> 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
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
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 (
>
> > 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
> 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
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:
--Dan
--
PHP General Mailing List (http://www.php.net
34 matches
Mail list logo