#42861 [NEW]: strtr() crashes when $from argument is empty string or null, with Unicode ON

2007-10-05 Thread mahesh dot vemula at in dot ibm dot com
From: mahesh dot vemula at in dot ibm dot com
Operating system: RHEL4, Windows XP
PHP version:  6CVS-2007-10-05 (snap)
PHP Bug Type: Strings related
Bug description:  strtr() crashes when $from argument is empty string or null, 
with Unicode ON

Description:

strtr() crashes on php6 with unicode ON , when $from argument is given as
any of the following:
empty string
Null

e.g:
var_dump( strtr(hello, array( = string) ) );
var_dump( strtr(hello, , string) );

This is applicable for PHP6 with Unicode.

Reproduce code:
---
?php
var_dump( strtr(hello, array( = string) ) );
var_dump( strtr(hello, array('' = string) ) );
var_dump( strtr(hello, array(null = string) ) );
var_dump( strtr(hello, array(NULL = string) ) );

var_dump( strtr(hello, , string) );
var_dump( strtr(hello, '', string) );
var_dump( strtr(hello, NULL, string) );
var_dump( strtr(hello, null, string) );
?

Expected result:

unicode(5) hello
unicode(5) hello
unicode(5) hello
unicode(5) hello
unicode(5) hello
unicode(5) hello
unicode(5) hello
unicode(5) hello

Actual result:
--
On Windows: crashes
On linux(RHEL4):
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to
allocate 1066789985 bytes) in %s on line %d

-- 
Edit bug report at http://bugs.php.net/?id=42861edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42861r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42861r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42861r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42861r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=42861r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=42861r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=42861r=needscript
Try newer version:http://bugs.php.net/fix.php?id=42861r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=42861r=support
Expected behavior:http://bugs.php.net/fix.php?id=42861r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=42861r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=42861r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42861r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42861r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42861r=dst
IIS Stability:http://bugs.php.net/fix.php?id=42861r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=42861r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42861r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=42861r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=42861r=mysqlcfg


#42854 [NEW]: Warning message generated by strtr() contains an extra dot(.) char

2007-10-04 Thread mahesh dot vemula at in dot ibm dot com
From: mahesh dot vemula at in dot ibm dot com
Operating system: RHEL 4, Windows XP
PHP version:  5CVS-2007-10-04 (snap)
PHP Bug Type: Strings related
Bug description:  Warning message generated by strtr() contains an extra 
dot(.) char

Description:

Warning message generated by strtr() contains an extra dot(.) char, when
the second ('replace_pairs') argument is not an array.

It happens only with php5.

Reproduce code:
---
?php
var_dump( strtr(hello, string) );
?


Expected result:

PHP Warning:  strtr(): The second argument is not an array in %s on line
%d
bool(false)

Actual result:
--
PHP Warning:  strtr(): The second argument is not an array. in %s on line
%d
bool(false)

-- 
Edit bug report at http://bugs.php.net/?id=42854edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42854r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42854r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42854r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42854r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=42854r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=42854r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=42854r=needscript
Try newer version:http://bugs.php.net/fix.php?id=42854r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=42854r=support
Expected behavior:http://bugs.php.net/fix.php?id=42854r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=42854r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=42854r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42854r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42854r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42854r=dst
IIS Stability:http://bugs.php.net/fix.php?id=42854r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=42854r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42854r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=42854r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=42854r=mysqlcfg


#42790 [NEW]: strrchr() doesn't work as expected with heredoc string containing blank line

2007-09-28 Thread mahesh dot vemula at in dot ibm dot com
From: mahesh dot vemula at in dot ibm dot com
Operating system: RHEL 4, Windows XP
PHP version:  5CVS-2007-09-28 (snap)
PHP Bug Type: Strings related
Bug description:  strrchr() doesn't work as expected with heredoc string 
containing blank line

Description:

strrchr() function can't find the new line when an heredoc string
containing only a blank line is given as input, whereas it works fine when
the heredoc string containing regular string with new line.

This is noticed on php5 and php6.

Reproduce code:
---
?php
$str1 = EOD

EOD;

$str2 = EOD
hello
hiii
EOD;

//doesn't work as expected
var_dump( strrchr($str1, $str1) );
var_dump( strrchr($str1, \n) );
var_dump( strrchr($str1, 
) );

//works as expected
var_dump( strrchr($str2, \n) );
var_dump( strrchr($str2, 
) );
?


Expected result:

string(1) 

string(1) 

string(1) 

string(9) 
hiii
string(9) 
hiii


Actual result:
--
bool(false)
bool(false)
bool(false)
string(9) 
hiii
string(9) 
hiii


-- 
Edit bug report at http://bugs.php.net/?id=42790edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42790r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42790r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42790r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42790r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=42790r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=42790r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=42790r=needscript
Try newer version:http://bugs.php.net/fix.php?id=42790r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=42790r=support
Expected behavior:http://bugs.php.net/fix.php?id=42790r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=42790r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=42790r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42790r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42790r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42790r=dst
IIS Stability:http://bugs.php.net/fix.php?id=42790r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=42790r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42790r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=42790r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=42790r=mysqlcfg


#42746 [Opn]: '\u' char in single quotes gets interepreted.

2007-09-25 Thread mahesh dot vemula at in dot ibm dot com
 ID:   42746
 User updated by:  mahesh dot vemula at in dot ibm dot com
 Reported By:  mahesh dot vemula at in dot ibm dot com
 Status:   Open
 Bug Type: *Unicode Issues
 Operating System: Linux, Windows XP
-PHP Version:  6CVS-2007-09-24 (CVS)
+PHP Version:  6CVS-2007-09-24 (SNAP)
 New Comment:

Updating the correct Version.


Previous Comments:


[2007-09-24 10:34:10] mahesh dot vemula at in dot ibm dot com

Description:

'\u' escape sequence char in single quotes('') is being interpreted by
PHP6.

Reproduce code:
---
?php
var_dump(\u1234);
var_dump('\u1234');
?


Expected result:

unicode(1) #4660;
unicode(6) \u1234


Actual result:
--
unicode(1) #4660;
unicode(1) #4660;





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


#42746 [NEW]: '\u' char in single quotes gets interepreted.

