#36458 [Opn]: function sleep accept negative value

2006-02-21 Thread quick_defect at yahoo dot com
 ID:   36458
 User updated by:  quick_defect at yahoo dot com
 Reported By:  quick_defect at yahoo dot com
 Status:   Open
 Bug Type: Unknown/Other Function
 Operating System: redhat
 PHP Version:  5.1.2
 New Comment:

But I see that the behavior of function usleep reasonable this time:
warning messages are given and exit endless sleep.But why function
sleep remains? PLS fix it.


Previous Comments:


[2006-02-21 09:14:04] quick_defect at yahoo dot com

Nothing diffrent...the same as before



[2006-02-20 08:20:25] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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



[2006-02-20 04:24:46] quick_defect at yahoo dot com

Description:

First,if given negative value, I have to interrupt the execution of
scripts because it sleep for very long time.(I did not exactly know how
long)
Second,if given a int which cause overflow, it also do not work very
well.

Reproduce code:
---
sleep(-1);
$max=mt_getrandmax();
$of=-$max-2;
sleep($of);

Expected result:

exception or turn it to a legal value

Actual result:
--
sleep for a very long time






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


#36458 [Fbk->Opn]: function sleep accept negative value

2006-02-21 Thread quick_defect at yahoo dot com
 ID:   36458
 User updated by:  quick_defect at yahoo dot com
 Reported By:  quick_defect at yahoo dot com
-Status:   Feedback
+Status:   Open
 Bug Type: Unknown/Other Function
 Operating System: redhat
 PHP Version:  5.1.2
 New Comment:

Nothing diffrent...the same as before


Previous Comments:


[2006-02-20 08:20:25] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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



[2006-02-20 04:24:46] quick_defect at yahoo dot com

Description:

First,if given negative value, I have to interrupt the execution of
scripts because it sleep for very long time.(I did not exactly know how
long)
Second,if given a int which cause overflow, it also do not work very
well.

Reproduce code:
---
sleep(-1);
$max=mt_getrandmax();
$of=-$max-2;
sleep($of);

Expected result:

exception or turn it to a legal value

Actual result:
--
sleep for a very long time






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


#36458 [NEW]: function sleep accept negative value

2006-02-19 Thread quick_defect at yahoo dot com
From: quick_defect at yahoo dot com
Operating system: redhat
PHP version:  5.1.2
PHP Bug Type: Unknown/Other Function
Bug description:  function sleep accept negative value

Description:

First,if given negative value, I have to interrupt the execution of
scripts because it sleep for very long time.(I did not exactly know how
long)
Second,if given a int which cause overflow, it also do not work very well.

Reproduce code:
---
sleep(-1);
$max=mt_getrandmax();
$of=-$max-2;
sleep($of);

Expected result:

exception or turn it to a legal value

Actual result:
--
sleep for a very long time


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


#36132 [Bgs]: CachingIterator do not work well

2006-01-23 Thread quick_defect at yahoo dot com
 ID:   36132
 User updated by:  quick_defect at yahoo dot com
 Reported By:  quick_defect at yahoo dot com
 Status:   Bogus
 Bug Type: SPL related
 Operating System: *
 PHP Version:  5.1.2
 Assigned To:  helly
 New Comment:

A tester will never trust a developer's words, we trust manuals and
actual results:) I do that for the better of php. But I will not update
the status of this defect again. Because there are no documents for SPL
functions, it is really difficult to determain a defect. 
helly: From your website,CachingIterator "point" to exactly the next
element of the Iterator being cached. So I still think it mis-behaved
after two times of rewind.


Previous Comments:


[2006-01-23 10:51:02] [EMAIL PROTECTED]

Just trust what the author of the code says.



[2006-01-23 10:30:54] quick_defect at yahoo dot com

So you mean a CachingIterator can take more elements than the Iterator
it cached? I can understand that the CachingIterator just caches
Iterator for 1 element. As you know, there are not any documents for
them. So would you PLS to illustrate this?



