#28845 [Opn-Csd]: warning on two TRUE expressions while calling include*() in a if-statement

2004-10-06 Thread david dot rech at virusmedia dot de
 ID:   28845
 User updated by:  david dot rech at virusmedia dot de
 Reported By:  david dot rech at virusmedia dot de
-Status:   Open
+Status:   Closed
 Bug Type: *Directory/Filesystem functions
 Operating System: Windows XP SP1
 PHP Version:  4CVS-2004-06-19 (stable)
 New Comment:

Somehow fixed in 4.3.9, and I don't have a clue why. This was also
reproduced by another developer.

Did just nobody close the bug or anything? Dunno.

Keep up the good work.


Previous Comments:


[2004-06-19 20:04:43] david dot rech at virusmedia dot de

Sorry, missed the closing brace in second if-statement...

Must be:

Whereas that code, with the first expression in braces, prints 1
again.

if( (include_once(__FILE__))  is_integer(1) ) echo 1;



[2004-06-19 20:02:25] david dot rech at virusmedia dot de

Description:

I've notice some strange behaviour with include() and include_once()
calls in an if-statement whereas two expressions are TRUE and logically
combined with the '' operator.

While if( true  true ) echo 1; would print out 1 as expected, this
code however does not:

if( include_once(__FILE__)  is_integer(1) ) echo 1;

Whereas that code, with the first expression in braces, prints 1
again.