2007-09-24 Thread mahesh dot vemula at in dot ibm dot com
From: mahesh dot vemula at in dot ibm dot com
Operating system: Linux, Windows XP
PHP version:  6CVS-2007-09-24 (CVS)
PHP Bug Type: *Unicode Issues
Bug description:  '\u' char in single quotes gets interepreted.

Description:

'\u' escape sequence char in single quotes('') is being interpreted by
PHP6.

Reproduce code:
---
?php
var_dump(\u1234);
var_dump('\u1234');
?


Expected result:

unicode(1) #4660;
unicode(6) \u1234


Actual result:
--
unicode(1) #4660;
unicode(1) #4660;

-- 
Edit bug report at http://bugs.php.net/?id=42746edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42746r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42746r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42746r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42746r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=42746r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=42746r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=42746r=needscript
Try newer version:http://bugs.php.net/fix.php?id=42746r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=42746r=support
Expected behavior:http://bugs.php.net/fix.php?id=42746r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=42746r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=42746r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42746r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42746r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42746r=dst
IIS Stability:http://bugs.php.net/fix.php?id=42746r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=42746r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42746r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=42746r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=42746r=mysqlcfg


#42532 [Opn-Bgs]: strncmp() output differs with and without Unicode

2007-09-07 Thread mahesh dot vemula at in dot ibm dot com
 ID:   42532
 User updated by:  mahesh dot vemula at in dot ibm dot com
 Reported By:  mahesh dot vemula at in dot ibm dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Performance problem
 Operating System: RHEL4
 PHP Version:  6CVS-2007-09-03 (CVS)
 New Comment:

The output is valid and expected.


Previous Comments:


[2007-09-03 13:24:56] mahesh dot vemula at in dot ibm dot com

Description:

strncmp() of a regular string(as first argument) with an empty string,
returns an integer value of difference in their length when Unicode is
OFF, and returns int(+1) when the Unicode is ON.  
 
Is this the expected behavior according to documentation, which says
strncmp() returns 0 or 0 when two strings are not equal. Or Could
output be consistent with and without Unicode?




Reproduce code:
---
--TEST--
--FILE--
?php
var_dump( strncmp(Hello, , 10) );
?
--EXPECTF--









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


#42528 [Opn]: Out of char(8-bit) range value doesn't roll back, with uni-code ON.

2007-09-07 Thread mahesh dot vemula at in dot ibm dot com
 ID:   42528
 User updated by:  mahesh dot vemula at in dot ibm dot com
 Reported By:  mahesh dot vemula at in dot ibm dot com
 Status:   Open
 Bug Type: Performance problem
 Operating System: RHEL4
 PHP Version:  6CVS-2007-09-03 (CVS)
 New Comment:

Samething is happening for strncasecmp() function also.


Previous Comments:


[2007-09-03 11:53:31] mahesh dot vemula at in dot ibm dot com

Description:

The character(8-bit) range of value does not roll back to the
corresponding minimum value, once the value reaches beyond the range of
a char(8-bit) that it can hold, when Unicode is ON.


Reproduce code:
---
--TEST--
--FILE--
?php
var_dump( decbin( ord(chr(255)) ) );
var_dump( decbin( ord(chr(256)) ) );
var_dump( decbin( ord(chr(257)) ) );
?
--EXPECTF--


Expected result:

unicode(8) 
unicode(1) 0
unicode(1) 1

Actual result:
--
unicode(8) 
unicode(9) 1
unicode(9) 10001





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


#42528 [NEW]: Out of char(8-bit) range value doesn't roll back, with uni-code ON.

2007-09-03 Thread mahesh dot vemula at in dot ibm dot com
From: mahesh dot vemula at in dot ibm dot com
Operating system: RHEL4
PHP version:  6CVS-2007-09-03 (CVS)
PHP Bug Type: Performance problem
Bug description:  Out of char(8-bit) range value doesn't roll back, with 
uni-code ON.

Description:

The character(8-bit) range of value does not roll back to the
corresponding minimum value, once the value reaches beyond the range of a
char(8-bit) that it can hold, when Unicode is ON.


Reproduce code:
---
--TEST--
--FILE--
?php
var_dump( decbin( ord(chr(255)) ) );
var_dump( decbin( ord(chr(256)) ) );
var_dump( decbin( ord(chr(257)) ) );
?
--EXPECTF--


Expected result:

unicode(8) 
unicode(1) 0
unicode(1) 1

Actual result:
--
unicode(8) 
unicode(9) 1
unicode(9) 10001

-- 
Edit bug report at http://bugs.php.net/?id=42528edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42528r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42528r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42528r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42528r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=42528r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=42528r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=42528r=needscript
Try newer version:http://bugs.php.net/fix.php?id=42528r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=42528r=support
Expected behavior:http://bugs.php.net/fix.php?id=42528r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=42528r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=42528r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42528r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42528r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42528r=dst
IIS Stability:http://bugs.php.net/fix.php?id=42528r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=42528r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42528r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=42528r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=42528r=mysqlcfg


#42532 [NEW]: strncmp() output differs with and without Unicode

2007-09-03 Thread mahesh dot vemula at in dot ibm dot com
From: mahesh dot vemula at in dot ibm dot com
Operating system: RHEL4
PHP version:  6CVS-2007-09-03 (CVS)
PHP Bug Type: Performance problem
Bug description:  strncmp() output differs with and without Unicode

Description:

strncmp() of a regular string(as first argument) with an empty string,
returns an integer value of difference in their length when Unicode is OFF,
and returns int(+1) when the Unicode is ON.  
 
Is this the expected behavior according to documentation, which says
strncmp() returns 0 or 0 when two strings are not equal. Or Could output
be consistent with and without Unicode?




Reproduce code:
---
--TEST--
--FILE--
?php
var_dump( strncmp(Hello, , 10) );
?
--EXPECTF--





-- 
Edit bug report at http://bugs.php.net/?id=42532edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42532r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42532r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42532r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42532r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=42532r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=42532r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=42532r=needscript
Try newer version:http://bugs.php.net/fix.php?id=42532r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=42532r=support
Expected behavior:http://bugs.php.net/fix.php?id=42532r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=42532r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=42532r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42532r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42532r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42532r=dst
IIS Stability:http://bugs.php.net/fix.php?id=42532r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=42532r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42532r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=42532r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=42532r=mysqlcfg