[2006-01-23 10:08:50] [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

Don't try to outsmart them and still expect them to work correct. The
code you presented works exactly as you told it to.



[2006-01-23 10:00:59] [EMAIL PROTECTED]

Assigned to the maintainer.



[2006-01-23 09:51:11] quick_defect at yahoo dot com

Description:

I know I did not use the rewind function as usual. But after I did so,
the behavior of Iterator seemed went wrong.

Reproduce code:
---
getIterator();
$c_ite=new CachingIterator($ite);

$ite->rewind();
$c_ite->rewind();
for($axx=$ite;$axx->valid();$axx->next())
{
var_dump($axx->current());
}


echo "***\n";
$c_ite->rewind();
$ite->rewind();
for($axx=$c_ite;$axx->valid();$axx->next())
{
var_dump($axx->current());
}
?>


Expected result:

string(1) "1"
string(1) "2"
***
string(1) "1"
string(1) "2"


Actual result:
--
string(1) "2"
***
string(1) "1"
string(1) "1"
string(1) "2"






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


#36132 [Bgs->Opn]: CachingIterator do not work well

2006-01-23 Thread quick_defect at yahoo dot com
 ID:   36132
 User updated by:  quick_defect at yahoo dot com
 Reported By:  quick_defect at yahoo dot com
-Status:   Bogus
+Status:   Open
 Bug Type: SPL related
 Operating System: *
 PHP Version:  5.1.2
 Assigned To:  helly
 New Comment:

So you mean a CachingIterator can take more elements than the Iterator
it cached? I can understand that the CachingIterator just caches
Iterator for 1 element. As you know, there are not any documents for
them. So would you PLS to illustrate this?


Previous Comments:


[2006-01-23 10:08:50] [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

Don't try to outsmart them and still expect them to work correct. The
code you presented works exactly as you told it to.



[2006-01-23 10:00:59] [EMAIL PROTECTED]

Assigned to the maintainer.



[2006-01-23 09:51:11] quick_defect at yahoo dot com

Description:

I know I did not use the rewind function as usual. But after I did so,
the behavior of Iterator seemed went wrong.

Reproduce code:
---
getIterator();
$c_ite=new CachingIterator($ite);

$ite->rewind();
$c_ite->rewind();
for($axx=$ite;$axx->valid();$axx->next())
{
var_dump($axx->current());
}


echo "***\n";
$c_ite->rewind();
$ite->rewind();
for($axx=$c_ite;$axx->valid();$axx->next())
{
var_dump($axx->current());
}
?>


Expected result:

string(1) "1"
string(1) "2"
***
string(1) "1"
string(1) "2"


Actual result:
--
string(1) "2"
***
string(1) "1"
string(1) "1"
string(1) "2"






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


#36134 [NEW]: no Exception throwed out when pass "" to DirectoryIterator construct

2006-01-23 Thread quick_defect at yahoo dot com
From: quick_defect at yahoo dot com
Operating system: redhat
PHP version:  5.1.2
PHP Bug Type: SPL related
Bug description:  no Exception throwed out when pass "" to DirectoryIterator 
construct

Description:

when I use DirectoryIterator::__construct to get a new DirectoryIterator,
I found it do not throw exception when "" and NULL passed as argument.

Reproduce code:
---
valid());
var_dump($ak->getPathname());
echo "I will never come out\n";
}catch(Exception $e)
{
echo "exception caught with parameter $p\n";
}
}
?>


Expected result:

exception caught with parameter ""
exception caught with parameter Object id #2
exception caught with parameter Array
exception caught with parameter Object id #1
exception caught with parameter 2147483648
exception caught with parameter NULL
exception caught with parameter /no/such/dir


Actual result:
--
bool(false)
bool(false)
I will never come out
exception caught with parameter Object id #2
exception caught with parameter Array
exception caught with parameter Object id #1
exception caught with parameter 2147483648
bool(false)
bool(false)
I will never come out
exception caught with parameter /no/such/dir


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


#36132 [NEW]: CachingIterator do not work well

2006-01-23 Thread quick_defect at yahoo dot com
From: quick_defect at yahoo dot com
Operating system: redhat
PHP version:  5.1.2
PHP Bug Type: SPL related
Bug description:  CachingIterator do not work well 

Description:

I know I did not use the rewind function as usual. But after I did so, the
behavior of Iterator seemed went wrong.

Reproduce code:
---
getIterator();
$c_ite=new CachingIterator($ite);

$ite->rewind();
$c_ite->rewind();
for($axx=$ite;$axx->valid();$axx->next())
{
var_dump($axx->current());
}


echo "***\n";
$c_ite->rewind();
$ite->rewind();
for($axx=$c_ite;$axx->valid();$axx->next())
{
var_dump($axx->current());
}
?>


Expected result:

string(1) "1"
string(1) "2"
***
string(1) "1"
string(1) "2"


Actual result:
--
string(1) "2"
***
string(1) "1"
string(1) "1"
string(1) "2"


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


#36098 [Bgs->Opn]: CachingIterator::__tostring do not work

2006-01-22 Thread quick_defect at yahoo dot com
 ID:   36098
 User updated by:  quick_defect at yahoo dot com
 Reported By:  quick_defect at yahoo dot com
-Status:   Bogus
+Status:   Open
 Bug Type: SPL related
 Operating System: redhat
 PHP Version:  5.1.2
 New Comment:

sniper,I know you are very busy. But PLS read my description carefuly.