if( (include_once(__FILE__)  is_integer(1) ) echo 1;


In the example you should notice that the expression is still TRUE with
other functions - even without braces around first expression.

Also, somehow the result of the second expression gets copied to the
first argument of the first expression as an integer.

Look at this warning:

Warning: main(1): failed to open stream: No such file or directory in
[...] on line 12

That's what happens if second expression is true and include_once()
was'nt put into braces. Try to negate the second expression - you will
get a '0' referred as the argument of include_once() in the warning.

So is this some strange magic, or did I've miss the point completely?

Reproduce code:
---
?php
// Expected behaviour
if( true  true ) { // As expected - the expression is TRUE
echo 1st: That may have worked\n;
}

// Weird behaviour
if( class_exists('stdClass')  is_integer(1) ) { // Again - the
expression is TRUE
echo 2nd: You don't see that, don't you?\n;
}

if( @include_once(__FILE__)  is_integer(1) ) { // Expression seems to
be FALSE and causes a weird warning without the @
echo 3rd: So you see this..?;
}

if( (include_once(__FILE__))  is_integer(1) ) { // TRUE
echo 4rd: In fact, you see this...;
}
?

Expected result:

1st: That may have worked
2nd: You don't see that, don't you?
3rd: So you see this..?
4rd: In fact, you see this...

Actual result:
--
1st: That may have worked
2nd: You don't see that, don't you?
4rd: In fact, you see this...





-- 
Edit this bug report at http://bugs.php.net/?id=28845edit=1


#28845 [NEW]: warning on two TRUE expressions while calling include*() in a if-statement

2004-06-19 Thread david dot rech at virusmedia dot de
From: david dot rech at virusmedia dot de
Operating system: Windows XP SP1
PHP version:  4CVS-2004-06-19 (stable)
PHP Bug Type: *Directory/Filesystem functions
Bug description:  warning on two TRUE expressions while calling include*() in a 
if-statement

Description:

I've notice some strange behaviour with include() and include_once() calls
in an if-statement whereas two expressions are TRUE and logically combined
with the '' operator.

While if( true  true ) echo 1; would print out 1 as expected, this
code however does not:

if( include_once(__FILE__)  is_integer(1) ) echo 1;

Whereas that code, with the first expression in braces, prints 1 again.

if( (include_once(__FILE__)  is_integer(1) ) echo 1;


In the example you should notice that the expression is still TRUE with
other functions - even without braces around first expression.

Also, somehow the result of the second expression gets copied to the first
argument of the first expression as an integer.

Look at this warning:

Warning: main(1): failed to open stream: No such file or directory in
[...] on line 12

That's what happens if second expression is true and include_once() was'nt
put into braces. Try to negate the second expression - you will get a '0'
referred as the argument of include_once() in the warning.

So is this some strange magic, or did I've miss the point completely?

Reproduce code:
---
?php
// Expected behaviour
if( true  true ) { // As expected - the expression is TRUE
echo 1st: That may have worked\n;
}

// Weird behaviour
if( class_exists('stdClass')  is_integer(1) ) { // Again - the
expression is TRUE
echo 2nd: You don't see that, don't you?\n;
}

if( @include_once(__FILE__)  is_integer(1) ) { // Expression seems to be
FALSE and causes a weird warning without the @
echo 3rd: So you see this..?;
}

if( (include_once(__FILE__))  is_integer(1) ) { // TRUE
echo 4rd: In fact, you see this...;
}
?

Expected result:

1st: That may have worked
2nd: You don't see that, don't you?
3rd: So you see this..?
4rd: In fact, you see this...

Actual result:
--
1st: That may have worked
2nd: You don't see that, don't you?
4rd: In fact, you see this...

-- 
Edit bug report at http://bugs.php.net/?id=28845edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28845r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28845r=trysnapshot5
Fixed in CVS:   http://bugs.php.net/fix.php?id=28845r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=28845r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28845r=needtrace
Need Reproduce Script:  http://bugs.php.net/fix.php?id=28845r=needscript
Try newer version:  http://bugs.php.net/fix.php?id=28845r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=28845r=support
Expected behavior:  http://bugs.php.net/fix.php?id=28845r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=28845r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=28845r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=28845r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28845r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=28845r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=28845r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=28845r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28845r=float


#28845 [Opn]: warning on two TRUE expressions while calling include*() in a if-statement

2004-06-19 Thread david dot rech at virusmedia dot de
 ID:   28845
 User updated by:  david dot rech at virusmedia dot de
 Reported By:  david dot rech at virusmedia dot de
 Status:   Open
 Bug Type: *Directory/Filesystem functions
 Operating System: Windows XP SP1
 PHP Version:  4CVS-2004-06-19 (stable)
 New Comment:

Sorry, missed the closing brace in second if-statement...

Must be:

Whereas that code, with the first expression in braces, prints 1
again.

if( (include_once(__FILE__))  is_integer(1) ) echo 1;


Previous Comments:


[2004-06-19 20:02:25] david dot rech at virusmedia dot de

Description:

I've notice some strange behaviour with include() and include_once()
calls in an if-statement whereas two expressions are TRUE and logically
combined with the '' operator.

While if( true  true ) echo 1; would print out 1 as expected, this
code however does not:

if( include_once(__FILE__)  is_integer(1) ) echo 1;

Whereas that code, with the first expression in braces, prints 1
again.

if( (include_once(__FILE__)  is_integer(1) ) echo 1;


In the example you should notice that the expression is still TRUE with
other functions - even without braces around first expression.

Also, somehow the result of the second expression gets copied to the
first argument of the first expression as an integer.

Look at this warning:

Warning: main(1): failed to open stream: No such file or directory in
[...] on line 12

That's what happens if second expression is true and include_once()
was'nt put into braces. Try to negate the second expression - you will
get a '0' referred as the argument of include_once() in the warning.

So is this some strange magic, or did I've miss the point completely?

Reproduce code:
---
?php
// Expected behaviour
if( true  true ) { // As expected - the expression is TRUE
echo 1st: That may have worked\n;
}

// Weird behaviour
if( class_exists('stdClass')  is_integer(1) ) { // Again - the
expression is TRUE
echo 2nd: You don't see that, don't you?\n;
}

if( @include_once(__FILE__)  is_integer(1) ) { // Expression seems to
be FALSE and causes a weird warning without the @
echo 3rd: So you see this..?;
}

if( (include_once(__FILE__))  is_integer(1) ) { // TRUE
echo 4rd: In fact, you see this...;
}
?

Expected result:

1st: That may have worked
2nd: You don't see that, don't you?
3rd: So you see this..?
4rd: In fact, you see this...

Actual result:
--
1st: That may have worked
2nd: You don't see that, don't you?
4rd: In fact, you see this...





-- 
Edit this bug report at http://bugs.php.net/?id=28845edit=1