#42111 [Fbk-Opn]: copy() creates file for dir as src

2007-08-14 Thread mahesh dot vemula at in dot ibm dot com
 ID:   42111
 User updated by:  mahesh dot vemula at in dot ibm dot com
 Reported By:  mahesh dot vemula at in dot ibm dot com
-Status:   Feedback
+Status:   Open
 Bug Type: Filesystem function related
 Operating System: RHEL4
 PHP Version:  5CVS-2007-07-26 (CVS)
 New Comment:

Yes, its working fine. Thanks.


Previous Comments:


[2007-08-13 16:54:33] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi





[2007-08-13 11:31:33] mahesh dot vemula at in dot ibm dot com

Fix for bug #42243 can't be a fix for bug #42111. But fix for bug
#42111 would be a fix for #42243.

Bug #42111 needs to be fixed in the following two aspects.
1) copying dir to non-existing destination
 Here, copy() returns FALSE but creates a file  no warning msg. Hence
the fix would be to generate warning msg when the first arg is a dir
even the second arg is a non-existing destination, as copy() function is
not valid on dirs. And also the destination file should not be created.
2) copying dir to existing file
 This is fixed by the fix provided for bug #42243, which is specific
when the first argument is a dir and the second one is an existing
destination.

I am sorry to raise the redundant bug #42243, which led to confusion.



[2007-08-10 13:08:24] [EMAIL PROTECTED]

Isn't this about the same bug as bug #42243 ?? If so, I think this is
fixed too since we now get an error and it returns before the file is
created..?



[2007-07-26 13:40:50] mahesh dot vemula at in dot ibm dot com

Description:

While trying to create a copy of an existing dir by copy() function, it
creates a file which is not expected but returns FALSE as expected. Even
for an existing file as second argument, PHP doesn’t throw any warning
message. It happens against Linux, and works fine against Windows.

Reproduce code:
---
?php
mkdir(copy);
mkdir(copy1);
fclose( fopen(copy.tmp, w) );

var_dump( copy(copy, copy1) );  //copying dir to existing dir,
throws a Warning msg as expected
var_dump( copy(copy.tmp, copy) );  //copying file to a dir, throws
a warning msg as expected

var_dump( copy(copy, copy_copy) );  //copying dir to non-existing
dest, copy returns FALSE but creates a file  no warning msg
var_dump( copy(copy, copy_dir.tmp) );  //copying dir to
non-existing file, copy returns FALSE but creates a file  no warning
msg
var_dump( copy(copy, copy.tmp) );  //copying dir to an existing
file, copy returns FALSE but no warning msg

unlink(copy_copy);
unlink(copy_dir.tmp);
unlink(copy.tmp);
rmdir(copy1);
rmdir(copy);
?


Expected result:

Creation of file is not expected and a required warning messages are
expected.

Actual result:
--
Warning: copy(copy1): failed to open stream: Is a directory in %s on
line %d
bool(false)

Warning: copy(copy): failed to open stream: Is a directory in %s on
line %d
bool(false)
bool(false)
bool(false)
bool(false)






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


#42072 [Csd-Opn]: No warning message for clearstatcache() with arguments

2007-08-13 Thread mahesh dot vemula at in dot ibm dot com
 ID:   42072
 User updated by:  mahesh dot vemula at in dot ibm dot com
 Reported By:  mahesh dot vemula at in dot ibm dot com
-Status:   Closed
+Status:   Open
-Bug Type: Filesystem function related
+Bug Type: *General Issues
 Operating System: RHEL 4, Windows Xp
-PHP Version:  5CVS-2007-07-22 (CVS)
+PHP Version:  PHP6
 New Comment:

Warning message is expected for PHP6 also.


Previous Comments:


[2007-07-23 23:03:24] [EMAIL PROTECTED]

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.





[2007-07-22 18:08:22] mahesh dot vemula at in dot ibm dot com

Description:

PHP engine doesn’t throw the Warning message regarding “Wrong parameter
count” for the function clearstatcache() with one or more arguments, as
function expects zero number (void) of arguments.




Environment:
Operating System: Linux, Windows XP
PHP Version:PHP 5.2.4-dev (cli) (built: Jul 21 2007 19:21:35)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
Configure Setup: ./configure


Reproduce code:
---
var_dump( clearstatcache(cache) ); //args  expected
var_dump( clearstatcache(cache, 100) ); //args  expected
var_dump( clearstatcache(cache, 100, TRUE) ); //args  expected


Expected result:

PHP Warning:  Wrong parameter count for clearstacache() in %s code on
line %d
NULL
PHP Warning:  Wrong parameter count for clearstacache() in %s code on
line %d
NULL
PHP Warning:  Wrong parameter count for clearstacache() in %s code on
line %d
NULL


Actual result:
--
NULL
NULL
NULL






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


#42111 [Fbk-Opn]: copy() creates file for dir as src

2007-08-13 Thread mahesh dot vemula at in dot ibm dot com
 ID:   42111
 User updated by:  mahesh dot vemula at in dot ibm dot com
 Reported By:  mahesh dot vemula at in dot ibm dot com
-Status:   Feedback
+Status:   Open
 Bug Type: Filesystem function related
 Operating System: RHEL4
 PHP Version:  5CVS-2007-07-26 (CVS)
 New Comment:

Fix for bug #42243 can't be a fix for bug #42111. But fix for bug
#42111 would be a fix for #42243.

Bug #42111 needs to be fixed in the following two aspects.
1) copying dir to non-existing destination
 Here, copy() returns FALSE but creates a file  no warning msg. Hence
the fix would be to generate warning msg when the first arg is a dir
even the second arg is a non-existing destination, as copy() function is
not valid on dirs. And also the destination file should not be created.
2) copying dir to existing file
 This is fixed by the fix provided for bug #42243, which is specific
when the first argument is a dir and the second one is an existing
destination.

I am sorry to raise the redundant bug #42243, which led to confusion.


Previous Comments:


[2007-08-10 13:08:24] [EMAIL PROTECTED]

Isn't this about the same bug as bug #42243 ?? If so, I think this is
fixed too since we now get an error and it returns before the file is
created..?



[2007-07-26 13:40:50] mahesh dot vemula at in dot ibm dot com

Description:

While trying to create a copy of an existing dir by copy() function, it
creates a file which is not expected but returns FALSE as expected. Even
for an existing file as second argument, PHP doesn’t throw any warning
message. It happens against Linux, and works fine against Windows.

Reproduce code:
---
?php
mkdir(copy);
mkdir(copy1);
fclose( fopen(copy.tmp, w) );

var_dump( copy(copy, copy1) );  //copying dir to existing dir,
throws a Warning msg as expected
var_dump( copy(copy.tmp, copy) );  //copying file to a dir, throws
a warning msg as expected

var_dump( copy(copy, copy_copy) );  //copying dir to non-existing
dest, copy returns FALSE but creates a file  no warning msg
var_dump( copy(copy, copy_dir.tmp) );  //copying dir to
non-existing file, copy returns FALSE but creates a file  no warning
msg
var_dump( copy(copy, copy.tmp) );  //copying dir to an existing
file, copy returns FALSE but no warning msg

unlink(copy_copy);
unlink(copy_dir.tmp);
unlink(copy.tmp);
rmdir(copy1);
rmdir(copy);
?


Expected result:

Creation of file is not expected and a required warning messages are
expected.

Actual result:
--
Warning: copy(copy1): failed to open stream: Is a directory in %s on
line %d
bool(false)

Warning: copy(copy): failed to open stream: Is a directory in %s on
line %d
bool(false)
bool(false)
bool(false)
bool(false)






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


#42244 [Opn-Bgs]: file_exists() always returns TRUE with the filename as wild-card char(*) on Win

2007-08-09 Thread mahesh dot vemula at in dot ibm dot com
 ID:   42244
 User updated by:  mahesh dot vemula at in dot ibm dot com
 Reported By:  mahesh dot vemula at in dot ibm dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Performance problem
 Operating System: Windows XP
 PHP Version:  6CVS-2007-08-08 (snap)
 New Comment:

The probelm is fixed in latest snapshot.


Previous Comments:


[2007-08-08 10:09:53] mahesh dot vemula at in dot ibm dot com

Description:

file_exists() function behavior on PHP6 differs with PHP5 for the
filenames containing wild-card char(*). 
PHP6 always returns TRUE for the file name with *, and matches any
file with the filename containing wild-card char(*). This is happening
only for Windows.

Reproduce code:
---
?php
var_dump( file_exists(*) );
?

Expected result:

bool(false)

Actual result:
--
bool(true)





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


#42243 [NEW]: Needs to generate a warning message for copy() when the first arg is a dir

2007-08-08 Thread mahesh dot vemula at in dot ibm dot com
From: mahesh dot vemula at in dot ibm dot com
Operating system: RHEL4
PHP version:  5CVS-2007-08-08 (CVS)
PHP Bug Type: Performance problem
Bug description:  Needs to generate a warning message for copy() when the first 
arg is a dir

Description:

On Linux, PHP engine doesn't throw any warning message even if the first
arg is a dir, whereas on Windows it does. According to PHP doc, copy()
function should not work on directories.


Reproduce code:
---
?php
mkdir(temp);
fclose( fopen(temp.txt, w) );
var_dump( copy(temp, temp.txt) );
unlink(temp.txt);
rmdir(temp);
?

Expected result:

expecting a warning message on Linux

Actual result:
--
bool(false)

-- 
Edit bug report at http://bugs.php.net/?id=42243edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42243r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42243r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42243r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42243r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=42243r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=42243r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=42243r=needscript
Try newer version:http://bugs.php.net/fix.php?id=42243r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=42243r=support
Expected behavior:http://bugs.php.net/fix.php?id=42243r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=42243r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=42243r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42243r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42243r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42243r=dst
IIS Stability:http://bugs.php.net/fix.php?id=42243r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=42243r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42243r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=42243r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=42243r=mysqlcfg


#42244 [NEW]: file_exists() always returns TRUE with the filename as wild-card char(*) on Win

2007-08-08 Thread mahesh dot vemula at in dot ibm dot com
From: mahesh dot vemula at in dot ibm dot com
Operating system: Windows XP
PHP version:  6CVS-2007-08-08 (snap)
PHP Bug Type: Performance problem
Bug description:  file_exists() always returns TRUE with the filename as 
wild-card char(*) on Win

Description:

file_exists() function behavior on PHP6 differs with PHP5 for the
filenames containing wild-card char(*). 
PHP6 always returns TRUE for the file name with *, and matches any file
with the filename containing wild-card char(*). This is happening only for
Windows.

Reproduce code:
---
?php
var_dump( file_exists(*) );
?

Expected result:

bool(false)

Actual result:
--
bool(true)

-- 
Edit bug report at http://bugs.php.net/?id=42244edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42244r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42244r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42244r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42244r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=42244r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=42244r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=42244r=needscript
Try newer version:http://bugs.php.net/fix.php?id=42244r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=42244r=support
Expected behavior:http://bugs.php.net/fix.php?id=42244r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=42244r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=42244r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42244r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42244r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42244r=dst
IIS Stability:http://bugs.php.net/fix.php?id=42244r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=42244r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42244r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=42244r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=42244r=mysqlcfg


#42248 [NEW]: filesize() on symlink returns size of the file pointed by it.

2007-08-08 Thread mahesh dot vemula at in dot ibm dot com
From: mahesh dot vemula at in dot ibm dot com
Operating system: RHEL4
PHP version:  5CVS-2007-08-08 (snap)
PHP Bug Type: Performance problem
Bug description:  filesize() on symlink returns size of the file pointed by it.

Description:

When filesize() is applied on a symbolic link to a file, it returns the
size of the file pointed by it instead of returning the size of symlink
itself. This is happening for both php5 and php6. Is this the valid
behavior?

Reproduce code:
---
?php
$file_handle = fopen(test.tmp, w);
fwrite( $file_handle, str_repeat(Hello World, this is 2007 year \n,
100) );
fclose($file_handle);

symlink(test.tmp, test_symlink.tmp);  //creating symlink

var_dump( filesize(test_symlink.tmp) );  //size of the symlink itself
clearstatcache();
var_dump( filesize(test.tmp) );  //size of the file
clearstatcache();

unlink(test_symlink.tmp);
unlink(test.tmp);
?


Expected result:

-sizeof(symlink)-
int(3600)

Actual result:
--
int(3600)
int(3600)