First, error message told me that:
'Flags must contain only one of CIT_CALL_TOSTRING,
CIT_TOSTRING_USE_KEY,
CIT_TOSTRING_USE_CURRENT' 
then I use:
new CachingIterator($asx,CIT_TOSTRING_USE_KEY );
this time,the error message told me:
'CachingIterator::__construct() expects parameter 2 to be long, string
given' 

What hell does it mean then? PHP told me use CIT_TOSTRING_USE_KEY as
the second argument, and I did so.Then PHP told me
'CachingIterator::__construct() expects parameter 2 to be long'

Don't you think there is a contrflict in your error message?


Previous Comments:


[2006-01-20 11:31:58] [EMAIL PROTECTED]

Please read the error message. 

----

[2006-01-20 11:05:25] quick_defect at yahoo dot com

Description:

First,I want to know how to use __tostring.But there is not doc. So I
tried with -3: 
and what I get:
Fatal error: Uncaught exception 'InvalidArgumentException' with message
'Flags must contain only one of CIT_CALL_TOSTRING, CIT_TOSTRING_USE_KEY,
CIT_TOSTRING_USE_CURRENT' in CachingIterator::__tostring.php:12
Stack trace:
#0 CachingIterator::__tostring.php(12):
CachingIterator->__construct(Object(ArrayIterator), -3)
#1 {main}
  thrown in CachingIterator::__tostring.php on line 12

So I know I should use CIT_CALL_TOSTRING, CIT_TOSTRING_USE_KEY or
CIT_TOSTRING_USE_CURRENT.
then I tried:
$ak=(new CachingIterator($asx,CIT_TOSTRING_USE_KEY ));

But I again got an exception which prompted that the argument was still
invalid.


Reproduce code:
---
1,"two"=>2,"three"=>3,"four"=>4,"five"=>5,"six"=>6);
$kfc=array("trap");

$jsp=(new ArrayObject($asp));
$mcd=(new ArrayObject($kfc));

$asx=$jsp->getIterator();
$coca=$mcd->getIterator();

$ak=(new CachingIterator($asx,CIT_TOSTRING_USE_KEY ));
?>




Expected result:

no exception throwed out

Actual result:
--
Fatal error: Uncaught exception 'InvalidArgumentException' with message
'CachingIterator::__construct() expects parameter 2 to be long, string
given' in CachingIterator::__tostring.php:12
Stack trace:
#0 CachingIterator::__tostring.php(12):
CachingIterator->__construct(Object(ArrayIterator),
'CIT_TOSTRING_US...')
#1 {main}
  thrown in CachingIterator::__tostring.php on line 12





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


#36098 [NEW]: CachingIterator::__tostring do not work

2006-01-20 Thread quick_defect at yahoo dot com
From: quick_defect at yahoo dot com
Operating system: redhat
PHP version:  5.1.2
PHP Bug Type: SPL related
Bug description:  CachingIterator::__tostring do not work

Description:

First,I want to know how to use __tostring.But there is not doc. So I
tried with -3: 
and what I get:
Fatal error: Uncaught exception 'InvalidArgumentException' with message
'Flags must contain only one of CIT_CALL_TOSTRING, CIT_TOSTRING_USE_KEY,
CIT_TOSTRING_USE_CURRENT' in CachingIterator::__tostring.php:12
Stack trace:
#0 CachingIterator::__tostring.php(12):
CachingIterator->__construct(Object(ArrayIterator), -3)
#1 {main}
  thrown in CachingIterator::__tostring.php on line 12

So I know I should use CIT_CALL_TOSTRING, CIT_TOSTRING_USE_KEY or
CIT_TOSTRING_USE_CURRENT.
then I tried:
$ak=(new CachingIterator($asx,CIT_TOSTRING_USE_KEY ));

But I again got an exception which prompted that the argument was still
invalid.


Reproduce code:
---
1,"two"=>2,"three"=>3,"four"=>4,"five"=>5,"six"=>6);
$kfc=array("trap");

$jsp=(new ArrayObject($asp));
$mcd=(new ArrayObject($kfc));

$asx=$jsp->getIterator();
$coca=$mcd->getIterator();

$ak=(new CachingIterator($asx,CIT_TOSTRING_USE_KEY ));
?>




Expected result:

no exception throwed out

Actual result:
--
Fatal error: Uncaught exception 'InvalidArgumentException' with message
'CachingIterator::__construct() expects parameter 2 to be long, string
given' in CachingIterator::__tostring.php:12
Stack trace:
#0 CachingIterator::__tostring.php(12):
CachingIterator->__construct(Object(ArrayIterator), 'CIT_TOSTRING_US...')
#1 {main}
  thrown in CachingIterator::__tostring.php on line 12

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