#50244 [NEW]: getopt() does not reset
From: craig dot marvelley at boxuk dot com Operating system: Windows XP PHP version: 5.3.1 PHP Bug Type: Feature/Change Request Bug description: getopt() does not reset Description: A bug that has been reported and fixed in the past regarding getopt not resetting after being called once has resurfaced. Here's the original bug: http://bonsai.php.net/bug.php?id=29714 The same behaviour is happening in 5.3.1 - once getopt has been called, subsequent calls ignore options not included in the original call. Reproduce code: --- php test.php -d hello -b world ?php $options = getopt(d:); print_r($options); $options = getopt(b:); print_r($options); Expected result: Array ( [d] = hello ) Array ( [b] = world ) Actual result: -- Array ( [d] = hello ) Array ( ) -- Edit bug report at http://bugs.php.net/?id=50244edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50244r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50244r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50244r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=50244r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50244r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=50244r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=50244r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=50244r=needscript Try newer version: http://bugs.php.net/fix.php?id=50244r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=50244r=support Expected behavior: http://bugs.php.net/fix.php?id=50244r=notwrong Not enough info: http://bugs.php.net/fix.php?id=50244r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=50244r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=50244r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50244r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=50244r=dst IIS Stability: http://bugs.php.net/fix.php?id=50244r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=50244r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=50244r=float No Zend Extensions: http://bugs.php.net/fix.php?id=50244r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=50244r=mysqlcfg
#48788 [NEW]: RecursiveDirectoryIterator doesn't descend into symlinked directories
From: craig dot marvelley at boxuk dot com Operating system: Linux (Debian) PHP version: 5.3.0 PHP Bug Type: SPL related Bug description: RecursiveDirectoryIterator doesn't descend into symlinked directories Description: In a Windows environment, RecursiveDirectoryIterator will treat symlinked directories as valid directories, descending into them accordingly. However on Linux this isn't the case, with a symlink being treated as a file (leaf). Reproduce code: --- ?php // create a 'proper' directory with a file mkdir('new_dir'); file_put_contents('new_dir/test.txt', 'test'); // create a symlink to our directory symlink('new_dir', 'symlink_dir'); $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__)); foreach($iterator as $object) { echo $object-getFilename() . \n; } Expected result: On Windows Vista, I get this (executed in file test.php): test.txt test.txt test.php Which I would expect; the symlinked directory is treated as a regular directory, so the test file appears twice. Actual result: -- On Linux (same scenario): test.php symlink_dir test.txt . .. . .. The symlinked directory appears, but as a leaf; the contents of the directory are not discovered. -- Edit bug report at http://bugs.php.net/?id=48788edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48788r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48788r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48788r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=48788r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48788r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=48788r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=48788r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=48788r=needscript Try newer version: http://bugs.php.net/fix.php?id=48788r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=48788r=support Expected behavior: http://bugs.php.net/fix.php?id=48788r=notwrong Not enough info: http://bugs.php.net/fix.php?id=48788r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=48788r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=48788r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48788r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=48788r=dst IIS Stability: http://bugs.php.net/fix.php?id=48788r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=48788r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=48788r=float No Zend Extensions: http://bugs.php.net/fix.php?id=48788r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=48788r=mysqlcfg
#48493 [NEW]: spl_autoload_unregister() removes all autoloaded methods when prepending
From: craig dot marvelley at boxuk dot com Operating system: Windows XP PHP version: 5.3.0RC2 PHP Bug Type: SPL related Bug description: spl_autoload_unregister() removes all autoloaded methods when prepending Description: The spl_autoload_register function was recently modified (I don't think it's documented, though) to allow the pre-pending of functions to the stack (see bug #42823). I'm using pre-pending and am later trying to remove a registered function from the end of the stack. This removes ALL methods, not just the method I'd intended. Reproduce code: --- function autoload1() {} function autoload2() {} spl_autoload_register('autoload2'); // register autoload1 at the bottom of the stack spl_autoload_register('autoload1', true, true); // Output: Array ( [0] = autoload1 [1] = autoload2 ) print_r(spl_autoload_functions()); // unregister autoload2 - autoload1 _should_ be left behind spl_autoload_unregister('autoload2'); Expected result: When running spl_autoload_functions(), I'd expect a single entry to be left: array([0] = 'autoload1'); Actual result: -- The array is empty: array(); -- Edit bug report at http://bugs.php.net/?id=48493edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48493r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48493r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48493r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=48493r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48493r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=48493r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=48493r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=48493r=needscript Try newer version: http://bugs.php.net/fix.php?id=48493r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=48493r=support Expected behavior: http://bugs.php.net/fix.php?id=48493r=notwrong Not enough info: http://bugs.php.net/fix.php?id=48493r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=48493r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=48493r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48493r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=48493r=dst IIS Stability: http://bugs.php.net/fix.php?id=48493r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=48493r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=48493r=float No Zend Extensions: http://bugs.php.net/fix.php?id=48493r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=48493r=mysqlcfg
#47438 [NEW]: mysql_fetch_field ignores zero offset
From: craig dot marvelley at boxuk dot com Operating system: Windows/Linux PHP version: 5.3.0beta1 PHP Bug Type: MySQL related Bug description: mysql_fetch_field ignores zero offset Description: When calling mysql_fetch_field(), it seems that in PHP 5.3 the offset parameter, when set to 0, is being ignored - the current pointer offset is returned instead. According to the manual, that should only happen if the field offset is not supplied. I've tested this in PHP 4 and 5.2 but the above behaviour isn't repeated. Reproduce code: --- // connect to database, etc... $sql = SELECT * FROM someTable; $result = mysql_query($sql); // set the internal pointer to the second field... mysql_field_seek($result, 1); // ... but we'll start at the first field (i.e. ignore the pointer) $i = 0; while($imysql_num_fields($result)) { $meta=mysql_fetch_field($result,$i); echo $i . . . $meta-name . br /; $i++; } Expected result: For a table with columns like this: column1 | column2 | column3 I'd expect to see 0. column1 1. column2 2. column3 (This happens in PHP 5.3beta1) Actual result: -- I get this: 0. column2 1. column2 2. column3 -- Edit bug report at http://bugs.php.net/?id=47438edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47438r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47438r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47438r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=47438r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47438r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=47438r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=47438r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=47438r=needscript Try newer version: http://bugs.php.net/fix.php?id=47438r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=47438r=support Expected behavior: http://bugs.php.net/fix.php?id=47438r=notwrong Not enough info: http://bugs.php.net/fix.php?id=47438r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=47438r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=47438r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47438r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=47438r=dst IIS Stability: http://bugs.php.net/fix.php?id=47438r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=47438r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=47438r=float No Zend Extensions: http://bugs.php.net/fix.php?id=47438r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=47438r=mysqlcfg