#34183 [NEW]: feof() doesn't work within a class

2005-08-18 Thread osmium at 163 dot com
From: osmium at 163 dot com
Operating system: Windows 2003, Windows 2000
PHP version:  5.1.0b3
PHP Bug Type: Filesystem function related
Bug description:  feof() doesn't work within a class

Description:

When using fseek() to specify an offset larger than or equal to the file
size, function feof() could not identify the EOF flag either in a class
method or a function, it always return FALSE. But it works outside
functions and classes.

There are same problems in version 4.3.11, 4.4.0 and 5.0.4

Reproduce code:
---
?php
class FileHandler
{
var $handle = null;
function eof($file, $pos) {
$this-handle = fopen($file, r);
fseek($this-handle, $pos);
echo Is EOF: , (feof($this-handle)) ? YES : NO;
}

function eof2($file, $pos) {
$handle = fopen($file, r);
fseek($handle, $pos);
echo Is EOF: , (feof($handle)) ? YES : NO;
}
}

function eof3($file, $pos) {
$handle = fopen($file, r);
fseek($handle, $pos);
echo Is EOF: , (feof($handle)) ? YES : NO;
}
// my file has 32 chars only
$handler = new FileHandler();
$handler-eof($file, 320);
$handler-eof2($file, 320);
eof2($file, 320);
?

Expected result:

Is EOF: YES
Is EOF: YES
Is EOF: YES

Actual result:
--
Is EOF: NO
Is EOF: NO
Is EOF: NO

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


#34183 [Opn]: feof() doesn't work within a class

2005-08-18 Thread osmium at 163 dot com
 ID:   34183
 User updated by:  osmium at 163 dot com
 Reported By:  osmium at 163 dot com
 Status:   Open
 Bug Type: Filesystem function related
 Operating System: Windows 2003, Windows 2000
 PHP Version:  5.1.0b3
 New Comment:

thers is something wrong about my English


Previous Comments:


[2005-08-18 10:48:21] osmium at 163 dot com

Description:

When using fseek() to specify an offset larger than or equal to the
file size, function feof() could not identify the EOF flag either in a
class method or a function, it always return FALSE. But it works
outside functions and classes.

There are same problems in version 4.3.11, 4.4.0 and 5.0.4

Reproduce code:
---
?php
class FileHandler
{
var $handle = null;
function eof($file, $pos) {
$this-handle = fopen($file, r);
fseek($this-handle, $pos);
echo Is EOF: , (feof($this-handle)) ? YES : NO;
}

function eof2($file, $pos) {
$handle = fopen($file, r);
fseek($handle, $pos);
echo Is EOF: , (feof($handle)) ? YES : NO;
}
}

function eof3($file, $pos) {
$handle = fopen($file, r);
fseek($handle, $pos);
echo Is EOF: , (feof($handle)) ? YES : NO;
}
// my file has 32 chars only
$handler = new FileHandler();
$handler-eof($file, 320);
$handler-eof2($file, 320);
eof2($file, 320);
?

Expected result:

Is EOF: YES
Is EOF: YES
Is EOF: YES

Actual result:
--
Is EOF: NO
Is EOF: NO
Is EOF: NO





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


#34183 [Opn]: feof() doesn't work within a class

2005-08-18 Thread osmium at 163 dot com
 ID:   34183
 User updated by:  osmium at 163 dot com
 Reported By:  osmium at 163 dot com
 Status:   Open
 Bug Type: Filesystem function related
 Operating System: Windows 2003, Windows 2000
 PHP Version:  5.1.0b3
 New Comment:

I am sorry but is there somewhere I can modify those I have submitted?


Previous Comments:


[2005-08-18 10:51:11] osmium at 163 dot com

thers is something wrong about my English



[2005-08-18 10:48:21] osmium at 163 dot com

Description:

When using fseek() to specify an offset larger than or equal to the
file size, function feof() could not identify the EOF flag either in a
class method or a function, it always return FALSE. But it works
outside functions and classes.

There are same problems in version 4.3.11, 4.4.0 and 5.0.4

Reproduce code:
---
?php
class FileHandler
{
var $handle = null;
function eof($file, $pos) {
$this-handle = fopen($file, r);
fseek($this-handle, $pos);
echo Is EOF: , (feof($this-handle)) ? YES : NO;
}

function eof2($file, $pos) {
$handle = fopen($file, r);
fseek($handle, $pos);
echo Is EOF: , (feof($handle)) ? YES : NO;
}
}

function eof3($file, $pos) {
$handle = fopen($file, r);
fseek($handle, $pos);
echo Is EOF: , (feof($handle)) ? YES : NO;
}
// my file has 32 chars only
$handler = new FileHandler();
$handler-eof($file, 320);
$handler-eof2($file, 320);
eof2($file, 320);
?

Expected result:

Is EOF: YES
Is EOF: YES
Is EOF: YES

Actual result:
--
Is EOF: NO
Is EOF: NO
Is EOF: NO





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


#34087 [Asn]: strtotime() does not work with date format Y/m/d

2005-08-12 Thread osmium at 163 dot com
 ID:   34087
 User updated by:  osmium at 163 dot com
 Reported By:  osmium at 163 dot com
 Status:   Assigned
-Bug Type: Feature/Change Request
+Bug Type: Date/time related
 Operating System: Windows Server 2003
 PHP Version:  5.1.0b3
 Assigned To:  derick
 New Comment:

I'm so sorry for ignoring that. You know, Y/m/d works in v4.3 and
v5.0, so I took it for granted.

And I thought Y/m/d is still widely used in this world.


Previous Comments:


[2005-08-12 08:48:59] [EMAIL PROTECTED]

It's very easy to add though.



[2005-08-12 05:03:49] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The manual states that strtotime() parses a date/time string according
to the GNU Date Input Formats syntax. The format Y/m/d is not a
supported GNU date input format (see the link below).

http://www.php.net/strtotime
http://www.gnu.org/software/tar/manual/html_chapter/tar_7.html



[2005-08-12 03:08:37] osmium at 163 dot com

Description:

I got nothing on the first line but a number 1123804800 on the second
line. Maybe format Y/m/d is not supported by strtotime().

However, I got two numbers in v5.0.3

Reproduce code:
---
?php
echo Y/m/d: , strtotime(2005/8/12), br;
echo Y-m-d: , strtotime(2005-8-12);
?

Expected result:

Y/m/d: 1123804800
Y-m-d: 1123804800

Actual result:
--
Y/m/d: 
Y-m-d: 1123804800





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


#34087 [NEW]: strtotime() does not work with date format Y/m/d

2005-08-11 Thread osmium at 163 dot com
From: osmium at 163 dot com
Operating system: Windows Server 2003
PHP version:  5.1.0b3
PHP Bug Type: Date/time related
Bug description:  strtotime() does not work with date format Y/m/d

Description:

I got nothing on the first line but a number 1123804800 on the second
line. Maybe format Y/m/d is not supported by strtotime().

However, I got two numbers in v5.0.3

Reproduce code:
---
?php
echo Y/m/d: , strtotime(2005/8/12), br;
echo Y-m-d: , strtotime(2005-8-12);
?

Expected result:

Y/m/d: 1123804800
Y-m-d: 1123804800

Actual result:
--
Y/m/d: 
Y-m-d: 1123804800

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