Req #51254 [Com]: Use internal crypt() only for algorithms needed
Edit report at http://bugs.php.net/bug.php?id=51254edit=1 ID: 51254 Comment by: ondrej at sury dot org Reported by:ondrej at sury dot org Summary:Use internal crypt() only for algorithms needed Status: Open Type: Feature/Change Request Package:*Encryption and hash functions Operating System: Linux PHP Version:5.3.2 Block user comment: N Private report: N New Comment: Hi, the issue is little bit more complicated than adding defined() around the statements. When compiling with --enable-maintainer-zts some header files are included in a way that crypt_r and struct crypt_data is unknown and the compilation fail. Unless you are willing to dig deeper, you can just drop the patch for your custom build. Previous Comments: [2011-03-28 15:12:41] php at rapsys dot eu I had a poblem with this patch in debian/ubuntu packages. With this patch the build with --enable-maintainer-zts the ubuntu php5_5.3.2-1ubuntu4.7 package. The problem seems to comes from #if used instead of #ifdef and incorrectly defined strings by your patch. Here is the build log : /home/user/php/php5-5.3.2/ext/standard/crypt.c:150:27: error: #if with no expression /home/user/php/php5-5.3.2/ext/standard/crypt.c:190:27: error: #if with no expression /home/user/php/php5-5.3.2/ext/standard/crypt.c:201:3: warning: #warning Using system MD5 crypt function, which is OK on Debian system /home/user/php/php5-5.3.2/ext/standard/crypt.c:202:28: error: #if with no expression /home/user/php/php5-5.3.2/ext/standard/crypt.c:214:3: warning: #warning Using system SHA512 crypt function, which is OK on Debian system /home/user/php/php5-5.3.2/ext/standard/crypt.c:215:28: error: #if with no expression /home/user/php/php5-5.3.2/ext/standard/crypt.c:227:3: warning: #warning Using system SHA256 crypt function, which is OK on Debian system /home/user/php/php5-5.3.2/ext/standard/crypt.c:228:28: error: #if with no expression /home/user/php/php5-5.3.2/ext/standard/crypt.c:258:3: warning: #warning Using PHP BlowFish crypt function, which is OK on Debian system /home/user/php/php5-5.3.2/ext/standard/crypt.c:272:3: warning: #warning Using PHP extended DES crypt function, which is OK on Debian system /home/user/php/php5-5.3.2/ext/standard/crypt.c:279:3: warning: #warning Using system standard DES crypt function, which is OK on Debian system /home/user/php/php5-5.3.2/ext/standard/crypt.c:280:28: error: #if with no expression make[1]: *** [ext/standard/crypt.lo] Error 1 make[1]: Leaving directory `/home/user/php/php5-5.3.2/apache2-build' make: *** [build-apache2-stamp] Error 2 dpkg-buildpackage: error: debian/rules build gave error exit status 2 debuild: fatal error at line 1340: dpkg-buildpackage -rfakeroot -D -us -uc failed [2010-03-24 17:02:06] ondrej at sury dot org Hi Pierre, had a time to review this patch and provide a detailed explanation? Ondrej [2010-03-12 11:24:42] paj...@php.net Not sure I agree with these changes, they are not supposed to be valid. I don't have the time now to reply with a detailed explanation but we will do it asap. [2010-03-12 10:15:46] ondrej at sury dot org Hi, if you apply my patch, you'll need to apply the fix_crypt_unit_tests.patch, since I have fixed some routines, which you checked in those unit tests. 1. if you use '_' as a first character of the salt, but the salt is not 9 characters long = STD_DES is used. 2. if you use 00-03 or 32-39 as count in blowfish = STD_DES is used (as documented). [2010-03-10 08:09:46] ondrej at sury dot org Description: Attached patch changes crypt.c and accompanying m4 code so it selects only algorithms not supported by system library crypt() for candidates to use internal implementation of crypt(). It also unifies the code to one style (BF and MD5 used static output buffer, sha256,512 allocated the buffer dynamically, etc.), so it's easier to read and understand, which is needed due all #if statements there. Next it fixes some glitches in m4 code. Expected result: Use internal implementation only for missing or buggy support for algorithm in system library crypt() function. Actual result: -- Internal implementation of crypt() is always selected and used(), when BF or EXT_DES is missing. (Note that due misplaced check for HAVE_CRYPT_R, it will be used even if BF and EXT_DES is present in the system.) -- Edit this bug
[PHP-BUG] Req #54355 [NEW]: Test for de_DE doesn't use UTF-8 locales
From: Operating system: Any PHP version: 5.3.6 Package: Gettext related Bug Type: Feature/Change Request Bug description:Test for de_DE doesn't use UTF-8 locales Description: The tests in tests/lang/bug30638.phpt and tests/lang/034.phpt use only ISO-8859-1 which is rarely supported on current distributions. I have also normalized both tests to use same set of locale names. Test script: --- ?php if (setlocale(LC_NUMERIC, de_DE, de, german, ge, de_DE.ISO8859-1) === FALSE) { print skip; } ? Expected result: // no output Actual result: -- skip -- Edit bug report at http://bugs.php.net/bug.php?id=54355edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54355r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54355r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54355r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=54355r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54355r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=54355r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=54355r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=54355r=needscript Try newer version: http://bugs.php.net/fix.php?id=54355r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=54355r=support Expected behavior: http://bugs.php.net/fix.php?id=54355r=notwrong Not enough info: http://bugs.php.net/fix.php?id=54355r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=54355r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=54355r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54355r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=54355r=dst IIS Stability: http://bugs.php.net/fix.php?id=54355r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=54355r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=54355r=float No Zend Extensions: http://bugs.php.net/fix.php?id=54355r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=54355r=mysqlcfg
Req #51254 [Opn]: Use internal crypt() only for algorithms needed
Edit report at http://bugs.php.net/bug.php?id=51254edit=1 ID: 51254 User updated by: ondrej at sury dot org Reported by: ondrej at sury dot org Summary: Use internal crypt() only for algorithms needed Status: Open Type: Feature/Change Request Package: *Encryption and hash functions Operating System: Linux PHP Version: 5.3.2 New Comment: Hi Pierre, had a time to review this patch and provide a detailed explanation? Ondrej Previous Comments: [2010-03-12 11:24:42] paj...@php.net Not sure I agree with these changes, they are not supposed to be valid. I don't have the time now to reply with a detailed explanation but we will do it asap. [2010-03-12 10:15:46] ondrej at sury dot org Hi, if you apply my patch, you'll need to apply the fix_crypt_unit_tests.patch, since I have fixed some routines, which you checked in those unit tests. 1. if you use '_' as a first character of the salt, but the salt is not 9 characters long = STD_DES is used. 2. if you use 00-03 or 32-39 as count in blowfish = STD_DES is used (as documented). [2010-03-10 08:09:46] ondrej at sury dot org Description: Attached patch changes crypt.c and accompanying m4 code so it selects only algorithms not supported by system library crypt() for candidates to use internal implementation of crypt(). It also unifies the code to one style (BF and MD5 used static output buffer, sha256,512 allocated the buffer dynamically, etc.), so it's easier to read and understand, which is needed due all #if statements there. Next it fixes some glitches in m4 code. Expected result: Use internal implementation only for missing or buggy support for algorithm in system library crypt() function. Actual result: -- Internal implementation of crypt() is always selected and used(), when BF or EXT_DES is missing. (Note that due misplaced check for HAVE_CRYPT_R, it will be used even if BF and EXT_DES is present in the system.) -- Edit this bug report at http://bugs.php.net/bug.php?id=51254edit=1
Req #51254 [Opn]: Use internal crypt() only for algorithms needed
Edit report at http://bugs.php.net/bug.php?id=51254edit=1 ID: 51254 User updated by: ondrej at sury dot org Reported by: ondrej at sury dot org Summary: Use internal crypt() only for algorithms needed Status: Open Type: Feature/Change Request Package: *Encryption and hash functions Operating System: Linux PHP Version: 5.3.2 New Comment: Hi, if you apply my patch, you'll need to apply the fix_crypt_unit_tests.patch, since I have fixed some routines, which you checked in those unit tests. 1. if you use '_' as a first character of the salt, but the salt is not 9 characters long = STD_DES is used. 2. if you use 00-03 or 32-39 as count in blowfish = STD_DES is used (as documented). Previous Comments: [2010-03-10 08:09:46] ondrej at sury dot org Description: Attached patch changes crypt.c and accompanying m4 code so it selects only algorithms not supported by system library crypt() for candidates to use internal implementation of crypt(). It also unifies the code to one style (BF and MD5 used static output buffer, sha256,512 allocated the buffer dynamically, etc.), so it's easier to read and understand, which is needed due all #if statements there. Next it fixes some glitches in m4 code. Expected result: Use internal implementation only for missing or buggy support for algorithm in system library crypt() function. Actual result: -- Internal implementation of crypt() is always selected and used(), when BF or EXT_DES is missing. (Note that due misplaced check for HAVE_CRYPT_R, it will be used even if BF and EXT_DES is present in the system.) -- Edit this bug report at http://bugs.php.net/bug.php?id=51254edit=1
[PHP-BUG] Bug #51254 [NEW]: Use internal crypt() only for algorithms needed
From: Operating system: Linux PHP version: 5.3.2 Package: *Encryption and hash functions Bug Type: Bug Bug description:Use internal crypt() only for algorithms needed Description: Attached patch changes crypt.c and accompanying m4 code so it selects only algorithms not supported by system library crypt() for candidates to use internal implementation of crypt(). It also unifies the code to one style (BF and MD5 used static output buffer, sha256,512 allocated the buffer dynamically, etc.), so it's easier to read and understand, which is needed due all #if statements there. Next it fixes some glitches in m4 code. Expected result: Use internal implementation only for missing or buggy support for algorithm in system library crypt() function. Actual result: -- Internal implementation of crypt() is always selected and used(), when BF or EXT_DES is missing. (Note that due misplaced check for HAVE_CRYPT_R, it will be used even if BF and EXT_DES is present in the system.) -- Edit bug report at http://bugs.php.net/bug.php?id=51254edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51254r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51254r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51254r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=51254r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51254r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=51254r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=51254r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=51254r=needscript Try newer version: http://bugs.php.net/fix.php?id=51254r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=51254r=support Expected behavior: http://bugs.php.net/fix.php?id=51254r=notwrong Not enough info: http://bugs.php.net/fix.php?id=51254r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=51254r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=51254r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51254r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=51254r=dst IIS Stability: http://bugs.php.net/fix.php?id=51254r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=51254r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=51254r=float No Zend Extensions: http://bugs.php.net/fix.php?id=51254r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=51254r=mysqlcfg
#34120 [Asn]: func_get_arg() can be used function call parameter if used only once
ID: 34120 User updated by: ondrej at sury dot org Reported By: ondrej at sury dot org Status: Assigned Bug Type: Scripting Engine problem Operating System: * PHP Version: 5CVS, 4CVS (2005-08-013) Assigned To: dmitry New Comment: I disagree, this function should fail even when used as first argument (also according to docs). If you allow it to be passed as first argument, but not as second or third, etc., you create only chaos. It's much more cleaner to let it fail everytime. Previous Comments: [2005-09-01 15:55:34] [EMAIL PROTECTED] Right. I think this shouldn't be fixed. [2005-08-25 21:54:45] csaba at alum dot mit dot edu Note: Because this function depends on the current scope to determine parameter details, it may only appear in the first argument to a function. Thus myfunc1 (myfunc2 (func_get_arg(1), 7)) OK myfunc1 (myfunc2 (7, func_get_arg(0))) Error myfunc1 (7+func_get_arg(0)+func_get_arg(1))OK myfunc2 (func_get_arg(0), func_get_arg(1)) Error If you must pass this value of func_get_arg() not in the first argument, assign the results to a variable, and pass the variable. Csaba Gabor from Vienna [2005-08-15 23:08:45] [EMAIL PROTECTED] Dmitry, this script should fail for all of those: ?php function doTitle($a = NULL, $b = NULL) { print doTitle: $a, $b\n; } function doHead() { doTitle(func_num_args()); doTitle(func_get_arg(0)); doTitle(func_get_args()); } doHead(1, 2); [2005-08-13 20:23:35] [EMAIL PROTECTED] Manual says: Note: Because this function depends on the current scope to determine parameter details, it cannot be used as a function parameter. If you must pass this value, assign the results to a variable, and pass the variable. [2005-08-13 14:38:51] [EMAIL PROTECTED] Well, that's true then. But I'm not sure how important this bug is :) The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/34120 -- Edit this bug report at http://bugs.php.net/?id=34120edit=1
#34116 [NEW]: support for variable length printf strings
From: ondrej at sury dot org Operating system: PHP version: 4CVS-2005-08-13 (stable) PHP Bug Type: Feature/Change Request Bug description: support for variable length printf strings Description: PHP's printf does not support variable width/precision. Compare that with printf '%*s' 10 'foobar' in a shell script. Reproduce code: --- ?php $length = 10; printf(%*s, $length, foobar); ? Expected result: foobar Actual result: -- s -- Edit bug report at http://bugs.php.net/?id=34116edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34116r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34116r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34116r=trysnapshot51 Fixed in CVS:http://bugs.php.net/fix.php?id=34116r=fixedcvs Fixed in release:http://bugs.php.net/fix.php?id=34116r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34116r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34116r=needscript Try newer version: http://bugs.php.net/fix.php?id=34116r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34116r=support Expected behavior: http://bugs.php.net/fix.php?id=34116r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34116r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34116r=submittedtwice register_globals:http://bugs.php.net/fix.php?id=34116r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34116r=php3 Daylight Savings:http://bugs.php.net/fix.php?id=34116r=dst IIS Stability: http://bugs.php.net/fix.php?id=34116r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34116r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34116r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34116r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34116r=mysqlcfg
#33287 [Com]: foreach does not give errors
ID: 33287 Comment by: ondrej at sury dot org Reported By: chris at deskpro dot com Status: No Feedback Bug Type: Arrays related Operating System: Win/MacOS linux untested PHP Version: 4.3.11 New Comment: Bug is fixed in php 4.4.0. Previous Comments: [2005-06-18 01:00:04] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to Open. [2005-06-10 11:28:49] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip [2005-06-09 22:11:40] chris at deskpro dot com Description: This is a repost of 33264 33264 was closed because it was said the bug is the same as 31114. They are however completly different. 31114 is about foreach where the $key and $value are the same: foreach ($array AS $key = $key) which should, perhaps issue a warning. However, 33264 is about foreach not issuing an error when you try and loop on an unset variable or a string e.g.: $array = ''; foreach ($array AS $value) { this should, and used to issue an error (I think it was fatal). It not longer does. The manual even suggests this error is not preventable with a @, but not it dosen't appear at all. So this is both a real bug and important. Reproduce code: --- ?php error_reporting(E_ALL); foreach ($a AS $b) { } ? Expected result: Error about $a not being an array. Actual result: -- No error. -- Edit this bug report at http://bugs.php.net/?id=33287edit=1
#34119 [NEW]: mb_ereg chokes on \x80-\xF7
From: ondrej at sury dot org Operating system: Linux PHP version: 4.4.0 PHP Bug Type: mbstring related Bug description: mb_ereg chokes on \x80-\xF7 Description: mb_ereg prints invalid regular expression error on certain characters. This is fixed in php 5.0.4. More information could be found at: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=278044 Reproduce code: --- $name = user/1/viewuser/1/edit; if (mb_ereg([^\x80-\xF7 [:alnum:[EMAIL PROTECTED], $name)) print('The username contains an illegal character.'); Expected result: The username contains an illegal character. Actual result: -- Warning: mb_ereg(): mbregex compile err: invalid regular expression in /var/www/mb_ereg.php on line 4 -- Edit bug report at http://bugs.php.net/?id=34119edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34119r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34119r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34119r=trysnapshot51 Fixed in CVS:http://bugs.php.net/fix.php?id=34119r=fixedcvs Fixed in release:http://bugs.php.net/fix.php?id=34119r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34119r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34119r=needscript Try newer version: http://bugs.php.net/fix.php?id=34119r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34119r=support Expected behavior: http://bugs.php.net/fix.php?id=34119r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34119r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34119r=submittedtwice register_globals:http://bugs.php.net/fix.php?id=34119r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34119r=php3 Daylight Savings:http://bugs.php.net/fix.php?id=34119r=dst IIS Stability: http://bugs.php.net/fix.php?id=34119r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34119r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34119r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34119r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34119r=mysqlcfg
#34120 [NEW]: func_get_arg() can not be used more than once in function calls
From: ondrej at sury dot org Operating system: Linux PHP version: 4.4.0 PHP Bug Type: Scripting Engine problem Bug description: func_get_arg() can not be used more than once in function calls Description: func_get_arg() can be used as argument to function only once. Reproduce code: --- ?php function doTitle($a = NULL, $b = NULL) { print doTitle: $a, $b\n; } function doHead() { doTitle(func_get_arg(0)); doTitle(func_get_arg(1)); doTitle(func_get_arg(0), 3); doTitle(func_get_arg(0), func_get_arg(1)); } doHead(1, 2); ? Expected result: doTitle: 1, doTitle: 2, doTitle: 1, 3 doTitle: 1, 2 Actual result: -- doTitle: 1, doTitle: 2, doTitle: 1, 3 Fatal error: func_get_arg(): Can't be used as a function parameter in /tmp/func_get_arg.php on line 11 -- Edit bug report at http://bugs.php.net/?id=34120edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34120r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34120r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34120r=trysnapshot51 Fixed in CVS:http://bugs.php.net/fix.php?id=34120r=fixedcvs Fixed in release:http://bugs.php.net/fix.php?id=34120r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34120r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34120r=needscript Try newer version: http://bugs.php.net/fix.php?id=34120r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34120r=support Expected behavior: http://bugs.php.net/fix.php?id=34120r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34120r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34120r=submittedtwice register_globals:http://bugs.php.net/fix.php?id=34120r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34120r=php3 Daylight Savings:http://bugs.php.net/fix.php?id=34120r=dst IIS Stability: http://bugs.php.net/fix.php?id=34120r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34120r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34120r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34120r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34120r=mysqlcfg
#34120 [Opn]: func_get_arg() can not be used more than once in function calls
ID: 34120 User updated by: ondrej at sury dot org Reported By: ondrej at sury dot org Status: Open Bug Type: Scripting Engine problem Operating System: Linux -PHP Version: 4.4.0 +PHP Version: 4.4.0, 5.0.4 New Comment: Happens in php 5.0.4 as well Previous Comments: [2005-08-13 13:58:46] ondrej at sury dot org Description: func_get_arg() can be used as argument to function only once. Reproduce code: --- ?php function doTitle($a = NULL, $b = NULL) { print doTitle: $a, $b\n; } function doHead() { doTitle(func_get_arg(0)); doTitle(func_get_arg(1)); doTitle(func_get_arg(0), 3); doTitle(func_get_arg(0), func_get_arg(1)); } doHead(1, 2); ? Expected result: doTitle: 1, doTitle: 2, doTitle: 1, 3 doTitle: 1, 2 Actual result: -- doTitle: 1, doTitle: 2, doTitle: 1, 3 Fatal error: func_get_arg(): Can't be used as a function parameter in /tmp/func_get_arg.php on line 11 -- Edit this bug report at http://bugs.php.net/?id=34120edit=1
#34120 [Bgs]: func_get_arg() can not be used more than once in function calls
ID: 34120 User updated by: ondrej at sury dot org Reported By: ondrej at sury dot org Status: Bogus Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 4.4.0, 5.0.4 New Comment: Hi Derrick, I don't consider to be bug, that it cannot be used as function argument. However I consider to be bug, that it CAN be used if you use it only once. This works: doTitle(func_get_arg(0)); This works also: doTitle(func_get_arg(1)); So it should not work at all, to be consistent. Ondrej. Previous Comments: [2005-08-13 14:25:47] [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 . [2005-08-13 13:59:26] ondrej at sury dot org Happens in php 5.0.4 as well [2005-08-13 13:58:46] ondrej at sury dot org Description: func_get_arg() can be used as argument to function only once. Reproduce code: --- ?php function doTitle($a = NULL, $b = NULL) { print doTitle: $a, $b\n; } function doHead() { doTitle(func_get_arg(0)); doTitle(func_get_arg(1)); doTitle(func_get_arg(0), 3); doTitle(func_get_arg(0), func_get_arg(1)); } doHead(1, 2); ? Expected result: doTitle: 1, doTitle: 2, doTitle: 1, 3 doTitle: 1, 2 Actual result: -- doTitle: 1, doTitle: 2, doTitle: 1, 3 Fatal error: func_get_arg(): Can't be used as a function parameter in /tmp/func_get_arg.php on line 11 -- Edit this bug report at http://bugs.php.net/?id=34120edit=1
#34120 [Opn]: func_get_arg() can be used function call parameter if used only once
ID: 34120 User updated by: ondrej at sury dot org -Summary: func_get_arg() can not be used more than once in function calls Reported By: ondrej at sury dot org Status: Open Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 4.4.0, 5.0.4 New Comment: I am doing bug triage in Debian BTS and this bug was there... Sooo, if you are ever bored, feel free to fix it :-). Ondrej. Previous Comments: [2005-08-13 14:38:51] [EMAIL PROTECTED] Well, that's true then. But I'm not sure how important this bug is :) [2005-08-13 14:37:03] ondrej at sury dot org Hi Derrick, I don't consider to be bug, that it cannot be used as function argument. However I consider to be bug, that it CAN be used if you use it only once. This works: doTitle(func_get_arg(0)); This works also: doTitle(func_get_arg(1)); So it should not work at all, to be consistent. Ondrej. [2005-08-13 14:25:47] [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 . [2005-08-13 13:59:26] ondrej at sury dot org Happens in php 5.0.4 as well [2005-08-13 13:58:46] ondrej at sury dot org Description: func_get_arg() can be used as argument to function only once. Reproduce code: --- ?php function doTitle($a = NULL, $b = NULL) { print doTitle: $a, $b\n; } function doHead() { doTitle(func_get_arg(0)); doTitle(func_get_arg(1)); doTitle(func_get_arg(0), 3); doTitle(func_get_arg(0), func_get_arg(1)); } doHead(1, 2); ? Expected result: doTitle: 1, doTitle: 2, doTitle: 1, 3 doTitle: 1, 2 Actual result: -- doTitle: 1, doTitle: 2, doTitle: 1, 3 Fatal error: func_get_arg(): Can't be used as a function parameter in /tmp/func_get_arg.php on line 11 -- Edit this bug report at http://bugs.php.net/?id=34120edit=1
#34123 [NEW]: $GLOBALS variable doesn't get printed if used only once
From: ondrej at sury dot org Operating system: Linux PHP version: 4.4.0 PHP Bug Type: Scripting Engine problem Bug description: $GLOBALS variable doesn't get printed if used only once Description: $GLOBALS variable is not printed out if: - used from inside string - used only once Code works fine in PHP5. Reproduce code: --- ?php $file = 'test'; echo __LINE__.${GLOBALS['file']}.\n; ? Expected result: 3test Actual result: -- 3 -- Edit bug report at http://bugs.php.net/?id=34123edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34123r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34123r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34123r=trysnapshot51 Fixed in CVS:http://bugs.php.net/fix.php?id=34123r=fixedcvs Fixed in release:http://bugs.php.net/fix.php?id=34123r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34123r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34123r=needscript Try newer version: http://bugs.php.net/fix.php?id=34123r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34123r=support Expected behavior: http://bugs.php.net/fix.php?id=34123r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34123r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34123r=submittedtwice register_globals:http://bugs.php.net/fix.php?id=34123r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34123r=php3 Daylight Savings:http://bugs.php.net/fix.php?id=34123r=dst IIS Stability: http://bugs.php.net/fix.php?id=34123r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34123r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34123r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34123r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34123r=mysqlcfg
#34123 [Opn]: $GLOBALS variable doesn't get printed if used only once
ID: 34123 User updated by: ondrej at sury dot org Reported By: ondrej at sury dot org Status: Open Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 4.4.0 New Comment: Maybe I should another test case: Reproduce code: --- ?php $file = 'test'; echo __LINE__.${GLOBALS['file']}\n; echo __LINE__.$GLOBALS['file'].\n; ? Expected result: 3test 4test Actual result: -- 3test 4test Ie. it works as it should. Previous Comments: [2005-08-13 14:51:28] ondrej at sury dot org Description: $GLOBALS variable is not printed out if: - used from inside string - used only once Code works fine in PHP5. Reproduce code: --- ?php $file = 'test'; echo __LINE__.${GLOBALS['file']}.\n; ? Expected result: 3test Actual result: -- 3 -- Edit this bug report at http://bugs.php.net/?id=34123edit=1
#34124 [NEW]: array_push() fails when the array doesn't exist
From: ondrej at sury dot org Operating system: Linux PHP version: 5.0.4 PHP Bug Type: Arrays related Bug description: array_push() fails when the array doesn't exist Description: From http://bugs.debian.org/289244: array_push will not create new array when called with arg which is not array type (or nonexistant). This could be just documentation error to state, that new array won't be created inside array_push(). I am not sure that there is easy fix inside PHP, since array parameter in array_push is reference and not value. So it looks like that it gets created inside array_push, but discarded (or leaked?) afterwards. Reproduce code: --- ?php array_push ($foo, 1, 2, 3); print (bar $foo[0] baz\n); ? Expected result: bar 1 baz Actual result: -- bar baz -- Edit bug report at http://bugs.php.net/?id=34124edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34124r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34124r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34124r=trysnapshot51 Fixed in CVS:http://bugs.php.net/fix.php?id=34124r=fixedcvs Fixed in release:http://bugs.php.net/fix.php?id=34124r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34124r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34124r=needscript Try newer version: http://bugs.php.net/fix.php?id=34124r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34124r=support Expected behavior: http://bugs.php.net/fix.php?id=34124r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34124r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34124r=submittedtwice register_globals:http://bugs.php.net/fix.php?id=34124r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34124r=php3 Daylight Savings:http://bugs.php.net/fix.php?id=34124r=dst IIS Stability: http://bugs.php.net/fix.php?id=34124r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34124r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34124r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34124r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34124r=mysqlcfg
#34124 [Bgs]: array_push() fails when the array doesn't exist
ID: 34124 User updated by: ondrej at sury dot org Reported By: ondrej at sury dot org Status: Bogus Bug Type: Arrays related Operating System: Linux PHP Version: 5.0.4 New Comment: As I stated in original bug report, it could be just lack of note in docs. I guess that problem original submitter had was, that it's pretty normal that variables in PHP can be used without initialization, it prints WARNING, but in the end it works as expected. Also documentation states that array_push has same effect as $array[] = $var, which is not true, because [] statement creates array. So I guess simple adding: NOTE: array_push will not create array when called with non-array argument. to docs won't hurt. And it could avoid confusion on user side. Previous Comments: [2005-08-13 15:19:28] [EMAIL PROTECTED] Ever tried to set display_errors to On and error_reporting to E_ALL ? This is what your code outputs.: Warning: array_push(): First argument should be an array in .. I don't see any bugs here. [2005-08-13 15:14:15] ondrej at sury dot org Description: From http://bugs.debian.org/289244: array_push will not create new array when called with arg which is not array type (or nonexistant). This could be just documentation error to state, that new array won't be created inside array_push(). I am not sure that there is easy fix inside PHP, since array parameter in array_push is reference and not value. So it looks like that it gets created inside array_push, but discarded (or leaked?) afterwards. Reproduce code: --- ?php array_push ($foo, 1, 2, 3); print (bar $foo[0] baz\n); ? Expected result: bar 1 baz Actual result: -- bar baz -- Edit this bug report at http://bugs.php.net/?id=34124edit=1
#34066 [NEW]: recursive array_walk causes Segmentain fault
From: ondrej at sury dot org Operating system: Linux PHP version: 5.0.4 PHP Bug Type: Reproducible crash Bug description: recursive array_walk causes Segmentain fault Description: Paul Slootman reported bug when using array_walk recursively which crashes php 5.0.4 with Segmentation Fault. In php 4.4.0 it ends with: Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 138060825 bytes) in /tmp/bug.php on line 252 Reproduce code: --- http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=245934 Expected result: Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 138060825 bytes) in /tmp/bug.php on line 252 Actual result: -- Segmentation fault Backtrace: Program received signal SIGSEGV, Segmentation fault. 0x081fc929 in zend_call_function () -- Edit bug report at http://bugs.php.net/?id=34066edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34066r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34066r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34066r=trysnapshot51 Fixed in CVS:http://bugs.php.net/fix.php?id=34066r=fixedcvs Fixed in release:http://bugs.php.net/fix.php?id=34066r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34066r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34066r=needscript Try newer version: http://bugs.php.net/fix.php?id=34066r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34066r=support Expected behavior: http://bugs.php.net/fix.php?id=34066r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34066r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34066r=submittedtwice register_globals:http://bugs.php.net/fix.php?id=34066r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34066r=php3 Daylight Savings:http://bugs.php.net/fix.php?id=34066r=dst IIS Stability: http://bugs.php.net/fix.php?id=34066r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34066r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34066r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34066r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34066r=mysqlcfg