-- 
Edit bug report at http://bugs.php.net/?id=42248edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42248r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42248r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42248r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42248r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=42248r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=42248r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=42248r=needscript
Try newer version:http://bugs.php.net/fix.php?id=42248r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=42248r=support
Expected behavior:http://bugs.php.net/fix.php?id=42248r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=42248r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=42248r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42248r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42248r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42248r=dst
IIS Stability:http://bugs.php.net/fix.php?id=42248r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=42248r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42248r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=42248r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=42248r=mysqlcfg


#42111 [NEW]: copy() does unexpected creation of file for dir as src returns FALSE as expec

2007-07-26 Thread mahesh dot vemula at in dot ibm dot com
From: mahesh dot vemula at in dot ibm dot com
Operating system: RHEL4
PHP version:  5CVS-2007-07-26 (CVS)
PHP Bug Type: Scripting Engine problem
Bug description:  copy() does unexpected creation of file for dir as src  
returns FALSE as expec

Description:

While trying to create a copy of an existing dir by copy() function, it
creates a file which is not expected but returns FALSE as expected. Even
for an existing file as second argument, PHP doesn’t throw any warning
message. It happens against Linux, and works fine against Windows.

Reproduce code:
---
?php
mkdir(copy);
mkdir(copy1);
fclose( fopen(copy.tmp, w) );

var_dump( copy(copy, copy1) );  //copying dir to existing dir, throws
a Warning msg as expected
var_dump( copy(copy.tmp, copy) );  //copying file to a dir, throws a
warning msg as expected

var_dump( copy(copy, copy_copy) );  //copying dir to non-existing
dest, copy returns FALSE but creates a file  no warning msg
var_dump( copy(copy, copy_dir.tmp) );  //copying dir to non-existing
file, copy returns FALSE but creates a file  no warning msg
var_dump( copy(copy, copy.tmp) );  //copying dir to an existing file,
copy returns FALSE but no warning msg

unlink(copy_copy);
unlink(copy_dir.tmp);
unlink(copy.tmp);
rmdir(copy1);
rmdir(copy);
?


Expected result:

Creation of file is not expected and a required warning messages are
expected.

Actual result:
--
Warning: copy(copy1): failed to open stream: Is a directory in %s on line
%d
bool(false)

Warning: copy(copy): failed to open stream: Is a directory in %s on line
%d
bool(false)
bool(false)
bool(false)
bool(false)


-- 
Edit bug report at http://bugs.php.net/?id=42111edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42111r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42111r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42111r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42111r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=42111r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=42111r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=42111r=needscript
Try newer version:http://bugs.php.net/fix.php?id=42111r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=42111r=support
Expected behavior:http://bugs.php.net/fix.php?id=42111r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=42111r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=42111r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42111r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42111r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42111r=dst
IIS Stability:http://bugs.php.net/fix.php?id=42111r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=42111r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42111r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=42111r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=42111r=mysqlcfg


#42111 [Opn]: copy() does unexpected creation of file for dir as src but returns expecte FALSE

2007-07-26 Thread mahesh dot vemula at in dot ibm dot com
 ID:   42111
 User updated by:  mahesh dot vemula at in dot ibm dot com
-Summary:  copy() does unexpected creation of file for dir as src
returns FALSE as expec
 Reported By:  mahesh dot vemula at in dot ibm dot com
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: RHEL4
 PHP Version:  5CVS-2007-07-26 (CVS)
 New Comment:

Changed the Summary to make precise.


Previous Comments:


[2007-07-26 13:40:50] mahesh dot vemula at in dot ibm dot com

Description:

While trying to create a copy of an existing dir by copy() function, it
creates a file which is not expected but returns FALSE as expected. Even
for an existing file as second argument, PHP doesn’t throw any warning
message. It happens against Linux, and works fine against Windows.

Reproduce code:
---
?php
mkdir(copy);
mkdir(copy1);
fclose( fopen(copy.tmp, w) );

var_dump( copy(copy, copy1) );  //copying dir to existing dir,
throws a Warning msg as expected
var_dump( copy(copy.tmp, copy) );  //copying file to a dir, throws
a warning msg as expected

var_dump( copy(copy, copy_copy) );  //copying dir to non-existing
dest, copy returns FALSE but creates a file  no warning msg
var_dump( copy(copy, copy_dir.tmp) );  //copying dir to
non-existing file, copy returns FALSE but creates a file  no warning
msg
var_dump( copy(copy, copy.tmp) );  //copying dir to an existing
file, copy returns FALSE but no warning msg

unlink(copy_copy);
unlink(copy_dir.tmp);
unlink(copy.tmp);
rmdir(copy1);
rmdir(copy);
?


Expected result:

Creation of file is not expected and a required warning messages are
expected.

Actual result:
--
Warning: copy(copy1): failed to open stream: Is a directory in %s on
line %d
bool(false)

Warning: copy(copy): failed to open stream: Is a directory in %s on
line %d
bool(false)
bool(false)
bool(false)
bool(false)






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


#42069 [NEW]: parse_ini_file() gives wrong output with some of Non-alpha numeric characters

2007-07-22 Thread mahesh dot vemula at in dot ibm dot com
From: mahesh dot vemula at in dot ibm dot com
Operating system: RHEL 4, Windows Xp
PHP version:  5CVS-2007-07-22 (CVS)
PHP Bug Type: Performance problem
Bug description:  parse_ini_file() gives wrong output with some of Non-alpha 
numeric characters

Description:

PHP engine doesn’t throw the expected parsing error (which is according to
doc) with the “input string given in “parse.ini file” containing [EMAIL 
PROTECTED] char
and which is not included in double quotes (“”). 
Documentation says -
“Note: If a value in the ini file contains any non-alphanumeric characters
it needs to be enclosed in double-quotes () in
”http://in2.php.net/manual/en/function.parse-ini-file.php.
And it is happening with many other Non-alpha numeric chars like #, %, ,
+, -, `, ^, , , :, ‘, _, ?, etc. 
For some of chars like ‘!’, ‘~’, ‘()’, etc php throws parsing error which
is expected according to doc.


Environment:
Operating System: Linux, Windows XP
PHP Version:PHP 5.2.4-dev (cli) (built: Jul 21 2007 19:21:35)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
Configure Setup: ./configure


Reproduce code:
---
Parse_ini_file.php:
?php
$ini_array = parse_ini_file(dirname(__FILE__)./parse.ini);
print_r($ini_array);
?



parse.ini:
;start of ini file

[Strings with non-alpha numeric values]
;without quotes
;Expected a parse error
Non-alpha_string1 = [EMAIL PROTECTED] 
;Throws an error, which is according to doc
;Non-alpha_string2 = Hello!world 

;with quotes
;Works fine, which is according to doc
Non-alpha_string1_quotes = [EMAIL PROTECTED]
Non-alpha_string2_quotes = Hello!world

;end of ini file


Expected result:

PHP Warning:  Error parsing %s/parse.ini on line %d in
%s\parse_ini_file.php on line %d
Array
(
[Non-alpha_string2] = Hello
)


Actual result:
--
Array
(
[Non-alpha_string1] = [EMAIL PROTECTED]
[Non-alpha_string1_quotes] = [EMAIL PROTECTED]
[Non-alpha_string2_quotes] = Hello!world
)


-- 
Edit bug report at http://bugs.php.net/?id=42069edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42069r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42069r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42069r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42069r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=42069r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=42069r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=42069r=needscript
Try newer version:http://bugs.php.net/fix.php?id=42069r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=42069r=support
Expected behavior:http://bugs.php.net/fix.php?id=42069r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=42069r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=42069r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42069r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42069r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42069r=dst
IIS Stability:http://bugs.php.net/fix.php?id=42069r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=42069r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42069r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=42069r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=42069r=mysqlcfg


#42071 [NEW]: parse_ini_file() doesnt give expected output with NO NULL (reserved)keywords

2007-07-22 Thread mahesh dot vemula at in dot ibm dot com
From: mahesh dot vemula at in dot ibm dot com
Operating system: RHEL 4, Windows Xp
PHP version:  5CVS-2007-07-22 (CVS)
PHP Bug Type: Performance problem
Bug description:  parse_ini_file() doesn’t give expected output with NO  NULL 
(reserved)keywords

Description:

PHP engine doesn’t throw the expected parsing error (which is according to
doc, ”http://in2.php.net/manual/en/function.parse-ini-file.php.) with the
reserved keywords, NO and NULL given as keys in the .ini file. 
For the remaining reserved keywords php throws parsing error which is
expected according to doc.


Environment:
Operating System: Linux, Windows XP
PHP Version:PHP 5.2.4-dev (cli) (built: Jul 21 2007 19:21:35)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
Configure Setup: ./configure

Reproduce code:
---
Parse_ini_file.php:
?php
$ini_array = parse_ini_file(dirname(__FILE__)./parse.ini);
print_r($ini_array);
?



parse.ini:
;start of ini file

[ReservedKeys_as_Keys]
;YES = correct
;expected parsing error
N0 = wrong
NULL = wrong

;end of ini file


Expected result:

PHP Warning:  Error parsing %s/parse.ini on line %d in
%s\parse_ini_file.php on line %d
Array
(
)


Actual result:
--
Array
(
[N0] = wrong
[NULL] = wrong
)


-- 
Edit bug report at http://bugs.php.net/?id=42071edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42071r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42071r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42071r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42071r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=42071r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=42071r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=42071r=needscript
Try newer version:http://bugs.php.net/fix.php?id=42071r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=42071r=support
Expected behavior:http://bugs.php.net/fix.php?id=42071r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=42071r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=42071r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42071r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42071r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42071r=dst
IIS Stability:http://bugs.php.net/fix.php?id=42071r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=42071r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42071r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=42071r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=42071r=mysqlcfg


#42072 [NEW]: No warning message for clearstatcache() with arguments

2007-07-22 Thread mahesh dot vemula at in dot ibm dot com
From: mahesh dot vemula at in dot ibm dot com
Operating system: RHEL 4, Windows Xp
PHP version:  5CVS-2007-07-22 (CVS)
PHP Bug Type: Performance problem
Bug description:  No warning message for clearstatcache() with arguments

Description:

PHP engine doesn’t throw the Warning message regarding “Wrong parameter
count” for the function clearstatcache() with one or more arguments, as
function expects zero number (void) of arguments.




Environment:
Operating System: Linux, Windows XP
PHP Version:PHP 5.2.4-dev (cli) (built: Jul 21 2007 19:21:35)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
Configure Setup: ./configure


Reproduce code:
---
var_dump( clearstatcache(cache) ); //args  expected
var_dump( clearstatcache(cache, 100) ); //args  expected
var_dump( clearstatcache(cache, 100, TRUE) ); //args  expected


Expected result:

PHP Warning:  Wrong parameter count for clearstacache() in %s code on line
%d
NULL
PHP Warning:  Wrong parameter count for clearstacache() in %s code on line
%d
NULL
PHP Warning:  Wrong parameter count for clearstacache() in %s code on line
%d
NULL


Actual result:
--
NULL
NULL
NULL


-- 
Edit bug report at http://bugs.php.net/?id=42072edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42072r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42072r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42072r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42072r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=42072r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=42072r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=42072r=needscript
Try newer version:http://bugs.php.net/fix.php?id=42072r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=42072r=support
Expected behavior:http://bugs.php.net/fix.php?id=42072r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=42072r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=42072r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42072r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42072r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42072r=dst
IIS Stability:http://bugs.php.net/fix.php?id=42072r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=42072r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42072r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=42072r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=42072r=mysqlcfg


#42049 [NEW]: tempnam() creates a file with incorrect default permissions on Windows.

2007-07-19 Thread mahesh dot vemula at in dot ibm dot com
From: mahesh dot vemula at in dot ibm dot com
Operating system: Windows XP
PHP version:  5CVS-2007-07-19 (snap)
PHP Bug Type: *General Issues
Bug description:  tempnam() creates a file with incorrect default permissions 
on Windows.

Description:

The unique file created by tempnam() has the default permissions of 0666
on Windows. But according to documentation
http://in.php.net/manual/en/function.tempnam.php, the default permissions
are 0600. On Linux tempnam() creates a file with permissions of 0600 as
expected i.e according to documentation.

If this is the expected behavior on Windows, please fix the
documentation.



Reproduce code:
---
?php
$file_name = tempnam(., temp);
printf(%o, fileperms($file_name) );
unlink($file_name);
?


Expected result:

100600

Actual result:
--
100666

-- 
Edit bug report at http://bugs.php.net/?id=42049edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42049r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42049r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42049r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42049r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=42049r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=42049r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=42049r=needscript
Try newer version:http://bugs.php.net/fix.php?id=42049r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=42049r=support
Expected behavior:http://bugs.php.net/fix.php?id=42049r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=42049r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=42049r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42049r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42049r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42049r=dst
IIS Stability:http://bugs.php.net/fix.php?id=42049r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=42049r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42049r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=42049r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=42049r=mysqlcfg


#42027 [NEW]: is_file()/is_dir() do not match file/dirnames with wildcard chartrailing slash

2007-07-18 Thread mahesh dot vemula at in dot ibm dot com
From: mahesh dot vemula at in dot ibm dot com
Operating system: RHEL 4
PHP version:  5.2.3
PHP Bug Type: Scripting Engine problem
Bug description:  is_file()/is_dir() do not match file/dirnames with wildcard 
chartrailing slash

Description:

is_file() matches for a file name given with wild-card character/trailing
slash on Windows, but not on Linux. When wild-card char/trailing slash is
given in the file name as input to the function, the function returns false
on Linux. 
In the same manner, is_dir() matches for a dir name given with wild-card
character on Windows, but not on Linux. When wild-card is given in the dir
name as input to the function, the function returns false on Linux.  
A consistent behavior of the function is expected.


Environment:
Operating System: RHEL 4
PHP Version: PHP 5.2 
Configure Setup: ./configure


Reproduce code:
---
?php
fclose( fopen(test.tmp, w) );
var_dump( is_file(test.tmp) );
var_dump( is_file(test.tmp/) );
var_dump( is_file(*.tmp) );
unlink(test.tmp);

mkdir(temp);
var_dump( is_dir(temp) );
var_dump( is_dir(temp/) );
var_dump( is_dir(*mp) );
rmdir(temp);
?


Expected result:

bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)


Actual result:
--
bool(true)
bool(false)
bool(false)
bool(true)
bool(true)
bool(false)


-- 
Edit bug report at http://bugs.php.net/?id=42027edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42027r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42027r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42027r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42027r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=42027r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=42027r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=42027r=needscript
Try newer version:http://bugs.php.net/fix.php?id=42027r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=42027r=support
Expected behavior:http://bugs.php.net/fix.php?id=42027r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=42027r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=42027r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42027r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42027r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42027r=dst
IIS Stability:http://bugs.php.net/fix.php?id=42027r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=42027r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42027r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=42027r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=42027r=mysqlcfg


#41546 [NEW]: Is_callable() function behavior incorrect in PHP5.

2007-05-31 Thread mahesh dot vemula at in dot ibm dot com
From: mahesh dot vemula at in dot ibm dot com
Operating system: RHEL4
PHP version:  5.2.2
PHP Bug Type: Strings related
Bug description:  Is_callable() function behavior incorrect in PHP5.

Description:

In the below testcode, PHP5  PHP6 outputs differ for is_callable()
function.
In PHP6 when we are echo-ing a string( eg. welcome\0 ) with null
character at the end of the string, the output with run-tests shows null
character also at the end of the string.
Whereas, running the file with php5.2.2 gives the expected output ( i.e
welcome).

is_callable() function in PHP 5 is incorrectly truncating the name passed
when it calls ZVAL_STRING,  i.e it should be possible to have function
names with embedded nulls.
The behavior on PHP6 looks be correct.
This is consistent with the expected behaviour after reading Sarah
Goleman's book; page 25. It says: 
 What's worth noting about PHP string is that the length of the string is
always explicitly stated in the zval structure. This allows strings to
contain NULL bytes without being truncated. This aspect of PHP strings will
be referred to hereafter as binary safety because it makes it safe to
contain any type of binary data.

Reproduce code:
---
?php
$undef_functions = array (
  \0,
  '\0',
  welcome\0,
  'welcome\0',
);
$counter = 1;
foreach($undef_functions as $func) {
echo -- Iteration  $counter --\n;
var_dump( is_callable($func, FALSE, $callable_name) );
echo $callable_name, \n;
$counter++;
}
echo done;

?

Expected result:

-- Iteration  1 --
bool(false)
_
-- Iteration  2 --
bool(false)
\0
-- Iteration  3 --
bool(false)
welcome_
-- Iteration  4 --
bool(false)
welcome\0
done

Actual result:
--
-- Iteration  1 --
bool(false)

-- Iteration  2 --
bool(false)
\0
-- Iteration  3 --
bool(false)
welcome
-- Iteration  4 --
bool(false)
welcome\0
done

-- 
Edit bug report at http://bugs.php.net/?id=41546edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=41546r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=41546r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=41546r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41546r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=41546r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=41546r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=41546r=needscript
Try newer version:http://bugs.php.net/fix.php?id=41546r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=41546r=support
Expected behavior:http://bugs.php.net/fix.php?id=41546r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=41546r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=41546r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41546r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41546r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41546r=dst
IIS Stability:http://bugs.php.net/fix.php?id=41546r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=41546r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41546r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=41546r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=41546r=mysqlcfg


#41119 [NEW]: range() function behavior different on PHP6 and PHP5

2007-04-17 Thread mahesh dot vemula at in dot ibm dot com
From: mahesh dot vemula at in dot ibm dot com
Operating system: RHEL 4
PHP version:  6CVS-2007-04-17 (snap)
PHP Bug Type: Feature/Change Request
Bug description:  range() function behavior different on PHP6 and PHP5

Description:

Output of PHP5 and PHP6 differ for range() function. The difference
appears when an empty string() is given as low value and FLOAT as high
value. PHP5 gives the consistent output for an empty string and normal
string, which is an array of float elements.

Whereas PHP6 treats empty and normal strings differently when high value
is a FLOAT. The output of range() with an empty string() as low value is
array of Integer elements and with regular string as low value is array
of float elements.

Environment:
Operating System: RHEL 4
Linux Kernel : Linux 2.6.9
PHP Version: PHP 5.2 (Built on Apr 17, 2007 from snaps.php.net)
PHP Configure Setup: ./configure


Reproduce code:
---
?php
var_dump( range(, 2.2) );
var_dump( range(string, 2.2) );
?


Expected result:

array(3) {
  [0]=
  float(0)
  [1]=
  float(1)
  [2]=
  float(2)
}
array(3) {
  [0]=
  float(0)
  [1]=
  float(1)
  [2]=
  float(2)
}


Actual result:
--
PHP5 gives the output as expected but PHP6 gives the following output:

array(3) {
  [0]=
  int(0)
  [1]=
  int(1)
  [2]=
  int(2)
}
array(3) {
  [0]=
  float(0)
  [1]=
  float(1)
  [2]=
  float(2)
}


-- 
Edit bug report at http://bugs.php.net/?id=41119edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=41119r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=41119r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=41119r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41119r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=41119r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=41119r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=41119r=needscript
Try newer version:http://bugs.php.net/fix.php?id=41119r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=41119r=support
Expected behavior:http://bugs.php.net/fix.php?id=41119r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=41119r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=41119r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41119r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41119r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41119r=dst
IIS Stability:http://bugs.php.net/fix.php?id=41119r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=41119r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41119r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=41119r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=41119r=mysqlcfg


#41118 [NEW]: PHP does not handle overflow of octal integers

2007-04-17 Thread mahesh dot vemula at in dot ibm dot com
From: mahesh dot vemula at in dot ibm dot com
Operating system: RHEL 4
PHP version:  5CVS-2007-04-17 (snap)
PHP Bug Type: Output Control
Bug description:  PHP does not handle overflow of octal integers

Description:

Octal integer values which are beyond MAX_INT or MIN_INT value are not
converted to respective float values as expected, instead they are treated
as decimal values. Please see the example attached.

Environment:
Linux Kernal: Linux 2.6.9
PHP Version: PHP 5.2 (Built on Apr 17, 2007 from snaps.php.net)
PHP Configure Setup: ./configure



Reproduce code:
---
?php
var_dump(0177);
var_dump(0200);
var_dump(0207);
var_dump(-0177);
var_dump(-0200);
var_dump(-0207);
?


Expected result:

int(2147483647)
float(2147483648)
float(2147483655)
int(-2147483647)
int(-2147483648)
float(-2147483655)


Actual result:
--
int(2147483647)
float(2.0E+10)
float(207)
int(-2147483647)
float(-2.0E+10)
float(-207)


-- 
Edit bug report at http://bugs.php.net/?id=41118edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=41118r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=41118r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=41118r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41118r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=41118r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=41118r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=41118r=needscript
Try newer version:http://bugs.php.net/fix.php?id=41118r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=41118r=support
Expected behavior:http://bugs.php.net/fix.php?id=41118r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=41118r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=41118r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41118r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41118r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41118r=dst
IIS Stability:http://bugs.php.net/fix.php?id=41118r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=41118r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41118r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=41118r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=41118r=mysqlcfg


#41121 [NEW]: range() function produces an error for values 2147483646 2147483647 as low

2007-04-17 Thread mahesh dot vemula at in dot ibm dot com
From: mahesh dot vemula at in dot ibm dot com
Operating system: RHEL 4
PHP version:  5CVS-2007-04-17 (snap)
PHP Bug Type: Compile Failure
Bug description:  range() function produces an error for values 2147483646  
2147483647 as low  

Description:

range() function throws a fatal error message when low = 2147483646, high
= 2147483647  step is default (i.e 1). These values gives range of 1 step
and the values are valid integers. 

Environment:
Operating System: RHEL 4
Linux Kernel : Linux 2.6.9
PHP Version: PHP 5.2 (Built on Apr 17, 2007 from snaps.php.net)
PHP Configure Setup: ./configure

I will be attaching a patch for this as soon as possible.


Reproduce code:
---
?php
var_dump( range(2147483646, 2147483647) );
?


Expected result:

array(2) {
  [0]=
  int(2147483646)
  [1]=
  int(2147483647)
}


Actual result:
--
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to
allocate 34 bytes) in %s on line %d

-- 
Edit bug report at http://bugs.php.net/?id=41121edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=41121r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=41121r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=41121r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41121r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=41121r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=41121r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=41121r=needscript
Try newer version:http://bugs.php.net/fix.php?id=41121r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=41121r=support
Expected behavior:http://bugs.php.net/fix.php?id=41121r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=41121r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=41121r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41121r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41121r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41121r=dst
IIS Stability:http://bugs.php.net/fix.php?id=41121r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=41121r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41121r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=41121r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=41121r=mysqlcfg


#41038 [NEW]: Problem with PHP parser in handling MIN_INT value.

2007-04-10 Thread mahesh dot vemula at in dot ibm dot com
From: mahesh dot vemula at in dot ibm dot com
Operating system: RHEL 4
PHP version:  5CVS-2007-04-10 (snap)
PHP Bug Type: *Compile Issues
Bug description:  Problem with PHP parser in handling MIN_INT value.

Description:

The least integer value (i.e -2147483648 ) is  being treated as
float(-2147483648) by the parser. var_dump(-2147483648) returns
float(-2147483648).  A integer value should be treated as float, only if
the value is beyond the boundary of the integer type. 
The php documentation explains the same here :
http://in.php.net/manual/en/function.intval.php   
http://in.php.net/manual/en/language.types.integer.php

Remarks:
The Reproduce code confirms that the parser is not handling the Minimum
Integer value (i.e, -2147483648) as expected. 

Environment:
Operating System: RHEL 4
Linux Kernel : Linux 2.6.9
PHP Version: PHP 5.2 (Built on Apr 10, 2007 from snaps.php.net)
PHP Configure Setup: ./configure


Reproduce code:
---
?php
$i = -2147483648;
var_dump($i); 

$j = (int)-2147483648;
var_dump($j); 
?

Expected result:

int(-2147483648)
int(-2147483648)

Actual result:
--
float(-2147483648)
int(-2147483648)

-- 
Edit bug report at http://bugs.php.net/?id=41038edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=41038r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=41038r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=41038r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41038r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=41038r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=41038r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=41038r=needscript
Try newer version:http://bugs.php.net/fix.php?id=41038r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=41038r=support
Expected behavior:http://bugs.php.net/fix.php?id=41038r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=41038r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=41038r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41038r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41038r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41038r=dst
IIS Stability:http://bugs.php.net/fix.php?id=41038r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=41038r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41038r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=41038r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=41038r=mysqlcfg