From:             scratch65536 at att dot net
Operating system: W2K
PHP version:      4.3.4
PHP Bug Type:     Strings related
Bug description:  strtok seems to return only the first chunk

Description:
------------
The strtok function seems to return a chunk only the first time it's
called [ strtok( string, delim) ] Subsequent calls [ strtok( string ) ] 
appear to return nothing.



I grepped for strtok in the changelist for 4.3.5, but saw nothing so I
presume it's still a problem.



I tested this in 2 environments:



4.3.2 running as a module under Apache 1.3.27 under W2K

4.3.4 running as a module under Apache 2.0 under W2K

Reproduce code:
---------------
<?php

$s = '01:02:03' ;

$h = strtok( $s, ':' ) ;

$m = strtok( $s ) ;

$s = strtok( $s ) ;

echo "h=$h, m=$m, s=$s <br>" ;

?>



yields h=01, m=, s=

Expected result:
----------------
I expected to see h=01, m=02, s=03

Actual result:
--------------
h=01, m=, s=

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

Reply via email to