#19201 [NoF]: htmlspecialchars, et al crashes when called with quote_style
ID: 19201 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: No Feedback Bug Type: Reproducible crash Operating System: Digital Unix 4.0G PHP Version: 4.2.2 New Comment: Which compiler (and version) did you use to build the PHP binary? Some old compilers may produce bogus codes that cause unaligned access. Previous Comments: [2003-01-10 10:48:48] [EMAIL PROTECTED] Still crashes with PHP 4.3.0. I do not have a license for dbx so I can't provide a backtrace, but running the example above from the command line against the cgi binary produces the following: Unaligned access pid=25896 va=0x1400c4cec pc=0x120244758 ra=0x1200bda78 inst=0xb429 Unaligned access pid=25896 va=0x11fffdb7c pc=0x120236d64 ra=0x120237408 inst=0xb42c Segmentation fault [2002-09-23 08:09:20] [EMAIL PROTECTED] No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you. [2002-08-30 13:18:04] [EMAIL PROTECTED] Forgot to say that I can not reproduce this with php 4.2.0-dev (march 7) or php 4.3.0-dev (august 25). They both show this result: &"'<> [2002-08-30 13:15:55] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php4-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-latest.zip [2002-08-30 13:09:37] [EMAIL PROTECTED] The htmlspecialchars and htmlentities functions crash php(typical "document contains no data" error) when called with the second parameter, quote_style (ENT_COMPAT, ENT_QUOTES, ENT_NOQUOTES). If called without the second parameter, these functions return the expected results. May be related to Bug #18048. Sample Script: "; $temp = htmlspecialchars($string,ENT_QUOTES); echo $temp; ?> Configuration Command: '--with-apache=/usr/src/apache_1.3.26' '--with-mysql' '--with-gd=/usr/local' '--with-freetype-dir=/usr/local' '--with-t1lib=/usr/local' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-pdflib=/usr/local' '--with-openssl=/usr/local/ssl' '--with-zlib-dir=/usr/local' '--with-java=/usr/opt/java131' '--with-ldap=/usr/local' '--with-imap=/usr/local/lib' '--with-mcrypt=/usr/local/lib/libmcrypt' '--enable-track-vars' '--enable-ftp' '--enable-sockets' '--enable-trans-sid' -- Edit this bug report at http://bugs.php.net/?id=19201&edit=1
#19201 [NoF->Fbk]: htmlspecialchars, et al crashes when called with quote_style
ID: 19201 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: No Feedback +Status: Feedback Bug Type: Reproducible crash Operating System: Digital Unix 4.0G PHP Version: 4.2.2 Previous Comments: [2003-01-10 12:23:44] [EMAIL PROTECTED] Which compiler (and version) did you use to build the PHP binary? Some old compilers may produce bogus codes that cause unaligned access. [2003-01-10 10:48:48] [EMAIL PROTECTED] Still crashes with PHP 4.3.0. I do not have a license for dbx so I can't provide a backtrace, but running the example above from the command line against the cgi binary produces the following: Unaligned access pid=25896 va=0x1400c4cec pc=0x120244758 ra=0x1200bda78 inst=0xb429 Unaligned access pid=25896 va=0x11fffdb7c pc=0x120236d64 ra=0x120237408 inst=0xb42c Segmentation fault [2002-09-23 08:09:20] [EMAIL PROTECTED] No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you. [2002-08-30 13:18:04] [EMAIL PROTECTED] Forgot to say that I can not reproduce this with php 4.2.0-dev (march 7) or php 4.3.0-dev (august 25). They both show this result: &"'<> [2002-08-30 13:15:55] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php4-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-latest.zip 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/19201 -- Edit this bug report at http://bugs.php.net/?id=19201&edit=1
#21574 [Ver->Bgs]: $_POST doesn't contain good value
ID: 21574 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Verified +Status: Bogus -Bug Type: Variables related +Bug Type: Apache2 related Operating System: RedHat 8 PHP Version: 4CVS-2003-01-10 (stable) New Comment: Duplication of bug #18648. Marking as bogus... Previous Comments: [2003-01-10 22:15:15] [EMAIL PROTECTED] Verified with Apache2 only. (Latest too). [2003-01-10 22:00:48] [EMAIL PROTECTED] It looks the same as #21566. And it looks very critical to me? [2003-01-10 20:23:54] [EMAIL PROTECTED] My configuration is : - RedHat8 - Apache 2.0.43 - PHP 4.3.1-dev (same problem with PHP 4.4.0-dev, PHP 5.0.0-dev ; PHP 4.3.0 have another annoying problem) I have IP stored in a db in longint format (with ip2long(...)). I use the following script to obtain the hostname of an IP. "; print ""; print ""; print ""; $ip = long2ip($entier); print $ip; print "".gethostbyaddr($ip); ?> For example, if I type -722987112, I want to obtain 212.232.23.152 with the good hostname. I have this problem : if I perform a print_r($_POST), I obtain : Array ( [entier] => -722987112entier=-722987112 ) The script worked fine with Apache 1.2.27/PHP 4.2.3 -- Edit this bug report at http://bugs.php.net/?id=21574&edit=1
#21566 [Csd->Bgs]: problem with $_POST
ID: 21566 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Closed +Status: Bogus Bug Type: Apache2 related Operating System: Linux Red Hat 8 PHP Version: 4.2.2 New Comment: Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Because of this, we hope you add your comments to the existing bug instead. Thank you for your interest in PHP. Duplication of bug #18648 Marking as bogus... Previous Comments: [2003-01-11 02:25:21] [EMAIL PROTECTED] I have a version of the CVS (11/01 02:30). No changes, it doesn't work fine. With PHP 4.3.0, same problem. [2003-01-10 08:44:20] [EMAIL PROTECTED] This is probably caused by a bug in older versions of PHP in combination with Apache 2. Please upgrade to the latest version of PHP and Apache 2. [2003-01-10 06:11:35] [EMAIL PROTECTED] I submit data using form ... ..in page2.php I have "; ?> .. I submit myname as 'Jack' .. I get this.. My name is Jackmyname=Jack My PHP came and installed with Linux Red Hat 8. -- Edit this bug report at http://bugs.php.net/?id=21566&edit=1
#18648 [NoF->Opn]: Single entry form POST gives incorrect variable content
ID: 18648 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: No Feedback +Status: Open Bug Type: Apache2 related Operating System: All PHP Version: 4.3.0-dev/4.4.0-dev New Comment: Exactly the same problem was reported recently by other users. Reopening. Previous Comments: [2003-01-05 16:48:15] [EMAIL PROTECTED] Related bug: http://bugs.php.net/21441 [2002-12-25 01:00:03] [EMAIL PROTECTED] No feedback was provided for this bug for over 2 weeks, 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". [2002-12-09 12:48:23] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php4-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-latest.zip Small note for win32 users, the snapshot containing this patch will not be avaliable for a few hours (1 hour for latest CVS, 7 hours for STABLE). [2002-12-08 05:01:28] [EMAIL PROTECTED] Hi guys, I'm having the same problem on Win32 platform. CODE Page 1: USA-United States -All- Page 2: if (isset($HTTP_POST_VARS["marketframe"])) { $strCountryCode = $HTTP_POST_VARS["marketframe"]; } I get the value $strCountryCode = "USAmarketframe=USA" Also tried using $_POST but same result, using the GET method it works fine. OS Version: Windows 2000 Adv. Server SP3 Web Server: Apache 2.0.43 PHP Version: 4.3.0-dev (Oct 20 2002 16:11:45), API Filter, accessing MS SQL Server 7 [2002-12-06 11:30:07] [EMAIL PROTECTED] Oops, I should have meant php_strtok_r() replaces the delimiter "=" by "\0". 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/18648 -- Edit this bug report at http://bugs.php.net/?id=18648&edit=1
#21587 [Bgs]: ob_gzhandler sending out empty pages
ID: 21587 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Bogus Bug Type: Zlib Related Operating System: FreeBSD 4.6 -PHP Version: 4.2.2 +PHP Version: 4.3.0 New Comment: If you want to let PHP automatically choose an appropreate encoding scheme by Accept-Encoding header that is sent by clients, try zlib.output_compression directive instead of using ob_* stuff. Not a php developer issue though. Previous Comments: [2003-01-12 10:06:33] [EMAIL PROTECTED] I can't upgrade PHP on my host's server but I did get someone to test with PHP 4.3.0 on Linux and the problem was fixed, thanks. [2003-01-11 23:12:59] [EMAIL PROTECTED] Thank you for taking the time to report a problem with PHP. Unfortunately you are not using a current version of PHP -- the problem might already be fixed. Please download a new PHP version from http://www.php.net/downloads.php If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PHP. [2003-01-11 14:26:07] [EMAIL PROTECTED] I have an obsolete PDA browser which doesn't support gz compressed pages but sends out the following (unnecessary) header in it's HTTP requests: "Accept-Encoding: " using ob_start("ob_gzhandler"); leads to the browser receiving empty pages. -- Edit this bug report at http://bugs.php.net/?id=21587&edit=1
#21600 [Opn->Ver]: assign by reference function call changes variable contents
ID: 21600 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Verified Bug Type: Variables related Operating System: Redhat 8 PHP Version: 4.3.0 New Comment: Verified with HEAD(ZE2) and PHP_4_3(ZE1). The provided script causes segmentation fault. Previous Comments: [2003-01-12 15:07:10] [EMAIL PROTECTED] under 4.3.0 with apache 2.0.40 I see this strange behavior with aliasing: $foo = "Philip Johnson's \"Glass House\" remains one of the most famous residences in the world."; $foo =& bar($foo); print $foo; function bar($text){ return $text; } outputs: Philip Johnson's "Glass House" remains one of the most famous residences in the worlh This didn't happen under 4.2.3. Although really this was a mistake on my part (I meant to do $foo = bar($foo)) it seems like strange behavior nonetheless. It's also strange to me that if I change return $text; to return "$text"; it works as I would expect. -- Edit this bug report at http://bugs.php.net/?id=21600&edit=1
#21600 [Ver->Ctl]: assign by reference function call changes variable contents
ID: 21600 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Verified +Status: Critical Bug Type: Scripting Engine problem Operating System: Redhat 8 PHP Version: 4.3.0 New Comment: I'm marking this critical because the provided script works fine on the previous released versions. Previous Comments: [2003-01-13 01:21:08] [EMAIL PROTECTED] backtrace (with php-5.0.0-dev): #0 0x40749e49 in __sbrk (increment=1515880448) at ../sysdeps/generic/sbrk.c:33 #1 0x406e9d3c in __default_morecore (increment=1515880448) at ../sysdeps/generic/morecore.c:47 #2 0x406e676d in chunk_alloc (ar_ptr=0x40798520, nb=1515878480) at malloc.c:2583 #3 0x406e60bc in __libc_malloc (bytes=1515878476) at malloc.c:2817 #4 0x08256b63 in zend_mm_add_memory_block (heap=0x8333748, block_size=1515878476) at /dat/dev/php/php-5.0.0dev/Zend/zend_mm.c:143 #5 0x08256de6 in zend_mm_alloc (heap=0x8333748, size=1515878448) at /dat/dev/php/php-5.0.0dev/Zend/zend_mm.c:236 #6 0x08256e0e in zend_mm_alloc (heap=0x8333748, size=1515878448) at /dat/dev/php/php-5.0.0dev/Zend/zend_mm.c:240 #7 0x08256e0e in zend_mm_alloc (heap=0x8333748, size=1515878448) at /dat/dev/php/php-5.0.0dev/Zend/zend_mm.c:240 #8 0x08256e0e in zend_mm_alloc (heap=0x8333748, size=1515878448) at /dat/dev/php/php-5.0.0dev/Zend/zend_mm.c:240 #9 0x08256e0e in zend_mm_alloc (heap=0x8333748, size=1515878448) at /dat/dev/php/php-5.0.0dev/Zend/zend_mm.c:240 #10 0x08256e0e in zend_mm_alloc (heap=0x8333748, size=1515878448) at /dat/dev/php/php-5.0.0dev/Zend/zend_mm.c:240 #11 0x08256e0e in zend_mm_alloc (heap=0x8333748, size=1515878448) at /dat/dev/php/php-5.0.0dev/Zend/zend_mm.c:240 #12 0x08256e0e in zend_mm_alloc (heap=0x8333748, size=1515878448) (last frame continues atleast 15.000 times) Derick [2003-01-12 15:56:50] [EMAIL PROTECTED] Verified with HEAD(ZE2) and PHP_4_3(ZE1). The provided script causes segmentation fault. [2003-01-12 15:07:10] [EMAIL PROTECTED] under 4.3.0 with apache 2.0.40 I see this strange behavior with aliasing: $foo = "Philip Johnson's \"Glass House\" remains one of the most famous residences in the world."; $foo =& bar($foo); print $foo; function bar($text){ return $text; } outputs: Philip Johnson's "Glass House" remains one of the most famous residences in the worlh This didn't happen under 4.2.3. Although really this was a mistake on my part (I meant to do $foo = bar($foo)) it seems like strange behavior nonetheless. It's also strange to me that if I change return $text; to return "$text"; it works as I would expect. -- Edit this bug report at http://bugs.php.net/?id=21600&edit=1
#21654 [Opn->Bgs]: BINARIES DOWNLOADED CORRUPTION
ID: 21654 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: cURL related Operating System: WINDOWS 2000 SP3 PHP Version: 4CVS-2003-01-15 (stable) New Comment: 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 When using PHP on Windows platform it's generally necessary to specify binary mode at fopen() parameter in order to write out non-text data. But actually the data are always written as binary on CGI or CLI version of PHP binary unless you specify text mode that is represented as "t". This is a known exception. Previous Comments: [2003-01-15 04:33:35] [EMAIL PROTECTED] WEB Server : Apache 2.0.42 with SSL enabled PHP 4.3.1 CVS 2003-01-15-01-30 WINDOWS 2000 SP3 Browser IE6SP1 Script : $ch = curl_init(); curl_setopt ($ch,CURLOPT_URL,$sitedownload.$_POST'fichier']); curl_setopt ($ch, CURLOPT_HEADER,0); curl_setopt ($ch,CURLOPT_PROXY,$proxy); $fichiersigs = fopen ($_POST['fichier'], "w"); curl_setopt ($ch,CURLOPT_FILE,$fichiersigs); $test = curl_exec ($ch); curl_close ($ch); If you configured PHP with Apache Module (php4apache2.dll) a binary downloaded file (tested ZIP File) is corrupted. It seemed to convert LF to CRLF but I'm not sure. I tried without success : curl_setopt ($ch,CURLOPT_CRLF,0); If you configured PHP CGI, it works fine (I tested MD5). I tested version 4.3.1 CVS 2003-01-14-01-30 and CVS 2003-01-15-01-30. I think it's easy to reproduce. Yours sincerely, Patrick AUDEMARD -- Edit this bug report at http://bugs.php.net/?id=21654&edit=1
#21689 [Opn->Bgs]: fgetcsv suppresses some characters before a separator
ID: 21689 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: Filesystem function related Operating System: OS/2 PHP Version: 4.2.3 New Comment: Thank you for taking the time to report a problem with PHP. Unfortunately you are not using a current version of PHP -- the problem might already be fixed. Please download a new PHP version from http://www.php.net/downloads.php If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PHP. Previous Comments: [2003-01-16 10:41:56] [EMAIL PROTECTED] fgetcsv suppresses some characters before a separator [OS/2 kheldar 1 2.45 i386, PHP Version 4.2.3, Apache/1.3.22] For example if the csv file has following content: âàø|âåø|âàøå|àø|ø|øø the comand $date = fgetcsv($f, 1000, "|"); gets the array('âà','âå','âàøå','à','',''). instead of array('âàø','âåø','âàøå','àø','ø','øø'). Is installed, that Example works correctly with: 1.FreeBSD 4.1, PHP Version 4.1.2, Apache/1.3.19 2.Windows 98 4.10, PHP Version 4.1.1, Apache/1.3.6 -- Edit this bug report at http://bugs.php.net/?id=21689&edit=1
#21708 [Opn->Fbk]: ucfirst() trouble again
ID: 21708 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Feedback Bug Type: Strings related Operating System: Win 2000 Pro Russian + SP2 PHP Version: 4.3.0 New Comment: Try this: setlocale(LC_CTYPE,"Russian.1251"); Windows locale string convension is different to *nix's. See http://msdn.microsoft.com/library/en-us/vccore98/html/_crt_language_and_country_strings.asp for detail. Previous Comments: [2003-01-17 04:18:46] [EMAIL PROTECTED] Code: Result: Þëà [2003-01-17 03:49:30] [EMAIL PROTECTED] This bug only for Win32 =) ucwords() function once again does not work properly with strings containing international characters. Thus, any character following the "þ"(ACSII code == 254) or "Þ"(ACSII code == 222) letter will always be uppercase. Code: "; } ?> Result: Ïðîñòî ÒþÐüìà ËþÁîâíèê ËþÁîâíèê Ëóáîâíèê =) ËþÄè ËþÄè -- Edit this bug report at http://bugs.php.net/?id=21708&edit=1
#21702 [Opn]: nested foreach on same array using reference fails
ID: 21702 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Scripting Engine problem Operating System: Any PHP Version: Any New Comment: Although I admit that the behaviour is quite inconsistent, we won't fix this anyway because the issue's all up to the language design. > Also, I find this very inconsistent. I didn't mention it in the original > description, but you know what? When you nest two foreach's using the > VERY SAME variable, it magically works! How is it possible that two > references to the same variable are somehow more equivalent than the > variable is to itself??? :-o Well, it looks like a magic. To say more precisely, foreach statement always makes use of a copy of the given array instead of the original itself unless the array is a reference or has a reference. That's the reason you could get along with nested foreach loops in general case. Thus the following while loop (A) is an equivalent to (B). Related bugs: http://bugs.php.net/bug.php?id=8353 Previous Comments: [2003-01-17 06:29:20] [EMAIL PROTECTED] > Marking this as a documentation problem. I was sooo very much afraid you would do exactly this! :-( So it is really intended to work like this? You don't find there is anything wrong with the foreach construct? Consider this: this means that you CAN'T use foreach at all in cases where you don't know for certain whether you couldn't have possibly been called from a foreach over the same array (or a reference to it, in fact). Also, you CAN'T use foreach in a case like mine, in which I found this problem: foreach ($obj->arr as $elem) { ... $obj->method($elem); ... } What if the method also wants to iterate over the array? You don't know, it wasn't you who wrote the class library... Also, I find this very inconsistent. I didn't mention it in the original description, but you know what? When you nest two foreach's using the VERY SAME variable, it magically works! How is it possible that two references to the same variable are somehow more equivalent than the variable is to itself??? :-o No, I don't agree that this is just a documentation problem. Marking as a scripting engine problem again. You may disagree, of course, but please, give it a thought. Or perhaps some discussion. Thanks. [2003-01-17 06:20:26] [EMAIL PROTECTED] Sorry, I meant the outer loop gets confused; not the deeper loop. [2003-01-17 02:23:31] [EMAIL PROTECTED] Actually this is a dupe of bug #14607, but this PR is much more concise than that, so I'm going to keep 14607 bogus and make this alive. Since foreach() uses "internal array pointer" and references are designed to share one such pointer, the deeper loop gets confused and your script never gives the expected result. Virtually the script can be rewritten as... \n"; for ($ptr = 0; $ptr < count($a); $ptr++) { $c = $a[$ptr]; echo "inner: $c \n"; } } ?> Marking this as a documentation problem. [2003-01-16 20:05:14] [EMAIL PROTECTED] Try this: \n"; foreach ($a as $c) echo "-- inner: $c\n"; } ?> The output is: outer: 1 -- inner: 1 -- inner: 2 (i.e., the processing stops after the first iteration of the outer foreach). If I understand the docs well, the output should be: outer: 1 -- inner: 1 -- inner: 2 outer: 2 -- inner: 1 -- inner: 2 When you remove the ampersand from the assignment to $ref, it works as expected. The documentation is a bit unclear on this. It says "Also note that foreach operates on a copy of the specified array, not the array itself, therefore the array pointer is not modified as with the each() construct...", which leads me to believe that the sample code should work. But then it goes on to say: "However, the internal pointer of the original array *is* advanced with the processing of the array.", which seems to contradict the first quotation??? This is probably a dupe of bug #14607, but that one is closed as "bogus" and I can't reopen it. Also see bug #5052, which is similar but not quite, and it's closed. -- Edit this bug report at http://bugs.php.net/?id=21702&edit=1
#21702 [Opn]: nested foreach on same array using reference fails
ID: 21702 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Scripting Engine problem Operating System: Any PHP Version: Any New Comment: No matter what you call this, as a convention of open-source projects, documentation is generally supposed to come up after coding stuff. In other words, the codes determine the design, and the documents are often elusive as there are some cases where they don't reflect the actual behaviour. Regarding the nastiness of references, it's special not only for foreach, but also for the following case. Surprisingly, this script results in -- test ??? -- For more about this, see bug #20993 (this is also marked as a doc-problem). Previous Comments: [2003-01-17 08:27:40] [EMAIL PROTECTED] > Although I admit that the behaviour is quite inconsistent, > we won't fix this anyway because the issue's all up to the > language design. Well, I dunno. In bug #8353, [EMAIL PROTECTED] says: "...the following note exists in the foreach() entry of the manual and has for over two years: Note: Also note that foreach operates on a copy of the specified array, not the array itself, therefore the array pointer is not modified as with the each() construct and changes to the array element returned are not reflected in the original array." The documentation has been changed very recently. To me, this seems like re-defining the language. (Or "changing the rules in the middle of the game", if you prefer.) Instead of fixing the bug, you say it's a feature and change the docs. That seems very Microsoft-ish. Plus, such a language construct is inconsistent, unintuitive and seriously limited in usability. > foreach statement always makes use of a copy of the given > array instead of the original itself unless the array is a > reference or has a reference. The "makes a copy" part is in the docs, and is what I expect. The "unless..." part is (still) not in the docs and seems non-sensical. In fact, in "What References Do", the manual says about what happens after "$a =& $b" the following: "Note: $a and $b are completely equal here, that's not $a is pointing to $b or vice versa, that's $a and $b pointing to the same place." Nowhere in the manual it says that references are special. It just says that a reference is another name for the same variable. I don't see why foreach treats them specially. Note that I'm not advocating for changing the documentation; I'm actually strongly supporting what the documentation says and has said for a long time, and that means foreach is what needs to be changed. BTW, does the "unless..." part of the above quotation mean that when I do $a =& $b; foreach ($a as $elem) $elem->change_self(); it will work - because foreach is not working with a copy of the array? I suppose not, because it will surely make a copy of each element, right? Can I then coerce it by first making an array of references to every element, so that foreach will treat the elements specially? Wow, this is even nastier than I thought! ;-) Let's make a vote on the front page of php.net: - Foreach Pro-consistency Front program: repair foreach, return docs to previous state - Conservative Foreach Party program: keep foreach as is, make docs even more clear [2003-01-17 07:36:09] [EMAIL PROTECTED] Although I admit that the behaviour is quite inconsistent, we won't fix this anyway because the issue's all up to the language design. > Also, I find this very inconsistent. I didn't mention it in the original > description, but you know what? When you nest two foreach's using the > VERY SAME variable, it magically works! How is it possible that two > references to the same variable are somehow more equivalent than the > variable is to itself??? :-o Well, it looks like a magic. To say more precisely, foreach statement always makes use of a copy of the given array instead of the original itself unless the array is a reference or has a reference. That's the reason you could get along with nested foreach loops in general case. Thus the following while loop (A) is an equivalent to (B). Related bugs: http://bugs.php.net/bug.php?id=8353 [2003-01-17 06:29:20] [EMAIL PROTECTED] > Marking this as a documentation problem. I was sooo very much afraid you would do exactly this! :-( So it is really intended to work like this? You don't find there is anything wrong with the foreach construct? Consider this: this means that you CAN'T use foreach at all in cases where you don't know for certain whether you couldn't have possibly been called from a foreach over the same array (or a reference to it, in fact). Also, y
#21708 [Opn]: ucfirst() trouble again
ID: 21708 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Strings related Operating System: Win 2000 Pro Russian + SP2 PHP Version: 4.3.0 New Comment: Hmm, you can use mb_convert_case() instead if mbstring extension is enabled. http://www.php.net/mb_convert_case Previous Comments: [2003-01-17 15:12:22] [EMAIL PROTECTED] Thank's. I tried to do this. No effect. =( I think it can be feature of PHP under Win32 ;-) [2003-01-17 04:50:28] [EMAIL PROTECTED] Try this: setlocale(LC_CTYPE,"Russian.1251"); Windows locale string convension is different to *nix's. See http://msdn.microsoft.com/library/en-us/vccore98/html/_crt_language_and_country_strings.asp for detail. [2003-01-17 04:18:46] [EMAIL PROTECTED] Code: Result: Þëà [2003-01-17 03:49:30] [EMAIL PROTECTED] This bug only for Win32 =) ucwords() function once again does not work properly with strings containing international characters. Thus, any character following the "þ"(ACSII code == 254) or "Þ"(ACSII code == 222) letter will always be uppercase. Code: "; } ?> Result: Ïðîñòî ÒþÐüìà ËþÁîâíèê ËþÁîâíèê Ëóáîâíèê =) ËþÄè ËþÄè -- Edit this bug report at http://bugs.php.net/?id=21708&edit=1
#21128 [Opn->Dup]: lost of static reference between calls
ID: 21128 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Duplicate Bug Type:Scripting Engine problem PHP Version: 4.2.3 New Comment: Variant of bug #20175 Previous Comments: [2002-12-21 04:38:52] [EMAIL PROTECTED] I want to keep a reference on a global object in a static method. But, between calls of this static method, my reference becomes NULL ! Look at this simple self-explanatory code: class B { var $x=100; } class A { /*Returns an instance*/ function &getInstance(){ if( !isset($GLOBALS['foo']) ){ $GLOBALS['foo'] =& new B(); } return $GLOBALS['foo']; } } /*this function gets the instance and show information*/ function staticExecution(){ static $instance=NULL; echo "ENTER staticExecution". "\n"; //If static variable is not initialized if( $instance === NULL ){ $instance =& A::getInstance(); echo "DEBUG: getInstance is called". "\n";; } echo 'BEFORE INCREMENT:$instance->x=='.$instance->x."\n"; $instance->x++; echo 'AFTER INCREMENT: $instance->x == '.$instance->x . "\n"; echo "EXIT staticExecution". "\n";; } //ten call to staticExecution for ($i=0; $i<10; $i++){ staticExecution(); echo ""; } RESULTS: ENTER staticExecution DEBUG: getInstance is called BEFORE INCREMENT: $instance->x == 100 AFTER INCREMENT: $instance->x == 101 EXIT staticExecution ENTER staticExecution DEBUG: getInstance is called BEFORE INCREMENT: $instance->x == 101 AFTER INCREMENT: $instance->x == 102 EXIT staticExecution ENTER staticExecution DEBUG: getInstance is called BEFORE INCREMENT: $instance->x == 102 AFTER INCREMENT: $instance->x == 103 EXIT staticExecution ENTER staticExecution DEBUG: getInstance is called BEFORE INCREMENT: $instance->x == 103 AFTER INCREMENT: $instance->x == 104 EXIT staticExecution LIKE THIS TEN TIMES; WHAT DO WE NOTICE: - the reference returned is good: x is incremented - BUT the debug message appears 10 times !!! Indeed, my static variable is reinitialized between calls -- Edit this bug report at http://bugs.php.net/?id=21128&edit=1
#21044 [Opn->Csd]: getcwd() returns empty string (not always)
ID: 21044 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Closed Bug Type: Directory function related Operating System: Linux, 2.2.22 PHP Version: 4.3.0RC3 Previous Comments: [2002-12-18 09:48:26] [EMAIL PROTECTED] I've got the solution! After hacking php sources for a few hours (ok, minutes...) I've found the solution: I had to add '#define VIRTUAL_DIR 0' line just before '#ifdef VIRTUAL_DIR' condition in TSRM/tsrm_virtual_cwd.h file. To my surprise defined values (0 wether 1) has no effect. I just had to add that define. Now everything works. Well, maybe it's my gcc fault. I'm using quite an old one: 2.7.2.3 Thanks for your time. [2002-12-16 10:17:03] [EMAIL PROTECTED] Thank you for taking the time to report a problem with PHP. Unfortunately you are not using a current version of PHP -- the problem might already be fixed. Please download a new PHP version from http://www.php.net/downloads.php If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PHP. I've tries the latest 4.3.0 stable CVS and cannot replicate the bug. getcwd() on non-zts installs uses the native getcwd() provided by your libc, so the virtual host or simular things will have no affect on it. [2002-12-16 08:56:52] [EMAIL PROTECTED] According to phpinfo(): ./configure --with-apxs=/usr/local/apache/bin/apxs --without-pear --with-zlib --with-dom --without-xml --with-expat-dir=/usr/local --with-iconv=/usr/local --with-curl --with-pgsql=/usr/local/pgsql --enable-ftp Full phpinfo() output can be found at: http://www.ma.krakow.pl/~miki/test.php Now that site is running 4.3.0-pre1, but it behaves the same like 4.3.0rc3 I tested it on (with the same configure parameters). [2002-12-16 08:49:30] [EMAIL PROTECTED] Could you please show the parameters you've passed to PHP's configure script, they can be found inside config.nice. [2002-12-16 08:04:36] [EMAIL PROTECTED] getcwd() works only within pages in 'main' document root. Pages under user directories (/~user/) and pages located in every virtual host directory doesn't get proper getcwd(). It results in include() and reqiure() using relative paths not working. Bug came out when I was trying to install fresh copy of postnuke. -- Edit this bug report at http://bugs.php.net/?id=21044&edit=1
#8217 [Opn->Csd]: long2ip gives 127.255.255.255 result instead of correct value
ID: 8217 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Closed Bug Type: Feature/Change Request Operating System: Linux PHP Version: 4.0.3pl1 New Comment: Thank you for your bug report. This issue has already been fixed in the latest released version of PHP, which you can download at http://www.php.net/downloads.php Previous Comments: [2000-12-13 06:35:01] [EMAIL PROTECTED] Numbers you brought are not valid PHP longs, they don't fit signed long. So they don't give good result in long2ip. It might be done with a special hack, but it's not a bug - it's a lacking feature. [2000-12-12 18:43:49] [EMAIL PROTECTED] Feed the following list to this script and you will see how long2ip screws up. There is an overflow condition it seems: 178519801 1061963075 1070665698 1070668067 2180645450 2180645574 2180645666 2180645722 2180647266 2180648705 2180649062 2180652350 2180676205 2301042637 2554268534 2554278550 2554279006 3232238083 3232238334 3435825182 3435825736 3475085569 3506496261 3508072161 3522432302 3528459286 3528470646 3528471070 -- Edit this bug report at http://bugs.php.net/?id=8217&edit=1
#8328 [Opn->WFx]: ucwords and ucfirst misbehaving with quotes
ID: 8328 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Wont fix Bug Type: Feature/Change Request Operating System: Linux PHP Version: 4.0.3pl1 New Comment: FYI: you can use mb_convert_case() function that was introduced in 4.3.0 instead of ucwords(). It works exactly as you want. Previous Comments: [2001-01-10 01:37:44] [EMAIL PROTECTED] i disagree with the proposed change to ucfirst (which incidentally returns >>"test2" again<<) since, unlike ucwords, it isn't necessarily only used for natural language. [2000-12-20 01:03:00] [EMAIL PROTECTED] Another unrelated ucwords/ucfirst bug(?): produces: This Is A "test" With Word "test" In Quotes "test2" Again I understand that by algorithm, first character of each word *IS* upper-cased (because first character is "). However, for us humans, " is not considered a part of a word, therefore "t" in above example should be treated as first letter, and test and test2 should be Test and Test2. I think that any non-alphanumeric character that is in the beginning of a word (meaning follows a whitespace) should not be considered as "first". So then: "test1" - 'test2' would be"Test1" - 'Test2' "test3" -'test4'would be"Test3" -'Test4' "test5-test6" would be"Test5-test6" Comments welcome.. -- Edit this bug report at http://bugs.php.net/?id=8328&edit=1
#14705 [Opn->Bgs]: func_get_args(): return references to params?
ID: 14705 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: Feature/Change Request Operating System: linux PHP Version: 4.0.5 New Comment: Duplicate of bug #6427 Keep this in one place... Previous Comments: [2001-12-26 16:20:52] [EMAIL PROTECTED] function pointerTest() { $args = &func_get_args(); pointerTest2(&$args[0]); $myP = &$args[0]; pointerTest2(&$myP); } function pointerTest2(&$arg1) { $arg1++; } $myVal = 10; pointerTest(&$myVal); echo $myVal; - i believe that currently func_get_args() can't return an array of references. it also applies to func_get_arg(int) which can't return a reference to the parameter in question. could that be changed to allow user-defined functions on variable-length argument lists that operate on their parameters by reference? -- Edit this bug report at http://bugs.php.net/?id=14705&edit=1
#14949 [Opn->Csd]: fprintf function
ID: 14949 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Closed Bug Type: Feature/Change Request Operating System: All PHP Version: 4.1.1 New Comment: This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Previous Comments: [2002-01-09 09:57:35] [EMAIL PROTECTED] This issue has stumped me since I first started working with PHP (Around version 3.0.14 I believe). And I'm fairly sure I'm not the only one wondering about this. How come there is no fprintf function? I looked at the FAQ on the website (even tried submitting a comment on it). I've read a few books on PHP, and they all say "there is no fprintf function." I've done numerous web searches on this question, and although I have found workarounds for the lack of this function, I never found the reason why it was excluded. I know you are all busy with other, more pressing concerns regarding PHP and its upkeep, but whatever the answer is, could you please put it in the FAQ for all to see? Thanks for your time! -- Edit this bug report at http://bugs.php.net/?id=14949&edit=1
#19300 [Opn->Csd]: $_POST vars lost chars when parse form
ID: 19300 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Closed -Bug Type: Feature/Change Request +Bug Type: mbstring related Operating System: all PHP Version: 4.2.3 Previous Comments: [2002-09-09 01:26:31] [EMAIL PROTECTED] page1.htm : When the inputbox content is BIG5 encoding words, after submiting, the $_POST['title'] variable will lose pre-words. example: input = ´ú¸Õ¤@¤U $_POST['title'] = "¤@¤U" ### configure line: CC=gcc \ CFLAGS="-O6 -mcpu=pentiumpro" \ ./configure \ --enable-track-vars \ --enable-inline-optimization \ --enable-mbstring \ --enable-mbstr-enc-trans \ --enable-ctype \ --disable-wddx \ --disable-debug \ --disable-experimental-zts \ --with-xml \ --with-mcrypt=/usr/local \ --with-dom=/usr/local \ --with-zlib-dir=/usr/local \ --with-mysql=/usr/local/mysql \ --with-iconv=/usr/local \ --with-apxs=/usr/local/apache/bin/apxs \ --prefix=/usr/local -- Edit this bug report at http://bugs.php.net/?id=19300&edit=1
#17819 [Opn->Dup]: gethostbyaddr
ID: 17819 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Duplicate Bug Type: Feature/Change Request Operating System: RedHat Linux 7.2 PHP Version: 4.1.2 New Comment: This feature request seems the same as bug #14246 Previous Comments: [2002-06-18 13:39:11] [EMAIL PROTECTED] Can we get the function gethostbyaddr or gethostbyip to accept a second value. that second value would be that of what DNS server to query to get the information. If second value is NULL, then use the systems resolv library. -- Edit this bug report at http://bugs.php.net/?id=17819&edit=1
#12857 [Opn]: get_html_translation_tabele() and non HTML_SPECIALCHARS
ID: 12857 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type:Feature/Change Request PHP Version: 4.0.6 New Comment: Related to bug #12526 Previous Comments: [2001-08-20 06:44:49] [EMAIL PROTECTED] Hi all, i have the need for another translation table of function get_html_translation_tabele(); HTML_SPECIALCHARS returns only Specialchars (<,>,&,") HTML_ENTITIES returns all Entities but i need the complete Entity Table without the special chars. -- Edit this bug report at http://bugs.php.net/?id=12857&edit=1
#21726 [Opn]: Memory leaks
ID: 21726 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: *General Issues Operating System: Linux PHP Version: 5CVS-2003-01-18 (dev) -Assigned To: +Assigned To: moriyoshi New Comment: I'm working on this. Previous Comments: [2003-01-18 11:42:56] [EMAIL PROTECTED] my fault; I'm playing with a local copy of the bugdb and didn't update the mailto address. [2003-01-18 11:39:46] [EMAIL PROTECTED] Due to a bug in the installed sed on your system the build fails. Install GNU sed and it should be okay. Thank you for your interest in PHP. [2003-01-18 08:32:46] [EMAIL PROTECTED] /opt/DEV/php/php4/ext/standard/scanf.c(887) : Freeing 0x418B2B64 (22 bytes), script=./test.php Last leak repeated 675 times /opt/DEV/php/php4/Zend/zend_execute.c(2876) : Freeing 0x418A6964 (4 bytes), script=./test.php /opt/DEV/php/php4/Zend/zend_variables.c(110) : Actual location (location was relayed) with this script: #!/usr/bin/php The Makefile used is the Makefile generated in php source directory when running configure. And yes, the script is ugly. -- Edit this bug report at http://bugs.php.net/?id=21726&edit=1
#21726 [Opn]: Memory leaks
ID: 21726 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: *General Issues Operating System: Linux PHP Version: 5CVS-2003-01-18 (dev) Assigned To: moriyoshi New Comment: Changing the line while ($temp = fscanf($fp,"%s = %s",$var,$var2)) { to while ($temp = fscanf($fp,"%n = %n",$var,$var2)) { causes the runtime to segfault. Previous Comments: [2003-01-18 11:51:49] [EMAIL PROTECTED] I'm working on this. [2003-01-18 11:42:56] [EMAIL PROTECTED] my fault; I'm playing with a local copy of the bugdb and didn't update the mailto address. [2003-01-18 11:39:46] [EMAIL PROTECTED] Due to a bug in the installed sed on your system the build fails. Install GNU sed and it should be okay. Thank you for your interest in PHP. [2003-01-18 08:32:46] [EMAIL PROTECTED] /opt/DEV/php/php4/ext/standard/scanf.c(887) : Freeing 0x418B2B64 (22 bytes), script=./test.php Last leak repeated 675 times /opt/DEV/php/php4/Zend/zend_execute.c(2876) : Freeing 0x418A6964 (4 bytes), script=./test.php /opt/DEV/php/php4/Zend/zend_variables.c(110) : Actual location (location was relayed) with this script: #!/usr/bin/php The Makefile used is the Makefile generated in php source directory when running configure. And yes, the script is ugly. -- Edit this bug report at http://bugs.php.net/?id=21726&edit=1
#21730 [NEW]: *scanf "%n" conversion flag gives string instead of integer
From: [EMAIL PROTECTED] Operating system: Any PHP version: 5CVS-2003-01-18 (dev) PHP Bug Type: Strings related Bug description: *scanf "%n" conversion flag gives string instead of integer Try the following script: -- Edit bug report at http://bugs.php.net/?id=21730&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=21730&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=21730&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=21730&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=21730&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=21730&r=oldversion Not developer issue:http://bugs.php.net/fix.php?id=21730&r=support Expected behavior: http://bugs.php.net/fix.php?id=21730&r=notwrong Not enough info:http://bugs.php.net/fix.php?id=21730&r=notenoughinfo Submitted twice:http://bugs.php.net/fix.php?id=21730&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=21730&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21730&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=21730&r=dst IIS Stability: http://bugs.php.net/fix.php?id=21730&r=isapi Install GNU Sed:http://bugs.php.net/fix.php?id=21730&r=gnused
#21726 [Opn->Csd]: Memory leaks
ID: 21726 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Closed Bug Type: *General Issues Operating System: Linux PHP Version: 5CVS-2003-01-18 (dev) Assigned To: moriyoshi New Comment: This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Previous Comments: [2003-01-18 11:54:30] [EMAIL PROTECTED] Changing the line while ($temp = fscanf($fp,"%s = %s",$var,$var2)) { to while ($temp = fscanf($fp,"%n = %n",$var,$var2)) { causes the runtime to segfault. [2003-01-18 11:51:49] [EMAIL PROTECTED] I'm working on this. [2003-01-18 11:42:56] [EMAIL PROTECTED] my fault; I'm playing with a local copy of the bugdb and didn't update the mailto address. [2003-01-18 11:39:46] [EMAIL PROTECTED] Due to a bug in the installed sed on your system the build fails. Install GNU sed and it should be okay. Thank you for your interest in PHP. [2003-01-18 08:32:46] [EMAIL PROTECTED] /opt/DEV/php/php4/ext/standard/scanf.c(887) : Freeing 0x418B2B64 (22 bytes), script=./test.php Last leak repeated 675 times /opt/DEV/php/php4/Zend/zend_execute.c(2876) : Freeing 0x418A6964 (4 bytes), script=./test.php /opt/DEV/php/php4/Zend/zend_variables.c(110) : Actual location (location was relayed) with this script: #!/usr/bin/php The Makefile used is the Makefile generated in php source directory when running configure. And yes, the script is ugly. -- Edit this bug report at http://bugs.php.net/?id=21726&edit=1
#21730 [Opn->Csd]: *scanf "%n" conversion flag gives string instead of integer
ID: 21730 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Closed Bug Type: Strings related Operating System: Any PHP Version: 5CVS-2003-01-18 (dev) Assigned To: moriyoshi New Comment: This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Previous Comments: [2003-01-18 12:28:28] [EMAIL PROTECTED] Try the following script: -- Edit this bug report at http://bugs.php.net/?id=21730&edit=1
#21094 [Opn->Ver]: set_error_handler not accepting methods
ID: 21094 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Verified Bug Type: Zend Engine 2 problem -Operating System: OS X 10.2 +Operating System: OS X 10.2, RedHat 8.0 -PHP Version: 4CVS-2002-12-19 (dev) +PHP Version: 5CVS-2003-1-19 (dev) Previous Comments: [2002-12-19 04:11:08] [EMAIL PROTECTED] The set_error_handler() function is not accepting class methods as of the php4-ze2 CVS code from 19-Dec-2002. It does work with php 4.3 and ZE1. -- Edit this bug report at http://bugs.php.net/?id=21094&edit=1
#21732 [NEW]: preg_replace() segfaults with invalid parameters
From: [EMAIL PROTECTED] Operating system: RedHat 8.0 PHP version: 5CVS-2003-01-18 (dev) PHP Bug Type: PCRE related Bug description: preg_replace() segfaults with invalid parameters While handling the feature request (bug #7006), I found another bug. I know the above script is incorrect as the manual goes: > If pattern is an array and replacement is a string, then > this replacement string is used for every value of > pattern. The converse would not make sense, though. But I didn't expect it would segfault... [backtrace] #0 0x0806bd04 in php_pcre_replace (regex=0x400a6d64 "/%col%/", regex_len=7, subject=0x400a7038 "%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%"..., subject_len=500, replace_val=0x400a6de4, is_callable_replace=0, result_len=0xbfffd334, limit=-1) at /home/koizumi/src/php5/ext/pcre/php_pcre.c:833 re = (struct real_pcre *) 0x81bb678 extra = (struct real_pcre_extra *) 0x0 exoptions = 0 preg_options = 0 count = 1 offsets = (int *) 0x400a7264 size_offsets = 3 new_len = 2122001 alloc_len = 1001 eval_result_len = 0 match_len = 404 backref = 3 eval = 0 start_offset = 0 g_notempty = 0 replace_len = 134564634 result = 0x400a79fc 'Z' , "\204?\217*?%\003" replace = 0x400a6e28 "\b" new_buf = 0x22c walkbuf = 0x400a7008 ",\002" walk = 0x402ad000 match = 0x400a7038 "%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%"... piece = 0x400a7038 "%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%%col%"... replace_end = 0x480fb942 eval_result = 0x400a7234 "D" walk_last = 0 '\0' #1 0x0806c518 in php_replace_in_subject (regex=0x400a6a8c, replace=0x400a6de4, subject=0x4009abc0, result_len=0xbfffd334, limit=-1, is_callable_replace=0 '\0') at /home/koizumi/src/php5/ext/pcre/php_pcre.c:1013 regex_entry = (struct _zval_struct **) 0x400a6ff4 replace_entry = (struct _zval_struct **) 0x0 replace_value = (struct _zval_struct *) 0x817dbe0 empty_replace = {value = {lval = 135781248, dval = 6.7084849986250466e-316, str = {val = 0x817db80 "", len = 0}, ht = 0x817db80, obj = {handle = 135781248, handlers = 0x0}}, refcount = 135594816, type = 3 '\003', is_ref = 4 '\004'} subject_value = 0x8131450 "\203? \211\003åN" result = 0xbfffd2f8 "©\t@4???" subject_len = 1074425912 #2 0x0806cb57 in preg_replace_impl (ht=3, return_value=0x400a6da0, this_ptr=0x0, return_value_used=1, is_callable_replace=0 '\0') at /home/koizumi/src/php5/ext/pcre/php_pcre.c:1100 regex = (struct _zval_struct **) 0x4009abb8 replace = (struct _zval_struct **) 0x4009abbc subject = (struct _zval_struct **) 0x4009abc0 limit = (struct _zval_struct **) 0x0 subject_entry = (struct _zval_struct **) 0x400a6d70 result = 0x8191400 "" result_len = 0 limit_val = -1 string_key = 0x44 num_key = 3221214040 callback_name = 0x0 #3 0x0806cba8 in zif_preg_replace (ht=3, return_value=0x400a6da0, this_ptr=0x0, return_value_used=1) at /home/koizumi/src/php5/ext/pcre/php_pcre.c: No locals. #4 0x08147cef in zend_do_fcall_common_helper (execute_data=0xbfffd5e0, op_array=0x400a5de4) at /home/koizumi/src/php5/Zend/zend_execute.c:2566 original_return_value = (struct _zval_struct **) 0x12e current_scope = (struct _zend_class_entry *) 0x0 current_this = (struct _zval_struct *) 0x0 return_value_used = 1 #5 0x0814828b in zend_do_fcall_handler (execute_data=0xbfffd5e0, op_array=0x400a5de4) at /home/koizumi/src/php5/Zend/zend_execute.c:2692 fname = (struct _zval_struct *) 0x400a64a8 #6 0x0814376a in execute (op_array=0x400a5de4) at /home/koizumi/src/php5/Zend/zend_execute.c:1218 execute_data = {opline = 0x400a6484, function_state = { function_symbol_table = 0x0, function = 0x81bac28, reserved = {0x0, 0x0, 0xb920, 0x0}}, fbc = 0x0, fbc_constructor = 0x0, op_array = 0x400a5de4, object = 0x0, Ts = 0xbfffd400, original_in_execution = 0 '\0', calling_scope = 0x0, prev_execute_data = 0x0} ... #7 0x08132ede in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/koizumi/src/php5/Zend/zend.c:996 #8 0x08101892 in php_exe
#8427 [Opn->Ana]: Unwanted references
ID: 8427 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Analyzed Bug Type: Feature/Change Request Operating System: Any PHP Version: 4.0.4 New Comment: 1) when setting a variable by reference from a part of array or object, the value being set _from_ is also turned into reference This is not supposed to be a bug. See bug #20993. 2) object contained in other objects are turned into references by settype() and calling their methods This might be a bug, but this problem doesn't occur under ZendEngine2. Stay tuned. 3) NULLs become references to NULLs when you set an object from them by reference. This is expected behaviour. Previous Comments: [2000-12-26 13:31:46] [EMAIL PROTECTED] There are at least three places I know of where normal values are silently turned into references: - when setting a variable by reference from a part of array or object, the value being set _from_ is also turned into reference - object contained in other objects are turned into references by settype() and calling their methods - NULLs become references to NULLs when you set an object from them by reference Because this all alters the behaviour of PHP in subtle, dangerous ways, makes debugging harder and because references have still bugs (for example, serialisation), I ask you not to turn things into references when I don't see there is any reason to. I understand it is your policy that "turning a value into a reference should be safe", but as long as references have problems, don't adopt this policy. -- Edit this bug report at http://bugs.php.net/?id=8427&edit=1
#15098 [Opn->Bgs]: func_get_args_by_ref()
ID: 15098 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type:Feature/Change Request PHP Version: 4.1.1 New Comment: Virtually this feature request is the same as bug #6427... Previous Comments: [2002-01-18 07:56:37] [EMAIL PROTECTED] A combination between function_get_args (for a variable amount of arguments) and pass-by-reference. So to allow pass-by-reference on a variable amount of arguments. -- Edit this bug report at http://bugs.php.net/?id=15098&edit=1
#15523 [Opn->Csd]: Line Number
ID: 15523 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Closed Bug Type: Feature/Change Request Operating System: Linux PHP Version: 4.1.1 New Comment: Try debug_backtrace(). Previous Comments: [2002-06-08 10:44:35] [EMAIL PROTECTED] What would be nice is if line() and file() were functions and they returned an array of line numbers and files...Hence, for each level of depth you proceed, it would array_push the line and file and then when you exited it would pop them. That way, you could get the whole hierarchy, and without and punishment. I realize that php is going towards stack tracing, but this would be HUGE. PEAR_Error would actually be helpful in cases that used this functionality. [2002-02-12 10:53:00] [EMAIL PROTECTED] reopening, this is a serious request ;) [2002-02-12 10:51:37] [EMAIL PROTECTED] That would work of course. The problem is, that our company has written a set of php functions, which are used by one of our clients. The functions include some error-handling like wrong arguments or something like that, and I'd like to tell them the linenumber. I think its not very useful that they have to put __LINE__ into every function call :) [2002-02-12 10:47:52] [EMAIL PROTECTED] what about function foo($line) { echo 'the function was called in line: '.$line } foo(__LINE__); ? [2002-02-12 10:45:32] [EMAIL PROTECTED] Hi there! That's correct, that __LINE__ contains the !current! Line-Number. But I what to know from which line a function has been called. > > > > 1 function blah() > > 2 { > > 3echo("Function blah has been called from line 6"); > > 4 } > > 5 > > 6 blah(); > > In line 3, i don't want to know the CURRENT line Number. I'd like to know the Line-Number from which that Function has been called. mfg, Nico Blanke. 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/15523 -- Edit this bug report at http://bugs.php.net/?id=15523&edit=1
#16464 [Opn->Bgs]: func_get_arg(), func_get_args() should be reference proof
ID: 16464 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: Feature/Change Request Operating System: All PHP Version: 4.1.2 New Comment: This request is virtually the same as bug #6427. Previous Comments: [2002-04-06 13:38:31] [EMAIL PROTECTED] Think of a factory function that creates an object of various classes by calling that object's constructor with the same arguments. If a constructor needs a reference (perhaps to another object), this is not possible if you want to write clean code without tricks like hard-code arguments with default values. [2002-04-06 13:32:07] [EMAIL PROTECTED] The function func_get_arg() and func_get_args() should support being called to return references: function do_something() { $args = func_get_args(); for ($i=0; $i -- Edit this bug report at http://bugs.php.net/?id=16464&edit=1
#6427 [Opn]: func_get_arg() does not support references
ID: 6427 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Feature/Change Request Operating System: * PHP Version: 4.0.1pl2 New Comment: There are the same requests as this one: Bug #14705 Bug #15098 Bug #16464 Previous Comments: [2000-09-23 12:22:57] [EMAIL PROTECTED] Stas: If I possible, I would like to better understand you statement...here is what I am thinking you mean, please correct me if I am wrong: $o=1; test($o); echo $o; function test() { $a = &func_get_args(); /** $a[0] has already been passed as a copy. We have no idea what to reference it back to! */ } [2000-09-20 21:40:09] [EMAIL PROTECTED] a function func_get_rarg() should avoid this by treating any function parameter as a reference (if possible), moved to feature request [2000-09-20 18:23:08] [EMAIL PROTECTED] I fear this cannot be done - you should pass a variable by reference from the start, otherwise you will just assign a reference to a copy. [2000-08-29 21:38:56] [EMAIL PROTECTED] func_get_arg() does not support references (see example), $o=1; test($o); echo $o; function test() { $l=&func_get_arg(0); $l=2; } displays 1, should 2, I think it should be possible changing this without impact, if not perhaps a func_get_rarg() be fine -- Edit this bug report at http://bugs.php.net/?id=6427&edit=1
#12775 [Opn->WFx]: Incorrect result using references and objects
ID: 12775 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Wont fix Bug Type: Zend Engine 2 problem Operating System: All PHP Version: 4.0.6 New Comment: Variant of bug #20175 Previous Comments: [2002-12-06 19:57:13] [EMAIL PROTECTED] reclassified. And this is actually fixed in ZE2 already..? [2001-08-16 18:14:01] [EMAIL PROTECTED] I always use a 'cool' workaround (forgot to mention it), it isn't extremely fast, it is simple... works on both objects, arrays, and mixes. It also preserves internal references ($obj->a =& $obj->b) The workaround? // $a = $b should have worked like this: function deep_copy(&$a,&$b) { $a = unserialize(serialize($b)); } [2001-08-16 16:44:45] [EMAIL PROTECTED] Actually, that would be a nice feature. If one could call a function on an object such as "make_reference($this)" to change the assignment semantics for an object it would be a great way to maintain backward compatibility but let new objects be assign-by-reference. Anyway, the following function will do a deep copy of the object to get around this bug (if you didn't use the words "shallow copy" I wouldn't have thought of it): function copy_object($object) { $copy = $object; $properties = get_object_vars($object); foreach($properties as $name => $value) { if (is_object($value)) $copy->$name = copy_object($value); else $copy->$name = $value; } return $copy; } [2001-08-15 18:11:10] [EMAIL PROTECTED] Shallow copying of objects and arrays bit you... Will be fixed in PHP 5 Suspended (it could be called a 'feature' though...) [2001-08-15 18:00:05] [EMAIL PROTECTED] If you set a property of an object to a global variable, it is no longer possible to make a copy of that object! Every "copy" becomes a reference. Example: --/ snip /-- class foo { function foo() { $this->test = 'Test'; $GLOBALS['test'] =& $this->test; } } $obj1 = new foo(); $copyOfObj1 = $obj1; // Should be a copy, but is reference $obj1->test = "changed!"; echo $copyOfObj1->test.''; --/ snip /-- The result of this code is: "changed!" but it should be "Test". $copyOfObj1 should be a copy of $obj1, but instead it acts like a reference. If you unset $GLOBALS['test'] then it copies as it should. This is a bug occurs in all versions of PHP4 on all platforms (from what I can tell). -- Edit this bug report at http://bugs.php.net/?id=12775&edit=1
#20166 [Opn->Fbk]: Unicode (Slovenian) characters are not displayed correctly
ID: 20166 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Feedback Bug Type: *Languages/Translation Operating System: Win2k PHP Version: 4.2.2 New Comment: Doesn't your problem look like the one reported in the following bug report? http://bugs.php.net/19474 Previous Comments: [2002-11-08 00:06:19] [EMAIL PROTECTED] A simple output of the three versions: MSSQL accessed trough ADO COM object: title: Novela zakona o dravljanstvu ne reuje nièesar PHP Mssql extension: title: Novela zakona o dr§avljanstvu ne reçuje niesar MYSQL (entered trough command line) String: ç§¬æ¦ string MYSQL (entered trough php form) String: è string [2002-11-05 00:29:14] [EMAIL PROTECTED] Hi! To define more clearly: I have a Microsoft SQL database. In that database, there are many articles, with pictures, etc. I tried to access those articles using php, and wanted to display them. All is fine, but, instead of slovene characters è (which you probably don't see anyway) I get garbles (unrecognized characters). I was using mssql_* functions to retrieve the data. Then, I created a simple table in mysql, inserted a row manually (from the console) and the same thing happens. BUT, if I insert the items trough PHP the first time, than the characters are retrieved correctly. So I suspect there must be something with encoding, perhaps. To make things even more funny, when I used ADO COM object to access the MS SQL server, the strings retrieved are fine. I apologize if I posted this under the wrong category, but I could not decide whether it is a db problem or not. Feel free to move this item to another category, if you wish. System details: SQL Server: Win2k, Slovenian locale PHP system: Win2k, Apache 1.3.26 (Win32), PHP 4.2.2, mysql 3.23.52, Slovenian locale [2002-10-30 07:05:53] [EMAIL PROTECTED] Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. [2002-10-30 02:45:23] [EMAIL PROTECTED] The problem is with Microsoft SQL Server 2000 and with MySQL version Ver 11.18 Distrib 3.23.52, for Win95/Win98 (i32). I have a database with slovenian characters in the fields and I am not able to display them properly with php extension modules. I can display them propery using COM ADO objects. I've included a simple script, that shows what I am trying to do. The ADO portion of the script produces the desired result. The characters are entered using windows-1250 codepage. The script: Open("PROVIDER=MSDASQL;DRIVER={SQL SERVER}; Server=SRRDEV2;Database=portal;UID=sa;PWD=srrdev2;"); // SQL statement to build recordset. $rs = $conn->Execute("SELECT * FROM TblInfo_News where IID = 3034326"); while (!$rs->EOF) { $fv = $rs->Fields("title"); echo "title: ".$fv->value."\n"; $rs->MoveNext(); } $rs->Close(); ?> PHP Mssql extension: "; } } else { echo "No results! "; } mssql_free_result($result); } else { echo "Could not get the result!"; } mssql_close($link); } else { echo "Could not select db!"; } } else { echo "Could not connect!"; } // mysql echo "MYSQL"; $link = mysql_connect("valencicm.mobitel.si", "root", "root") or die("Could not connect"); mysql_select_db("test"); $query = "SELECT * FROM tbl1"; $result = mysql_query($query); if($result) { $row = mysql_fetch_array($result); if($row) { echo "String: " . $row['fld1']; } mysql_free_result($result); } mysql_close($link); ?> -- Edit this bug report at http://bugs.php.net/?id=20166&edit=1
#21741 [Opn->Bgs]: strip_tags() reproducible error...
ID: 21741 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: Unknown/Other Function Operating System: Linux 2.4 PHP Version: 4.3.0 New Comment: See bug #21744 which reports the same problem but is more concise than this. To unify the report, let me mark this bogus. Previous Comments: [2003-01-19 01:27:34] [EMAIL PROTECTED] Function: strip_tags() Test input: http://66.28.101.38/shift.htm Unexpected result: The result string is cut off after a few sentences and ends with extraneous marks. Not all input would generate this error but most of the time with Microsoft Word created dirty documents as the test input above will demonstrate. Probably cause: Totally speculation but my guess is that there is a funk in the code in the string function dealing with UTF-8 characters common in Microsoft generated stuff. -- Edit this bug report at http://bugs.php.net/?id=21741&edit=1
#21744 [Opn->Ver]: strip_slashes misses exclamation marks in alt text
ID: 21744 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Verified Bug Type: Unknown/Other Function Operating System: Linux PHP Version: 4.3.0 -Assigned To: +Assigned To: moriyoshi New Comment: Verified with HEAD Previous Comments: [2003-01-19 04:58:46] [EMAIL PROTECTED] Tried the same using PHP 4.0.6 and did not get the problem: [admin@labworks ukshopsearch]$ php ') . "\n"; ?> X-Powered-By: PHP/4.0.6 Content-type: text/html [admin@labworks ukshopsearch]$ [2003-01-19 04:39:37] [EMAIL PROTECTED] The following code prints "!" (without the quotes): print strip_tags(''); I would expect it to print nothing. Same thing happens here: print strip_tags(''); Here is an example copied from the command line: [dan@192 v008]$ php ') . "\n"; ?> ! [dan@192 v008]$ -- Edit this bug report at http://bugs.php.net/?id=21744&edit=1
#21744 [Asn->Csd]: strip_tags misses exclamation marks in alt text
ID: 21744 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Assigned +Status: Closed Bug Type: Unknown/Other Function Operating System: Linux PHP Version: 4.3.0 Assigned To: rasmus New Comment: This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Previous Comments: [2003-01-19 05:13:20] [EMAIL PROTECTED] My fault. I'll fix it soonish. [2003-01-19 05:10:35] [EMAIL PROTECTED] Verified with HEAD [2003-01-19 04:58:46] [EMAIL PROTECTED] Tried the same using PHP 4.0.6 and did not get the problem: [admin@labworks ukshopsearch]$ php ') . "\n"; ?> X-Powered-By: PHP/4.0.6 Content-type: text/html [admin@labworks ukshopsearch]$ [2003-01-19 04:39:37] [EMAIL PROTECTED] The following code prints "!" (without the quotes): print strip_tags(''); I would expect it to print nothing. Same thing happens here: print strip_tags(''); Here is an example copied from the command line: [dan@192 v008]$ php ') . "\n"; ?> ! [dan@192 v008]$ -- Edit this bug report at http://bugs.php.net/?id=21744&edit=1
#21745 [Fbk->Ana]: in_array not function as intended...
ID: 21745 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Feedback +Status: Analyzed -Bug Type: Reproducible crash +Bug Type: Scripting Engine problem Operating System: windows95 PHP Version: 4.3.0 New Comment: This problem turned out to be a problem of the scripting engine, rather than of in_array(), that "global" declarations don't work in nested functions. Previous Comments: [2003-01-19 05:19:00] [EMAIL PROTECTED] oops It might be related that you have functions defined in functions. Can you try without this? Derick [2003-01-19 05:16:03] [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 [2003-01-19 05:14:29] [EMAIL PROTECTED] // functions within functions scope function a(){ $fruit[0] = 'apple'; $fruit[1] = 'orange'; function aa(){ global $fruit; (array) $fruit; echo in_array('apple', $fruit) ? 'ok' : 'fail'; } function ab(){ global $fruit; if(in_array('apple', array('apple', 'orange'))){ echo 'ok'; } else { echo 'fail'; } } } a(); aa(); // echo fail and Warning: in_array() [function.in-array]: Wrong datatype for second argument ab(); // echo ok // global scope $country = array('japan', 'korea'); echo in_array('japan', array('japan', 'korea')) ? 'japan - ok' : 'japan - fail'; // ok echo ''; echo in_array('japan', $country) ? 'japan -ok' : 'japan - fail'; // ok echo ''; // function scope function t(){ $country = array('Malaysia', 'Singapore'); echo in_array('Malaysia', $country) ? 'Malaysia -ok' : 'Malaysia - fail'; } t(); // ok /* wondering ? bug : bogus; looks like in_array() can't function well in functions within functions scope.. May Allah bless all of us!. sincerely, Jimson Chang */ [2003-01-19 04:53:35] [EMAIL PROTECTED] function a(){ $fruit[0] = 'apple'; $fruit[1] = 'orange'; function aa(){ global $fruit; (array) $fruit; echo in_array('apple', $fruit) ? 'ok' : 'fail'; } function ab(){ global $fruit; if(in_array('apple', array('apple', 'orange'))){ echo 'ok'; } else { echo 'fail'; } } } a(); aa(); // echo fail and Warning: in_array() [function.in-array]: Wrong datatype for second argument ab(); // echo ok /* wondering ? bug : bogus; May Allah bless all of us!. sincerely, Jimson Chang */ -- Edit this bug report at http://bugs.php.net/?id=21745&edit=1
#21745 [Ana->Bgs]: in_array not function as intended...
ID: 21745 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Analyzed +Status: Bogus Bug Type: Scripting Engine problem Operating System: windows95 PHP Version: 4.3.0 New Comment: Sorry, my assumption wasn't right at all. The error is because $fruit is not initialised in the global scope. Try the following: Previous Comments: [2003-01-19 05:54:40] [EMAIL PROTECTED] This problem turned out to be a problem of the scripting engine, rather than of in_array(), that "global" declarations don't work in nested functions. [2003-01-19 05:19:00] [EMAIL PROTECTED] oops It might be related that you have functions defined in functions. Can you try without this? Derick [2003-01-19 05:16:03] [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 [2003-01-19 05:14:29] [EMAIL PROTECTED] // functions within functions scope function a(){ $fruit[0] = 'apple'; $fruit[1] = 'orange'; function aa(){ global $fruit; (array) $fruit; echo in_array('apple', $fruit) ? 'ok' : 'fail'; } function ab(){ global $fruit; if(in_array('apple', array('apple', 'orange'))){ echo 'ok'; } else { echo 'fail'; } } } a(); aa(); // echo fail and Warning: in_array() [function.in-array]: Wrong datatype for second argument ab(); // echo ok // global scope $country = array('japan', 'korea'); echo in_array('japan', array('japan', 'korea')) ? 'japan - ok' : 'japan - fail'; // ok echo ''; echo in_array('japan', $country) ? 'japan -ok' : 'japan - fail'; // ok echo ''; // function scope function t(){ $country = array('Malaysia', 'Singapore'); echo in_array('Malaysia', $country) ? 'Malaysia -ok' : 'Malaysia - fail'; } t(); // ok /* wondering ? bug : bogus; looks like in_array() can't function well in functions within functions scope.. May Allah bless all of us!. sincerely, Jimson Chang */ [2003-01-19 04:53:35] [EMAIL PROTECTED] function a(){ $fruit[0] = 'apple'; $fruit[1] = 'orange'; function aa(){ global $fruit; (array) $fruit; echo in_array('apple', $fruit) ? 'ok' : 'fail'; } function ab(){ global $fruit; if(in_array('apple', array('apple', 'orange'))){ echo 'ok'; } else { echo 'fail'; } } } a(); aa(); // echo fail and Warning: in_array() [function.in-array]: Wrong datatype for second argument ab(); // echo ok /* wondering ? bug : bogus; May Allah bless all of us!. sincerely, Jimson Chang */ -- Edit this bug report at http://bugs.php.net/?id=21745&edit=1
#21745 [Bgs]: in_array not function as intended...
ID: 21745 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Bogus Bug Type: Scripting Engine problem Operating System: windows95 PHP Version: 4.3.0 New Comment: Well, it's just one of the current limitations of PHP, so it is possible that some solution for the issue will be announced in the future. Anyway I think you'd better off doing it object-oriented-wise in this case. And as for the term "bogus", whilst its usage in this bug database is often argued, please note that we don't always mean to be harsh on every report marked so. Thanks Moriyoshi Previous Comments: [2003-01-19 07:06:44] [EMAIL PROTECTED] function a($param=null){ $fruit[0] = 'apple'; $fruit[1] = 'orange'; switch($param){ case'R': return $fruit; break; default: function aa(){ $fruit = a('R'); echo in_array('apple', $fruit) ? 'ok' : 'fail'; } function ab(){ $fruit = a('R'); if(in_array('apple', array('apple', 'orange'))){ echo 'ok'; } else { echo 'fail'; } } } } a(); aa(); ab(); //aa(); // echo ok //ab(); // echo ok /* finally, it works like the way i want... :) wondering ? bug : bogus <= should change to 'less experience'; cause i using php less than 3 years... :) sorry. anyway, i learn that file a.php == function a(){ $a = 'php'; function ab(){ echo $a; // doesn't work } } i understand that global apple is the $GLOBALS['apple'] and i thought by using the global here, it would maybe means the scope of function a(). anyway, i am wrong about that.. you might be wondering why i created a function like this? em... this is to prevent the use of vars in the $GLOBALS scope why, because i am writing a secure application. if a people include a.php, then using the $GLOBALS, he can find out what value in the vars. anyway, i also think how to prevent people to include the a.php or calling a()... emm... maybe u people can help me next time... bogus = [adj] derog pretended; intentionally false: <= from dictionary. so u see, i am not intended to fool ur people... so the status shouldn't be bogus... i am learning and ur people are teaching... :) May Allah bless all of us!. sincerely, Jimson Chang */ [2003-01-19 06:10:20] [EMAIL PROTECTED] Sorry, my assumption wasn't right at all. The error is because $fruit is not initialised in the global scope. Try the following: [2003-01-19 05:54:40] [EMAIL PROTECTED] This problem turned out to be a problem of the scripting engine, rather than of in_array(), that "global" declarations don't work in nested functions. [2003-01-19 05:19:00] [EMAIL PROTECTED] oops It might be related that you have functions defined in functions. Can you try without this? Derick [2003-01-19 05:16:03] [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 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/21745 -- Edit this bug report at http://bugs.php.net/?id=21745&edit=1
#21707 [Opn->Fbk]: long html text sources truncated
ID: 21707 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Feedback Bug Type: Output Control Operating System: windows xp PHP Version: 4.3.0 New Comment: Which MPM model do you use in Apache2? (e.g. worker, prefork) I managed to reproduce this with "worker" model. Previous Comments: [2003-01-19 11:40:38] [EMAIL PROTECTED] i'm having the same problems, but i'm running php as an module instead of cgi module. Apache 2.0.43 on winXP PHP 4.2.4-dev Setting output_buffering to On fixed this bug. [2003-01-17 01:22:45] [EMAIL PROTECTED] For example: 174412 Chars --> 7957 Chars 82828 Chars --> 23906 Chars not consistent, running the 82828 char file a second time gave me 43596 chars [2003-01-17 00:51:16] [EMAIL PROTECTED] Truncated to how many characters and is it a consistent number? [2003-01-17 00:43:36] [EMAIL PROTECTED] Apache 2.0.43 running on Windows XP. Reproduced with PHP 4.3.0 running as CGI and as module. present with output_buffering = off not present with output_buffering = on A 10kb(approximately) or larger html/text file with a .php extension is truncated if output buffering is set to off. Turn output buffering on and the entire file is sent/displayed properly -- Edit this bug report at http://bugs.php.net/?id=21707&edit=1
#21707 [Fbk->Opn]: long html text sources truncated
ID: 21707 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Feedback +Status: Open Bug Type: Output Control Operating System: windows xp PHP Version: 4.3.0 New Comment: Oops, my previous comment is totally off the point. Please ignore. Previous Comments: [2003-01-19 12:43:15] [EMAIL PROTECTED] Which MPM model do you use in Apache2? (e.g. worker, prefork) I managed to reproduce this with "worker" model. [2003-01-19 11:40:38] [EMAIL PROTECTED] i'm having the same problems, but i'm running php as an module instead of cgi module. Apache 2.0.43 on winXP PHP 4.2.4-dev Setting output_buffering to On fixed this bug. [2003-01-17 01:22:45] [EMAIL PROTECTED] For example: 174412 Chars --> 7957 Chars 82828 Chars --> 23906 Chars not consistent, running the 82828 char file a second time gave me 43596 chars [2003-01-17 00:51:16] [EMAIL PROTECTED] Truncated to how many characters and is it a consistent number? [2003-01-17 00:43:36] [EMAIL PROTECTED] Apache 2.0.43 running on Windows XP. Reproduced with PHP 4.3.0 running as CGI and as module. present with output_buffering = off not present with output_buffering = on A 10kb(approximately) or larger html/text file with a .php extension is truncated if output buffering is set to off. Turn output buffering on and the entire file is sent/displayed properly -- Edit this bug report at http://bugs.php.net/?id=21707&edit=1
#21758 [Opn->Csd]: PCRE functions were screwed up
ID: 21758 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Closed Bug Type: PCRE related Operating System: Linux, Win32 PHP Version: 5CVS-2003-01-19 (dev) New Comment: This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Previous Comments: [2003-01-20 05:23:28] [EMAIL PROTECTED] Hi, have already pointed you to the patch that causes this. This has been working before the patch. I've no possibility to test it on Win32 (I've been told by Sebastian Bergmann that it does not work there too). As it has obviously nothing to do with ZE2, both (lastest PHP4-STABLE, and CVS "php5" module) perish on this. Please fix this as soon as possible. "php4-STABLE-200301201030" root@warpcore:/src/php4-STABLE-200301201030/sapi/cli> ./php -v PHP 4.3.1-dev (cli) (built: Jan 20 2003 12:13:11) Copyright (c) 1997-2003 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies root@warpcore:/src/php4-STABLE-200301201030/sapi/cli> ./php -i | head -13 phpinfo() PHP Version => 4.3.1-dev System => Linux warpcore 2.2.20 #10 Sun Nov 17 22:46:16 CET 2002 i686 Build Date => Jan 20 2003 12:09:35 Configure Command => './configure' '--enable-force-cgi-redirect' '--with-mysql=/usr/local/mysql' '--with-config-file-path=../conf' '--enable-trans-sid' Server API => Command Line Interface Virtual Directory Support => disabled Configuration File (php.ini) Path => ../conf PHP API => 20020918 PHP Extension => 20020429 Zend Extension => 20021010 Debug Build => no root@warpcore:/src/php4-STABLE-200301201030/sapi/cli> cat | ./php Warning: preg_replace_callback() [...]: Parameter mismatch, pattern is a string while replacement in an array. in - on line 11 -- "php5" CVS module: goosh@warpcore:/src/php5/sapi/cli> ./php -v PHP 5.0.0-dev (cli) (built: Jan 20 2003 11:49:51) Copyright (c) 1997-2003 The PHP Group Zend Engine v2.0.0-dev, Copyright (c) 1998-2003 Zend Technologies goosh@warpcore:/src/php5/sapi/cli> ./php -i | head -13 phpinfo() PHP Version => 5.0.0-dev System => Linux warpcore 2.2.20 #10 Sun Nov 17 22:46:16 CET 2002 i686 Build Date => Jan 20 2003 11:46:03 Configure Command => './configure' '--enable-force-cgi-redirect' '--with-mysql=/usr/local/mysql' '--with-config-file-path=../conf' '--enable-trans-sid' Server API => Command Line Interface Virtual Directory Support => disabled Configuration File (php.ini) Path => ../conf PHP API => 20020918 PHP Extension => 20020429 Zend Extension => 90021012 Debug Build => no goosh@warpcore:/src/php5/sapi/cli> cat | ./php Warning: preg_replace_callback() [...]: Parameter mismatch, pattern is a string while replacement in an array. in - on line 7 regards dtg [2003-01-20 00:29:46] [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 To see if it's ZE2 issue or not..and also, provide a complete, short and self-contained example script so that we can easily reproduce the problem ourselves. [2003-01-19 17:16:03] [EMAIL PROTECTED] Probably this patch screwed up preg_replace_* functions: http://lists.php.net/article.php?group=php.cvs&article=18024 I need the functionality to pass a callback _method_ to preg_replace_callback(). It worked usually like this (in a class): $s = preg_replace_callback(, array(&$this, 'callbackmethod'), $s); Now "array" is forbidden. Is this your intention? How to access callback methods then? regards dtg -- Edit this bug report at http://bugs.php.net/?id=21758&edit=1
#21777 [Opn->Fbk]: Libtool error and apache segmentation fault when load libphp4.so
ID: 21777 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Feedback Bug Type: Apache2 related Operating System: Aix 4.3.3 PHP Version: 4.3.0 New Comment: Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". Thank you for helping us make PHP better. And could you paste the result of the following command too? $ httpd -l Anyway don't forget to recheck the manual page: http://www.php.net/manual/en/install.apache2.php Previous Comments: [2003-01-20 10:47:36] [EMAIL PROTECTED] I have apache 2.0.43 working on Aix 4.3.3.10. When i try build php4-latest,4.3.0, 4.2.3 or 4.2.2 all go fine except, on make install process and if i continue, when apache load module libphp4.so doesn't start and show a segmentation fault error.I use gcc-3.2.1 and gnu.make. --- # setenv CC /usr/local/bin/gcc #./configure --enable-force-cgi-redirect \ --enable-static --disable-shared \ --with-mysql --with-apxs2=/usr/IBMIHS/bin/apxs \ --prefix=/usr/IBMIHS/php --with-config-file-path=/usr/IBMIHS/php Appear this error, although i continuous: creating main/internal_functions_cli.c ++ |*** WARNING *** | || | You chose to compile PHP with the built-in MySQL support. If you | | are compiling a server module, and intend to use other server | | modules that also use MySQL (e.g, mod_auth_mysql, PHP 3.0, | | mod_perl) you must NOT rely on PHP's built-in MySQL support, and | | instead build it with your local MySQL support files, by adding| | --with-mysql=/path/to/mysql to your configure line.| ++ | License: | | This software is subject to the PHP License, available in this | | distribution in the file LICENSE. By continuing this installation | | process, you are bound by the terms of this license agreement. | | If you do not agree with the terms of this license, you must abort | | the installation process at this point.| ++ | *** NOTE *** | |The default for register_globals is now OFF!| || | If your application relies on register_globals being ON, you | | should explicitly set it to on in your php.ini file. | | Note that you are strongly encouraged to read | | http://www.php.net/manual/en/security.registerglobals.php | | about the implications of having register_globals set to on, and | | avoid using it if possible.| ++ ./config.status[1814]: 6: bad file unit number ./config.status[1815]: 6: bad file unit number --- #make #make install Installing PHP SAPI module /usr/IBMIHS/build/instdso.sh SH_LIBTOOL='/usr/IBMIHS/build/libtool' libphp4.la /usr/IBMIHS/modules /usr/IBMIHS/build/libtool --mode=install cp libphp4.la /usr/IBMIHS/modules/ cp .libs/libphp4.a /usr/IBMIHS/modules/libphp4.a cp .libs/libphp4.lai /usr/IBMIHS/modules/libphp4.la libtool: install: warning: remember to run `libtool --finish /software2/php-4.3.0/libs' chmod 755 /usr/IBMIHS/modules/libphp4.so chmod: /usr/IBMIHS/modules/libphp4.so: Un archivo o directorio en la vía de acceso no existe. apxs:Error: Command failed with rc=65536 . make: 1254-004 El código de error del último mandato es 1. - At this point i cp .libs/libphp4.so /usr/IBMIHS/modules and i make install again. - #make install Installing PHP SAPI module /usr/IBMIHS/build/instdso.sh SH_LIBTOOL='/usr/IBMIHS/build/libtool' libphp4.la /usr/IBMIHS/modules /usr/IBMIHS/build/libtool --mode=install cp libphp4.la /usr/IBMIHS/modules/ cp .libs/libphp4.a /usr/IBMIHS/modules/libphp4.a cp .libs/libphp4.lai /usr/IBMIHS/modules/libphp4.la libtool: ins
#21775 [Opn->Bgs]: memory leak: emalloc(): Unable to alllocate 32 bytes
ID: 21775 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: Reproducible crash Operating System: SuSE Linux 7.3 PHP Version: 4.3.0 New Comment: PHP is designed to bail out (to stop executing) when the memory has been run out. So it's natural that the runtime end up segfaulting. Previous Comments: [2003-01-20 10:30:58] [EMAIL PROTECTED] The following code: <% class Object { var $prev; var $next; function unter (&$ref) { $ref->prev = &$this; $this->next = &$ref; } }; while (true) { print "NEW ROUND\n"; { $o = &new Object; for ($i = 0; $i < 1; ++$i) { $o->unter (new Object); $o = &$o->next; } unset ($o); } } %> consumes as much memory it can get. I would expect that PHP garbage-collects the memory. -- Edit this bug report at http://bugs.php.net/?id=21775&edit=1
#21441 [Csd]: POST-ed array repeats itself
ID: 21441 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Closed Bug Type: Apache2 related Operating System: RH 8.0 Apache 2.0 PHP Version: 4.2.2 New Comment: Excuse me, but this report is actually the dupe of bug #18648. Could you report the further info at that page? We're investigating this issue now. Moriyoshi Previous Comments: [2003-01-21 03:01:07] [EMAIL PROTECTED] The problem is that since then I upgraded to the latest CVS version (4.3.1-dev), and the problem still exists: Example: http://www.parbanszep.hu/aa.php Enter some text and submit. You will see what comes back. And the php source is: If I use GET instead of POST it seams to be OK. So this is not an array, but rather a POST related bug. Further info: http://www.parbanszep.hu/info.php [2003-01-21 02:50:22] [EMAIL PROTECTED] i use the current releas version -> 4.3.0 on redhat-8.0 with apache 2.0.43 and get the same error. - - input string>tralalala $HTTP_POST_VARS['szuk'] tralalalaszuk=tralalalala [2003-01-06 12:11:11] [EMAIL PROTECTED] Hi, i use the current releas version -> 4.3.0 on redhat-8.0 with apache 2.0.43 and get the same error. here is another example \$_POST "; print_r($_POST); echo "\n\$_GET "; print_r($_GET); echo ""; ?> chbox 1 chbox 2 chbox 3 chbox 4 chbox 5 output (all checkboxes selected): $_POST Array ( [chkTest] => Array ( [0] => chbox 1 [1] => chbox 2 [2] => chbox 3 [3] => chbox 4 [4] => chbox 5 [5] => chbox 2 [6] => chbox 3 [7] => chbox 4 [8] => chbox 5 ) [submit] => submit ) $_GET Array ( ) When I replace the POST wit GET it works fine. cya later /Stephan [2003-01-05 16:44:45] [EMAIL PROTECTED] Reclassified [2003-01-05 14:51:42] [EMAIL PROTECTED] Thank you for your bug report. This issue has already been fixed in the latest released version of PHP, which you can download at http://www.php.net/downloads.php 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/21441 -- Edit this bug report at http://bugs.php.net/?id=21441&edit=1
#21441 [Csd->Bgs]: POST-ed array repeats itself
ID: 21441 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Closed +Status: Bogus Bug Type: Apache2 related Operating System: RH 8.0 Apache 2.0 -PHP Version: 4.2.2 +PHP Version: 4CVS-2003-01-20 (stable) New Comment: To avoid confusions, let me mark this one as bogus. Thanks for you cooperation. Previous Comments: [2003-01-21 03:34:04] [EMAIL PROTECTED] Excuse me, but this report is actually the dupe of bug #18648. Could you report the further info at that page? We're investigating this issue now. Moriyoshi [2003-01-21 03:01:07] [EMAIL PROTECTED] The problem is that since then I upgraded to the latest CVS version (4.3.1-dev), and the problem still exists: Example: http://www.parbanszep.hu/aa.php Enter some text and submit. You will see what comes back. And the php source is: If I use GET instead of POST it seams to be OK. So this is not an array, but rather a POST related bug. Further info: http://www.parbanszep.hu/info.php [2003-01-21 02:50:22] [EMAIL PROTECTED] i use the current releas version -> 4.3.0 on redhat-8.0 with apache 2.0.43 and get the same error. - - input string>tralalala $HTTP_POST_VARS['szuk'] tralalalaszuk=tralalalala [2003-01-06 12:11:11] [EMAIL PROTECTED] Hi, i use the current releas version -> 4.3.0 on redhat-8.0 with apache 2.0.43 and get the same error. here is another example \$_POST "; print_r($_POST); echo "\n\$_GET "; print_r($_GET); echo ""; ?> chbox 1 chbox 2 chbox 3 chbox 4 chbox 5 output (all checkboxes selected): $_POST Array ( [chkTest] => Array ( [0] => chbox 1 [1] => chbox 2 [2] => chbox 3 [3] => chbox 4 [4] => chbox 5 [5] => chbox 2 [6] => chbox 3 [7] => chbox 4 [8] => chbox 5 ) [submit] => submit ) $_GET Array ( ) When I replace the POST wit GET it works fine. cya later /Stephan [2003-01-05 16:44:45] [EMAIL PROTECTED] Reclassified 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/21441 -- Edit this bug report at http://bugs.php.net/?id=21441&edit=1
#21775 [Opn]: memory leak: emalloc(): Unable to alllocate 32 bytes
ID: 21775 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Reproducible crash Operating System: SuSE Linux 7.3 PHP Version: 4.3.0 New Comment: Sorry, my bad. I missed "unset" statement. As for the memory-limit problem it was a bug indeed. See bug #20802. Previous Comments: [2003-01-21 06:03:28] [EMAIL PROTECTED] my http process rund out of memory after it blowed up to 320 MB (have 256 MB RAM). in php.ini memory_limit = 8M. IMHO this is not bogus! [2003-01-20 11:38:05] [EMAIL PROTECTED] PHP does not reclaim any memory no longer referenced? No garbage collection? [2003-01-20 11:12:37] [EMAIL PROTECTED] PHP is designed to bail out (to stop executing) when the memory has been run out. So it's natural that the runtime end up segfaulting. [2003-01-20 10:30:58] [EMAIL PROTECTED] The following code: <% class Object { var $prev; var $next; function unter (&$ref) { $ref->prev = &$this; $this->next = &$ref; } }; while (true) { print "NEW ROUND\n"; { $o = &new Object; for ($i = 0; $i < 1; ++$i) { $o->unter (new Object); $o = &$o->next; } unset ($o); } } %> consumes as much memory it can get. I would expect that PHP garbage-collects the memory. -- Edit this bug report at http://bugs.php.net/?id=21775&edit=1
#21775 [Fbk]: memory leak: emalloc(): Unable to alllocate 32 bytes
ID: 21775 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Feedback Bug Type: Reproducible crash Operating System: SuSE Linux 7.3 PHP Version: 4.3.0 New Comment: The PHP scripting engine (ZendEngine) doesn't perform conservative GC, and any referenced object are marked as alive. Therefore there are some cases where the objects such as mutually-referenced ones remains undestroyed even though they are unreachable from the root set of variables. Your bi-directional linked list example is just one of such cases. Previous Comments: [2003-01-21 08:26:23] [EMAIL PROTECTED] The memory limit option will not take effect unless you've compiled your PHP with --enable-memory-limit. [2003-01-21 07:26:32] [EMAIL PROTECTED] Sorry, my bad. I missed "unset" statement. As for the memory-limit problem it was a bug indeed. See bug #20802. [2003-01-21 06:03:28] [EMAIL PROTECTED] my http process rund out of memory after it blowed up to 320 MB (have 256 MB RAM). in php.ini memory_limit = 8M. IMHO this is not bogus! [2003-01-20 11:38:05] [EMAIL PROTECTED] PHP does not reclaim any memory no longer referenced? No garbage collection? [2003-01-20 11:12:37] [EMAIL PROTECTED] PHP is designed to bail out (to stop executing) when the memory has been run out. So it's natural that the runtime end up segfaulting. 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/21775 -- Edit this bug report at http://bugs.php.net/?id=21775&edit=1
#21800 [Opn->Ver]: Segfault in CLI
ID: 21800 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Verified Bug Type: Reproducible crash Operating System: RH 8.0 PHP Version: 5CVS-2003-01-21 (dev) New Comment: verified Previous Comments: [2003-01-21 12:36:38] [EMAIL PROTECTED] the following produces a coredump: root@numenor-19:30 [~]:php -ea Interactive mode enabled Segmentation fault (core dumped) Backtrace gives (gdb) bt #0 0x in ?? () #1 0x081f3a4f in execute (op_array=0x0) at /usr/local/src/cvs/php5/Zend/zend_execute.c:1218 #2 0x081d78b9 in execute_new_code () at /usr/local/src/cvs/php5/Zend/zend_execute_API.c:827 #3 0x081be693 in zendparse () at /usr/local/src/cvs/php5/Zend/zend_language_parser.y:148 #4 0x081c272d in compile_file (file_handle=0xb930, type=2) at /usr/local/src/cvs/php5/Zend/zend_language_scanner.l:297 #5 0x081e14ad in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/local/src/cvs/php5/Zend/zend.c:992 #6 0x081a84c7 in php_execute_script (primary_file=0xb930) at /usr/local/src/cvs/php5/main/main.c:1691 #7 0x0820966f in main (argc=2, argv=0xb9c4) at /usr/local/src/cvs/php5/sapi/cli/php_cli.c:753 #8 0x420158d4 in __libc_start_main () from /lib/i686/libc.so.6 -- Edit this bug report at http://bugs.php.net/?id=21800&edit=1
#21800 [Ver]: Segfault in CLI
ID: 21800 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Verified -Bug Type: Reproducible crash +Bug Type: Zend Engine 2 problem Operating System: RH 8.0 PHP Version: 5CVS-2003-01-21 (dev) New Comment: not reproduced with ZE1 => reclassfying as ZE2 problem Previous Comments: [2003-01-21 12:45:08] [EMAIL PROTECTED] verified [2003-01-21 12:36:38] [EMAIL PROTECTED] the following produces a coredump: root@numenor-19:30 [~]:php -ea Interactive mode enabled Segmentation fault (core dumped) Backtrace gives (gdb) bt #0 0x in ?? () #1 0x081f3a4f in execute (op_array=0x0) at /usr/local/src/cvs/php5/Zend/zend_execute.c:1218 #2 0x081d78b9 in execute_new_code () at /usr/local/src/cvs/php5/Zend/zend_execute_API.c:827 #3 0x081be693 in zendparse () at /usr/local/src/cvs/php5/Zend/zend_language_parser.y:148 #4 0x081c272d in compile_file (file_handle=0xb930, type=2) at /usr/local/src/cvs/php5/Zend/zend_language_scanner.l:297 #5 0x081e14ad in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/local/src/cvs/php5/Zend/zend.c:992 #6 0x081a84c7 in php_execute_script (primary_file=0xb930) at /usr/local/src/cvs/php5/main/main.c:1691 #7 0x0820966f in main (argc=2, argv=0xb9c4) at /usr/local/src/cvs/php5/sapi/cli/php_cli.c:753 #8 0x420158d4 in __libc_start_main () from /lib/i686/libc.so.6 -- Edit this bug report at http://bugs.php.net/?id=21800&edit=1
#21812 [Opn->Fbk]: Apache crashes when require_once has array in directory name
ID: 21812 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Feedback Bug Type: Reproducible crash Operating System: Win2000 PHP Version: 4.3.0 New Comment: Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". Thank you for helping us make PHP better. Previous Comments: [2003-01-21 19:03:46] [EMAIL PROTECTED] I had $common = 'common/'; at the top of the script and require_once($common . 'x.html'); in the middle of the script and it worked. Later I accidentally set $common to a multidimentinal array prior to it's use in require_once. Apache 2.0.43 crashed when I used the script. PHP did not produce an error message. Apache is not producing any other errors. Everything else in my scripts work including Sablotron. 4.3.0 is stable with Apache 2 on both my NT and Win2000 systems. I have not tried this script error on Apache 1. A search of the bug database found some old entries from the year 2000 marked "Fixed in CVS" so I guess they are not refering to PHP 4.3.0. The Apache log contained the following entry. The status code of 3221225477 is listed on web pages against a dozen different errors. [Wed Jan 22 11:31:36 2003] [notice] Parent: Created child process 2128 [Wed Jan 22 11:31:36 2003] [notice] Child 2128: Child process is running [Wed Jan 22 11:31:36 2003] [notice] Child 2128: Acquired the start mutex. [Wed Jan 22 11:31:36 2003] [notice] Child 2128: Starting 250 worker threads. [Wed Jan 22 11:32:02 2003] [notice] Parent: child process exited with status 3221225477 -- Restarting. -- Edit this bug report at http://bugs.php.net/?id=21812&edit=1
#21812 [Opn]: Apache crashes when require_once has array in directory name
ID: 21812 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Reproducible crash Operating System: Win2000 PHP Version: 4.3.0 New Comment: Sorry, I just mistook the platform is *nix. As I can't reproduce this on my Linux box, this problem is likely to be Windows specific. Does Apache segfault when giving a non-existent file name to require_once() rather than an array? Previous Comments: [2003-01-21 19:24:28] [EMAIL PROTECTED] I looked at the instructions for backtrace. They do not translate to Win2000. I will install Cygwin and see if the instructions work with Win2000 Cygwin. Our Unix systems have old releases of PHP and Apache so it might be a while before I can reproduce the test on Unix. [2003-01-21 19:10:21] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". Thank you for helping us make PHP better. [2003-01-21 19:03:46] [EMAIL PROTECTED] I had $common = 'common/'; at the top of the script and require_once($common . 'x.html'); in the middle of the script and it worked. Later I accidentally set $common to a multidimentinal array prior to it's use in require_once. Apache 2.0.43 crashed when I used the script. PHP did not produce an error message. Apache is not producing any other errors. Everything else in my scripts work including Sablotron. 4.3.0 is stable with Apache 2 on both my NT and Win2000 systems. I have not tried this script error on Apache 1. A search of the bug database found some old entries from the year 2000 marked "Fixed in CVS" so I guess they are not refering to PHP 4.3.0. The Apache log contained the following entry. The status code of 3221225477 is listed on web pages against a dozen different errors. [Wed Jan 22 11:31:36 2003] [notice] Parent: Created child process 2128 [Wed Jan 22 11:31:36 2003] [notice] Child 2128: Child process is running [Wed Jan 22 11:31:36 2003] [notice] Child 2128: Acquired the start mutex. [Wed Jan 22 11:31:36 2003] [notice] Child 2128: Starting 250 worker threads. [Wed Jan 22 11:32:02 2003] [notice] Parent: child process exited with status 3221225477 -- Restarting. -- Edit this bug report at http://bugs.php.net/?id=21812&edit=1
#21812 [Opn->Fbk]: Apache crashes when require_once has array in directory name
ID: 21812 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Feedback Bug Type: Reproducible crash Operating System: Win2000 PHP Version: 4.3.0 Previous Comments: [2003-01-21 19:38:21] [EMAIL PROTECTED] Sorry, I just mistook the platform is *nix. As I can't reproduce this on my Linux box, this problem is likely to be Windows specific. Does Apache segfault when giving a non-existent file name to require_once() rather than an array? [2003-01-21 19:24:28] [EMAIL PROTECTED] I looked at the instructions for backtrace. They do not translate to Win2000. I will install Cygwin and see if the instructions work with Win2000 Cygwin. Our Unix systems have old releases of PHP and Apache so it might be a while before I can reproduce the test on Unix. [2003-01-21 19:10:21] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". Thank you for helping us make PHP better. [2003-01-21 19:03:46] [EMAIL PROTECTED] I had $common = 'common/'; at the top of the script and require_once($common . 'x.html'); in the middle of the script and it worked. Later I accidentally set $common to a multidimentinal array prior to it's use in require_once. Apache 2.0.43 crashed when I used the script. PHP did not produce an error message. Apache is not producing any other errors. Everything else in my scripts work including Sablotron. 4.3.0 is stable with Apache 2 on both my NT and Win2000 systems. I have not tried this script error on Apache 1. A search of the bug database found some old entries from the year 2000 marked "Fixed in CVS" so I guess they are not refering to PHP 4.3.0. The Apache log contained the following entry. The status code of 3221225477 is listed on web pages against a dozen different errors. [Wed Jan 22 11:31:36 2003] [notice] Parent: Created child process 2128 [Wed Jan 22 11:31:36 2003] [notice] Child 2128: Child process is running [Wed Jan 22 11:31:36 2003] [notice] Child 2128: Acquired the start mutex. [Wed Jan 22 11:31:36 2003] [notice] Child 2128: Starting 250 worker threads. [Wed Jan 22 11:32:02 2003] [notice] Parent: child process exited with status 3221225477 -- Restarting. -- Edit this bug report at http://bugs.php.net/?id=21812&edit=1
#21812 [Opn->Fbk]: Apache crashes when require_once has array in directory name
ID: 21812 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Feedback Bug Type: Reproducible crash Operating System: Win2000 PHP Version: 4.3.0 New Comment: Has the change on memory_limit entry solved the require_once problem too? Previous Comments: [2003-01-21 21:27:16] [EMAIL PROTECTED] memory_limit = 80M in php.ini fixed the XML process error. It can now read the full XML file without blowing up Apache. [2003-01-21 21:07:24] [EMAIL PROTECTED] I found a new error causing the same error message from Apache 2. This error is from an XML processing loop. I think the Apache 2 error message must be issued any time Apache runs out of memory. Perhaps PHP is trampling over the end of it's memory allocation or something similar. I will try a few more tests then increase PHP's memory allocation in php.ini and see if that fixes the problem. [2003-01-21 20:26:06] [EMAIL PROTECTED] require_once(); Parse error: parse error, unexpected ')' in C:\webapps\display.php on line 10 require_once(''); Fatal error: main() [function.main]: Failed opening required '' (include_path='.;c:/include;c:/') in C:\webapps\display.php on line 10 require_once('cc'); Warning: main(cc) [function.main]: failed to create stream: No such file or directory in C:\webapps\display.php on line 10 Fatal error: main() [function.main]: Failed opening required 'cc' (include_path='.;c:/include;c:/') in C:\webapps\display.php on line 10 require_once(array('cc')); Notice: Array to string conversion in C:\webapps\display.php on line 10 Warning: main(Array) [function.main]: failed to create stream: No such file or directory in C:\webapps\display.php on line 10 Fatal error: main() [function.main]: Failed opening required 'Array' (include_path='.;c:/include;c:/') in C:\webapps\display.php on line 10 The error does not occur when require_once() receives a simple non string. The error occured when the non string was an array of varied elements including other arrays and possibly objects. The error occured repeatedly until I found the offending assignment statement. I tried to reproduce the error on the first require_once in the script but did not succeed. The original error was deep in a script with several requires and some requires including scripts containing requires. I have now changed the script to a less complicated set of requires and may not be able to reproduce the depth. It is possible the crash was caused by the requires looping on themselves but that type of error usually requires a second or two before Apache runs out of memory (currently over 500 Mb free). The crashes were instant. php.ini has nothing set to increase available memory or change safe mode or anything else. It runs as a module. [2003-01-21 19:38:21] [EMAIL PROTECTED] Sorry, I just mistook the platform is *nix. As I can't reproduce this on my Linux box, this problem is likely to be Windows specific. Does Apache segfault when giving a non-existent file name to require_once() rather than an array? [2003-01-21 19:24:28] [EMAIL PROTECTED] I looked at the instructions for backtrace. They do not translate to Win2000. I will install Cygwin and see if the instructions work with Win2000 Cygwin. Our Unix systems have old releases of PHP and Apache so it might be a while before I can reproduce the test on Unix. 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/21812 -- Edit this bug report at http://bugs.php.net/?id=21812&edit=1
#21812 [Opn->Csd]: Apache crashes when require_once has array in directory name
ID: 21812 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Closed Bug Type: Reproducible crash Operating System: Win2000 PHP Version: 4.3.0 New Comment: Then closing this report... If the same problem occurs again, please let us know via this page. Thanks. Previous Comments: [2003-01-22 22:40:05] [EMAIL PROTECTED] http://snaps.php.net/win32/php4-win32-STABLE-latest.zip 20020123 is working with just the default memory under Apache 2.0.44. Including stacks of files, using Expat, XML, and creating gazillions of objects. No errors so far. [2003-01-22 21:55:40] [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 There was some memorylimit crash fixed recently so please try the snapshot. Anyway, about apache2..it's REALLY not ready for production at ALL, especially with PHP. Apache 1.3.27 is the best choice. [2003-01-22 21:53:00] [EMAIL PROTECTED] When I opened the error report, I did not know the error could be deferred by adding more memory. Now that I know the extra memory defers the problem, I can allocate extra memory. Allocating extra memory might not be practical for all people especially those with hosted sites where the ISP restricts php.ini changes. Crashing Apache is also bad form. I know Apache 2 is considered new. Anything newer than Apache release 1.0.1 is too new for some people. A lot of people now use Apache 2 on production servers and PHP 4.3.0 must be bullet proof in that environment by now. I will upgrade to Apache 2.0.44 then test using just 8 Mb and see if the problem occurs. If someone out there knows of compatibility and stability issues with Apache 2, they might like to suggest the best release for use with PHP 4.3.0. I have downloads 2.0.39, 2.0.43, and 2.0.44. [2003-01-22 21:35:00] [EMAIL PROTECTED] So what's the bug here? If you run out of memory, how can that be a PHP bug? :) [2003-01-22 17:44:35] [EMAIL PROTECTED] The require_once error has not occurred when using 80Mb. The original require structure ended up including every component in the system. I added a few if statements to include only those components required for the script. The original mess might have used up the default 8Mb of memory. My clean version probably uses less than 1 Mb for my code. I am using the PHP binary compiled with all options. I think that comes to about 4 Mb. If that 4 Mb is loaded in to the default 8Mb when running PHP as a module then my original code would have easily used the remaining 4 Mb. Changing the allocation to 80Mb may have, in effect, increased available memory from 4 Mb to 76 Mb. 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/21812 -- Edit this bug report at http://bugs.php.net/?id=21812&edit=1
#21868 [Opn->Bgs]: include()/require() bug
ID: 21868 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: Unknown/Other Function Operating System: Windoze PHP Version: 4.2.1 New Comment: 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 You should use "global" declarations when you want to use global variables in the functions. Previous Comments: [2003-01-24 15:57:30] [EMAIL PROTECTED] A BIG ATTENTION! let`s say that we have this 2 files include.php & test.php: include.php and now test.php: ";} else {echo "bang foo is not set if called from function";} } do_test(); if ($foo) {echo "foo is set if called from main";} else {echo "bang foo is not set if called from main";} Result of the program is: bang foo is not set if called from function. foo is set if called from main Bug? Server: Apache/1.3.26 (Win32) PHP/4.2.3 -- Edit this bug report at http://bugs.php.net/?id=21868&edit=1
#21944 [Opn->Ver]: zlib compressed pages can be flushed causing compressed output to be displayed
ID: 21944 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Verified Bug Type: Zlib Related Operating System: win NT 4.0 PHP Version: 4.3.0 New Comment: I noticed this issue before the release of 4.3.0. A kind of Apache2 oddity. Should be fixed. Previous Comments: [2003-01-29 10:48:20] [EMAIL PROTECTED] This is a problem with IE 6.0.26 as well as Netscape Navigator 4.08. [2003-01-29 09:50:50] [EMAIL PROTECTED] This is with apache2 2.0.44 on Win NT If zlib.output_compression = On in the php.ini, and a flush() statement is sent on a PHP page, the compressed output will be displayed in the browser, or the user will be asked to "download" the file. If you do download this file, all you would see is the compressed output. I've never seen this behavior in previous versions of PHP, it's quite possible that this behavior is by design (it does exactly what you tell it to, it flushes its output, but the results are unexpected.) Removing the flush() statements or setting zlib.output_compression = Off are possible solutions until a fix (if any) is made. -- Edit this bug report at http://bugs.php.net/?id=21944&edit=1
#18648 [Opn]: Single entry form POST gives incorrect variable content
ID: 18648 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Apache2 related Operating System: All PHP Version: 4CVS-2003-01-20 (stable) / 5.0.0-dev (date unknown)(dev) New Comment: I'm not sure, but I guess this problem is caused by the bug gy Apache2 filter code. Is there anyone who found some strange entries that begin with "* BUG *" in the error logs when running the server with the latest snapshot of PHP? Previous Comments: [2003-01-29 10:01:27] [EMAIL PROTECTED] when you post raw data it gets duplicated too, but it's not constant: on two hosts with rh8/4.2.2 (and 4.3.0 tested as well) only one seems to do the duplication. The one that duplicates has an up2dated httpd, so apache version might have something to do with it. [2003-01-21 04:20:48] [EMAIL PROTECTED] Same problem with the latest version of PHP (4.3.1-dev). The hidden variable helps, but sometimes the variables get corrupted this way, too. So this is not a reliable solution at all. apache 2. [2003-01-20 20:24:03] [EMAIL PROTECTED] It works fine with [2003-01-20 12:44:48] [EMAIL PROTECTED] and for some reason, that at the moment escapes me completely, the thing worked for me too. [2003-01-20 12:40:58] [EMAIL PROTECTED] apache 2 / PHP 4.3.0 it seems on my system that if you fill in a field and hit RETURN you get the bug, however if you use a submit button instead it works normally. 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/18648 -- Edit this bug report at http://bugs.php.net/?id=18648&edit=1
#18648 [Opn]: Single entry form POST gives incorrect variable content
ID: 18648 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Apache2 related Operating System: All -PHP Version: 4CVS-2003-01-20 (stable) / 5.0.0-dev (date unknown)(dev) +PHP Version: tCVS-2003-01-29 (stable) / 5.0.0-dev (date unknown)(dev) New Comment: [EMAIL PROTECTED], Thank you for the info! Okay, updating version. Previous Comments: [2003-01-30 03:46:38] [EMAIL PROTECTED] Not a single 'BUG' entry on the logs, grep'ed all of them. [2003-01-30 03:45:41] [EMAIL PROTECTED] Tested today with snapshot 5-200301291430: post duplication bug continues. I believe the bug is really a matter of duplication of the post: simple vars are overriden, arrays get duplicated, raw data gets duplicated. [2003-01-30 03:25:04] [EMAIL PROTECTED] I'm not sure, but I guess this problem is caused by the bug gy Apache2 filter code. Is there anyone who found some strange entries that begin with "* BUG *" in the error logs when running the server with the latest snapshot of PHP? [2003-01-29 10:01:27] [EMAIL PROTECTED] when you post raw data it gets duplicated too, but it's not constant: on two hosts with rh8/4.2.2 (and 4.3.0 tested as well) only one seems to do the duplication. The one that duplicates has an up2dated httpd, so apache version might have something to do with it. [2003-01-21 04:20:48] [EMAIL PROTECTED] Same problem with the latest version of PHP (4.3.1-dev). The hidden variable helps, but sometimes the variables get corrupted this way, too. So this is not a reliable solution at all. apache 2. 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/18648 -- Edit this bug report at http://bugs.php.net/?id=18648&edit=1
#21983 [Opn->Fbk]: Php SegFault
ID: 21983 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Feedback Bug Type: Reproducible crash Operating System: linux PHP Version: 4.3.0 New Comment: Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". Thank you for helping us make PHP better. Previous Comments: [2003-01-31 08:37:20] [EMAIL PROTECTED] $php file.php Segmentation fault $ ---file.php--- dom=& $dom; $this->basename=$basename; $this->network=$network; $this->proxy=$proxy; } function &write_xml () { $this->e_zactivbox=$this->dom->create_element('zactivbox'); $this->e_zactivbox->set_attribute('basename', $this->basename); $this->e_zactivbox->append_child($network); $this->e_zactivbox->append_child($proxy); return $this->e_zactivbox; } } class network { var $servers; //array of server var $route; var $resolver; var $dom; var $e_network; function network (&$dom, $servers, $route, $resolver) { $this->dom=& $dom; $this->servers=$servers; $this->route=$route; $this->resolver=$resolver; } function &write_xml() { $this->e_network=$this->dom->create_element('network'); foreach($this->servers as $key => $server) { $this->e_network->append_child($server); } $this->e_network->append_child($this->route); $this->e_network->append_child($this->resolver); return $this->e_network; } } class resolver { var $domain; var $search; var $nameserver; var $dom; var $e_resolver; function resolver (&$dom, $nameserver, $domain='', $search='') { $this->dom=& $dom; $this->domain=$domain; $this->search=$search; $this->nameserver=$nameserver; } function &write_xml() { $this->e_resolver=$this->dom->create_element('resolver'); $e_domain=$this->dom->create_element('domain'); $t_domain=$this->dom->create_text_node($this->domain); $e_domain->append_child($t_domain); $this->e_resolver->append_child($e_domain); $e_search=$this->dom->create_element('search'); $t_search=$this->dom->create_text_node($this->search); $e_search->append_child($t_search); $this->e_resolver->append_child($e_search); $t_nameserver=$this->dom->create_text_node($this->nameserver); $e_nameserver=$this->dom->create_element('nameserver'); $e_nameserver->append_child($t_nameserver); $this->e_resolver->append_child($e_nameserver); return $this->e_resolver; } } class route { var $destination; var $iface; var $ip; var $dom; var $e_route; function route (&$dom, $destination, $ip, $iface) { $this->dom=& $dom; $this->destination=$destination; $this->ip=$ip; $this->iface=$iface; } function &write_xml() { $this->e_route=$this->dom->create_element('route'); $this->e_route->set_attribute('destination', $this->destination); $e_iface=$this->dom->create_element('iface'); $t_iface=$this->dom->create_text_node($this->iface); $e_iface->append_child($t_iface); $this->e_route->append_child($e_iface); $e_ip=$this->dom->create_element('ip'); $t_ip=$this->dom->create_text_node($this->ip); $e_ip->append_child($t_ip); $this->e_route->append_child($e_ip); return $this->e_route; } } class interface { var $iface; var $ip; var $broadcast; var $netmask; var $mode; var $position; var $type; var $dom; var $e_interface; function &interface (&$dom, $iface, $ip, $broadcast, $netmask, $mode='', $position='', $type=
#21600 [Ctl]: assign by reference function call changes variable contents
ID: 21600 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Critical Bug Type: Scripting Engine problem Operating System: Redhat 7.3, 8 PHP Version: 4.3.0, 5.0.0 New Comment: I noticed this issue has something to do with the version of bison used in a build. Below is just my assumption: 1.28 => works 1.35 => works 1.75 => doesn't work 1.875 => ??? Previous Comments: [2003-01-23 16:44:49] [EMAIL PROTECTED] Here is a simular problem - it seem to be a problem with referencing to values from functions that not themselfs return reference. name = $name; $wiefewfjwefjwefwef =& $this->getName(); // <-- this line destroys $this->name and eventually crashes apache+php } function /*&*/ getName() { return $this->name; } } $kent =& new Person('Kent'); echo ''; print_r($kent); echo ''; echo 'PersonName: "' . $kent->getName() . '"'; ?> [2003-01-14 00:52:07] [EMAIL PROTECTED] update version [2003-01-13 19:42:44] [EMAIL PROTECTED] I'm marking this critical because the provided script works fine on the previous released versions. [2003-01-13 01:21:08] [EMAIL PROTECTED] backtrace (with php-5.0.0-dev): #0 0x40749e49 in __sbrk (increment=1515880448) at ../sysdeps/generic/sbrk.c:33 #1 0x406e9d3c in __default_morecore (increment=1515880448) at ../sysdeps/generic/morecore.c:47 #2 0x406e676d in chunk_alloc (ar_ptr=0x40798520, nb=1515878480) at malloc.c:2583 #3 0x406e60bc in __libc_malloc (bytes=1515878476) at malloc.c:2817 #4 0x08256b63 in zend_mm_add_memory_block (heap=0x8333748, block_size=1515878476) at /dat/dev/php/php-5.0.0dev/Zend/zend_mm.c:143 #5 0x08256de6 in zend_mm_alloc (heap=0x8333748, size=1515878448) at /dat/dev/php/php-5.0.0dev/Zend/zend_mm.c:236 #6 0x08256e0e in zend_mm_alloc (heap=0x8333748, size=1515878448) at /dat/dev/php/php-5.0.0dev/Zend/zend_mm.c:240 #7 0x08256e0e in zend_mm_alloc (heap=0x8333748, size=1515878448) at /dat/dev/php/php-5.0.0dev/Zend/zend_mm.c:240 #8 0x08256e0e in zend_mm_alloc (heap=0x8333748, size=1515878448) at /dat/dev/php/php-5.0.0dev/Zend/zend_mm.c:240 #9 0x08256e0e in zend_mm_alloc (heap=0x8333748, size=1515878448) at /dat/dev/php/php-5.0.0dev/Zend/zend_mm.c:240 #10 0x08256e0e in zend_mm_alloc (heap=0x8333748, size=1515878448) at /dat/dev/php/php-5.0.0dev/Zend/zend_mm.c:240 #11 0x08256e0e in zend_mm_alloc (heap=0x8333748, size=1515878448) at /dat/dev/php/php-5.0.0dev/Zend/zend_mm.c:240 #12 0x08256e0e in zend_mm_alloc (heap=0x8333748, size=1515878448) (last frame continues atleast 15.000 times) Derick [2003-01-12 15:56:50] [EMAIL PROTECTED] Verified with HEAD(ZE2) and PHP_4_3(ZE1). The provided script causes segmentation fault. 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/21600 -- Edit this bug report at http://bugs.php.net/?id=21600&edit=1
#21985 [Opn->Ver]: mb_send_mail() doesn't encode the message body into MIME base64
ID: 21985 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Verified Bug Type: mbstring related Operating System: Windows 2000 PHP Version: 4.3.0 New Comment: Thanks for the report. Changing status [Open => Verified] Previous Comments: [2003-01-31 11:36:44] [EMAIL PROTECTED] I'm trying to send a UTF-8 encoded e-mail using mb_send_mail() under PHP 4.3.0 with the MBString extension. mb_send_mail() adds the following lines to the e-mail header: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: BASE64 But it doesn't encode the message body into MIME base64 and I'm forced to use mb_send_mail($address, $subject, chunk_split(base64_encode($msg)), $extra_headers); instead of mb_send_mail($address, $subject, $msg, $extra_headers); -- Edit this bug report at http://bugs.php.net/?id=21985&edit=1
#21952 [Opn->Fbk]: php kills apache by inclusion
ID: 21952 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Feedback Bug Type: Apache2 related Operating System: Windows 2000 PHP Version: 4.3.0 New Comment: 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 Previous Comments: [2003-01-29 14:44:09] [EMAIL PROTECTED] if I have a php-file in my htaccess folder, that include an php-file in another folder, i.e. in the pear-directory, which include a php-file with the same name of the first file, and if a second file with this name is in the "pear"folder, then apache crashes. For example: I create a file calls cache.php in my htaccess-folder and then I include one of the files of the pear output-cache files, that include the file cache.php, who is into the pear/cache-folder. Then apache crashes. -- Edit this bug report at http://bugs.php.net/?id=21952&edit=1
#21961 [Opn->Ver]: get_parent_class segfault
ID: 21961 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Verified Bug Type: Zend Engine 2 problem Operating System: FreeBSD 4.7 PHP Version: 5CVS-2003-01-30 (dev) New Comment: Verified. BTW how come "bar" extends "man"? Previous Comments: [2003-01-30 08:03:07] [EMAIL PROTECTED] Additionals: Apache 1.3.27-mod_ssl Script to reproduce: name = 'Mr. X'; $this->bars = array(); } function getdrunk($where) { $this->bars[] = new bar($where); } function getName() { return $this->name; } } class bar extends man { var $name; function bar($w) { $this->name = $w; } function getName() { return $this->name; } function whosdrunk() { $who = get_parent_class($this); if($who == NULL) { return 'nobody'; } return eval($who.'::getName()'); } } $x = new man; $x->getdrunk('The old Tavern'); $x->bars[0]->whosdrunk(); ?> Backtrace: Program received signal SIGSEGV, Segmentation fault. 0x28586642 in zif_get_parent_class (ht=1, return_value=0x8104858, this_ptr=0x0, return_value_used=1) at /home/mdev/cvs/php5/Zend/zend_builtin_functions.c:563 563 name = ce->name; #0 0x28586642 in zif_get_parent_class (ht=1, return_value=0x8104858, this_ptr=0x0, return_value_used=1) at /home/mdev/cvs/php5/Zend/zend_builtin_functions.c:563 #1 0x28594f5b in zend_do_fcall_common_helper (execute_data=0xbfbfe0bc, op_array=0x8106850) at /home/mdev/cvs/php5/Zend/zend_execute.c:2620 #2 0x285956a5 in zend_do_fcall_handler (execute_data=0xbfbfe0bc, op_array=0x8106850) at /home/mdev/cvs/php5/Zend/zend_execute.c:2748 #3 0x2858f5c7 in execute (op_array=0x8106850) at /home/mdev/cvs/php5/Zend/zend_execute.c:1227 #4 0x28595158 in zend_do_fcall_common_helper (execute_data=0xbfbfe39c, op_array=0x810388c) at /home/mdev/cvs/php5/Zend/zend_execute.c:2654 #5 0x28595577 in zend_do_fcall_by_name_handler (execute_data=0xbfbfe39c, op_array=0x810388c) at /home/mdev/cvs/php5/Zend/zend_execute.c:2718 #6 0x2858f5c7 in execute (op_array=0x810388c) at /home/mdev/cvs/php5/Zend/zend_execute.c:1227 #7 0x2857b7b0 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/mdev/cvs/php5/Zend/zend.c:996 #8 0x2853d0dc in php_execute_script (primary_file=0xbfbff944) at /home/mdev/cvs/php5/main/main.c:1699 #9 0x2859be4a in apache_php_module_main (r=0x809f038, display_source_mode=0) at /home/mdev/cvs/php5/sapi/apache/sapi_apache.c:55 #10 0x2859ce90 in send_php (r=0x809f038, display_source_mode=0, filename=0x80a0b08 "/usr/local/www/data/bug.php") at /home/mdev/cvs/php5/sapi/apache/mod_php4.c:608 #11 0x2859cf03 in send_parsed_php (r=0x809f038) at /home/mdev/cvs/php5/sapi/apache/mod_php4.c:623 #12 0x8053688 in ap_invoke_handler (r=0x809f038) at http_config.c:518 #13 0x80631a9 in process_request_internal (r=0x809f038) at http_request.c:1308 #14 0x8063208 in ap_process_request (r=0x809f038) at http_request.c:1324 #15 0x805c63e in child_main (child_num_arg=0) at http_main.c:4689 #16 0x805c7d0 in make_child (s=0x8099038, slot=0, now=1043934649) at http_main.c:4813 #17 0x805c8ed in startup_children (number_to_start=5) at http_main.c:4895 #18 0x805cddc in standalone_main (argc=3, argv=0xbfbffc4c) at http_main.c:5203 #19 0x805d4d7 in main (argc=3, argv=0xbfbffc4c) at http_main.c:5566 (gdb) print ce $1 = (zend_class_entry *) 0x0 -- Edit this bug report at http://bugs.php.net/?id=21961&edit=1
#21984 [Ver]: in 4.3.0 strtotime says next monday is Feb 10th 2003, thats wrong (4.2.3 works)
ID: 21984 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Verified Bug Type: Date/time related Operating System: SuSE Linux 8.1 PHP Version: 4.3.0 New Comment: Then, how about "second monday"? Previous Comments: [2003-02-03 08:00:15] [EMAIL PROTECTED] It *is* correct now, because that's how it always should have worked. I agree that it's less intuitive, but that doesn't make it any less correct. (Blame the people who defined the GNU date format!) "Monday", or "first Monday", or "1 Monday" will give you the first Monday which is zero or more days after the specified date (or today). "next Monday" or "2 Monday" will give you the Monday after that. "third Monday" or "3 Monday" will give you the one after that. And so on (except that the text versions run out at "twelfth", so from there onward you can only use "13 Monday", "14 Monday", etc.). Cheers! Mike [2003-02-03 05:44:09] [EMAIL PROTECTED] Well, but it isn't correct now, but was before... or is there a new term with with a can determine the "coming Monday" with strtotime? [2003-02-03 05:36:56] [EMAIL PROTECTED] H'rumph! Actually, both of your servers are producing the answer they should! In PHP versions prior to 4.3.0, the handling of "next" in strtotime() was incorrect; it was fixed for 4.3.0, so your script will require a minor update. Please see bug http://bugs.php.net/bug.php?id=18655 for the relevent discussion. This bug should be set to Bogus -- I don't think I have karma yet, so would somebody do it, please? Cheers! Mike [2003-01-31 11:34:23] [EMAIL PROTECTED] Just some into: I have "downgraded" the server to 4.2.3 - now it works fine... [2003-01-31 11:22:59] [EMAIL PROTECTED] Can I do something against that or do I have to wait for 4.3.1? Regards, Rolf 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/21984 -- Edit this bug report at http://bugs.php.net/?id=21984&edit=1
#22029 [Opn]: Segfault on startup using ZE2
ID: 22029 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Zend Engine 2 problem Operating System: Redhat PHP Version: 5CVS-2003-02-03 (dev) New Comment: What version of libc? and are you sure that any shared extensions are disabled in php.ini? Previous Comments: [2003-02-03 07:30:41] [EMAIL PROTECTED] ZE2 is segfaulting on startup in the PHP5 HEAD as well as the snapshot from last Monday (I didn't bother trying go to farther back then that). Checked the other segfault bugs that came up, and configured with --disable-all to make sure it wasn't an automatically turned on module.. Here is the BT: #0 0x081114b4 in zend_register_functions (scope=0x0, functions=0x4001a260, function_table=0x0, type=1) at /home/php/php4-ze2/Zend/zend_API.c:1099 #1 0x08111704 in zend_register_module (module=0x400237a0) at /home/php/php4-ze2/Zend/zend_API.c:1172 #2 0x080941a5 in php_dl (file=0x8183ee8, type=1, return_value=0xb860) at /home/php/php4-ze2/ext/standard/dl.c:242 #3 0x080ee128 in php_load_function_extension_cb (arg=0x8183ee8) at /home/php/php4-ze2/main/php_ini.c:247 #4 0x08108a35 in zend_llist_apply (l=0x8175c3c, func=0x80ee114 ) at /home/php/php4-ze2/Zend/zend_llist.c:190 #5 0x080ee5aa in php_ini_delayed_modules_startup () at /home/php/php4-ze2/main/php_ini.c:499 #6 0x080eb0bc in php_module_startup (sf=0x8174ac0, additional_modules=0x0, num_additional_modules=0) at /home/php/php4-ze2/main/main.c:1284 #7 0x08132530 in main (argc=1, argv=0xbaf4) at /home/php/php4-ze2/sapi/cli/php_cli.c:480 #8 0x400c8306 in __libc_start_main (main=0x8132420 , argc=1, ubp_av=0xbaf4, init=0x8063128 <_init>, fini=0x8133140 <_fini>, rtld_fini=0x4000d2dc <_dl_fini>, stack_end=0xbaec) at ../sysdeps/generic/libc-start.c:129 -- Edit this bug report at http://bugs.php.net/?id=22029&edit=1
#22029 [Opn->Fbk]: Segfault on startup using ZE2
ID: 22029 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Feedback Bug Type: Zend Engine 2 problem Operating System: Redhat PHP Version: 5CVS-2003-02-03 (dev) Previous Comments: [2003-02-03 08:23:07] [EMAIL PROTECTED] What version of libc? and are you sure that any shared extensions are disabled in php.ini? [2003-02-03 07:30:41] [EMAIL PROTECTED] ZE2 is segfaulting on startup in the PHP5 HEAD as well as the snapshot from last Monday (I didn't bother trying go to farther back then that). Checked the other segfault bugs that came up, and configured with --disable-all to make sure it wasn't an automatically turned on module.. Here is the BT: #0 0x081114b4 in zend_register_functions (scope=0x0, functions=0x4001a260, function_table=0x0, type=1) at /home/php/php4-ze2/Zend/zend_API.c:1099 #1 0x08111704 in zend_register_module (module=0x400237a0) at /home/php/php4-ze2/Zend/zend_API.c:1172 #2 0x080941a5 in php_dl (file=0x8183ee8, type=1, return_value=0xb860) at /home/php/php4-ze2/ext/standard/dl.c:242 #3 0x080ee128 in php_load_function_extension_cb (arg=0x8183ee8) at /home/php/php4-ze2/main/php_ini.c:247 #4 0x08108a35 in zend_llist_apply (l=0x8175c3c, func=0x80ee114 ) at /home/php/php4-ze2/Zend/zend_llist.c:190 #5 0x080ee5aa in php_ini_delayed_modules_startup () at /home/php/php4-ze2/main/php_ini.c:499 #6 0x080eb0bc in php_module_startup (sf=0x8174ac0, additional_modules=0x0, num_additional_modules=0) at /home/php/php4-ze2/main/main.c:1284 #7 0x08132530 in main (argc=1, argv=0xbaf4) at /home/php/php4-ze2/sapi/cli/php_cli.c:480 #8 0x400c8306 in __libc_start_main (main=0x8132420 , argc=1, ubp_av=0xbaf4, init=0x8063128 <_init>, fini=0x8133140 <_fini>, rtld_fini=0x4000d2dc <_dl_fini>, stack_end=0xbaec) at ../sysdeps/generic/libc-start.c:129 -- Edit this bug report at http://bugs.php.net/?id=22029&edit=1
#22037 [Opn->Fbk]: calling a function which expects a ref
ID: 22037 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Feedback Bug Type: Reproducible crash Operating System: Redhat 7.3 Linux PHP Version: 4.3.0 New Comment: Can't be reproduced with the latest CVS version (ZE1 / ZE2). Does your problem look like bug #21600? Previous Comments: [2003-02-03 13:35:52] [EMAIL PROTECTED] The following code works fine in 4.2.3, but segfaults in 4.3.0 (even though it passes the syntax check): My configure line: # ./configure --with-apxs=/usr/local/apache/bin/apxs --with-java --with-pdflib=/usr/local --with-gd --w ith-ttf --enable-trans-sid --with-curl --with-openssl --enable-sysvsem --enable-sysvshm --with-zlib --wi th-mysql=/usr/local/mysql --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr --with-gette xt --with-imap --with-imap-ssl --with-ldap --with-kerberos --enable-ftp --with-iodbc=/usr --with-oci8 -- with-imagick --enable-xslt --with-xslt-sablot=/usr/local --with-expat-dir=/usr -- Edit this bug report at http://bugs.php.net/?id=22037&edit=1
#22038 [Ctl->Fbk]: array() doesn't work right
ID: 22038 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Critical +Status: Feedback Bug Type: Zend Engine 2 problem Operating System: Windows 2000 Server PHP Version: 5CVS-2003-02-03 (dev) New Comment: Did you try one of the branch version (ZE1)? And I suppose we have to look into the problem more intentionally before marking this as critical. Previous Comments: [2003-02-03 18:04:07] [EMAIL PROTECTED] Looks like an windows only problem. It works on Linux with latest source snap. Please verify on other operating systems. [2003-02-03 17:53:18] [EMAIL PROTECTED] /run-tests.php doesn't work with latest php5-win32 snap on W2kserver. Every second array value get an array key. declaration (line 141): $ini_overwrites = array( 'output_handler=', 'zlib.output_compression=Off', 'open_basedir=', 'safe_mode=0', 'disable_functions=', 'output_buffering=Off', 'error_reporting=2047', 'display_errors=1', 'log_errors=0', 'html_errors=0', 'track_errors=1', 'report_memleaks=1', 'report_zend_debug=0', 'docref_root=/phpmanual/', 'docref_ext=.html', 'error_prepend_string=', 'error_append_string=', 'auto_prepend_file=', 'auto_append_file=', 'magic_quotes_runtime=0', ); var_dump($settings); (added on line 794): array(11) { [""]=> string(15) "output_handler=" ["zlib.output_compression=Off"]=> string(13) "open_basedir=" ["safe_mode=0"]=> string(18) "disable_functions=" ["output_buffering=Off"]=> string(20) "error_reporting=2047" ["display_errors=1"]=> string(12) "log_errors=0" ["html_errors=0"]=> string(14) "track_errors=1" ["report_memleaks=1"]=> string(19) "report_zend_debug=0" ["docref_root=/phpmanual/"]=> string(16) "docref_ext=.html" ["error_prepend_string="]=> string(20) "error_append_string=" ["auto_prepend_file="]=> string(17) "auto_append_file=" ["magic_quotes_runtime=0"]=> &array(1) { ["magic_quotes_runtime=0"]=> &array(1) { ["magic_quotes_runtime=0"]=> *RECURSION* } } } -- Edit this bug report at http://bugs.php.net/?id=22038&edit=1
#22038 [Fbk]: array() doesn't work right
ID: 22038 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Feedback Bug Type: Zend Engine 2 problem Operating System: Windows 2000 Server PHP Version: 5CVS-2003-02-03 (dev) New Comment: s/intentionally/intensively/ Previous Comments: [2003-02-04 00:31:24] [EMAIL PROTECTED] Did you try one of the branch version (ZE1)? And I suppose we have to look into the problem more intentionally before marking this as critical. [2003-02-03 18:04:07] [EMAIL PROTECTED] Looks like an windows only problem. It works on Linux with latest source snap. Please verify on other operating systems. [2003-02-03 17:53:18] [EMAIL PROTECTED] /run-tests.php doesn't work with latest php5-win32 snap on W2kserver. Every second array value get an array key. declaration (line 141): $ini_overwrites = array( 'output_handler=', 'zlib.output_compression=Off', 'open_basedir=', 'safe_mode=0', 'disable_functions=', 'output_buffering=Off', 'error_reporting=2047', 'display_errors=1', 'log_errors=0', 'html_errors=0', 'track_errors=1', 'report_memleaks=1', 'report_zend_debug=0', 'docref_root=/phpmanual/', 'docref_ext=.html', 'error_prepend_string=', 'error_append_string=', 'auto_prepend_file=', 'auto_append_file=', 'magic_quotes_runtime=0', ); var_dump($settings); (added on line 794): array(11) { [""]=> string(15) "output_handler=" ["zlib.output_compression=Off"]=> string(13) "open_basedir=" ["safe_mode=0"]=> string(18) "disable_functions=" ["output_buffering=Off"]=> string(20) "error_reporting=2047" ["display_errors=1"]=> string(12) "log_errors=0" ["html_errors=0"]=> string(14) "track_errors=1" ["report_memleaks=1"]=> string(19) "report_zend_debug=0" ["docref_root=/phpmanual/"]=> string(16) "docref_ext=.html" ["error_prepend_string="]=> string(20) "error_append_string=" ["auto_prepend_file="]=> string(17) "auto_append_file=" ["magic_quotes_runtime=0"]=> &array(1) { ["magic_quotes_runtime=0"]=> &array(1) { ["magic_quotes_runtime=0"]=> *RECURSION* } } } -- Edit this bug report at http://bugs.php.net/?id=22038&edit=1
#22041 [Opn->Fbk]: mb_substr produces "mojibake" on certain strings ...
ID: 22041 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Feedback Bug Type: mbstring related Operating System: Red Hat Linux 7.2 PHP Version: 4.3.0 New Comment: LOL! It's indeed so OFFENSIVE I have no idea how to translate those words to English. But perhaps you know what that means? Ehm, first try setting the internal encoding to "eucJP-win". Previous Comments: [2003-02-04 05:28:48] [EMAIL PROTECTED] First, sorry for any offensive japanese words. I can't read/write japanese very well, and the error in mb_substr occurs on data from a list of video titles ... I tried to find another less offensive example but couldn't. I'm just posting this bug report in order to help ... I am trying to use mb_substr on data I get from a postgreSQL DB and in some cases mb_substr seems to cut the string in the middle of a multibyte char .. which turns the "cut" char into mojibake ... The DB is in EUC-JP and my internal encoding is set to EUC-JP in my php.ini file ... As you can see the last character of the string has been improperly cut ... Here is my test program and output: CODE: substr; echo "String: "; echo $c .""; $c = mb_substr($c, 0, 80); echo " After cutting it ... "; echo $c .""; ?> OUPUT: COMMENT2: ¥¢¥ó¥°¥ë¤Î¡ÖĶ-¸Ô´Ö¤Î¥¢¥ó¥°¥ë¡×¥·¥ê¡¼¥º£Ä£Ø¡¢Â³¡¹Åо졪¤¿¤À¤ÎºÆÊÔ¤â¤Î¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡ªÍ¾Ê¬¤Ê²è¤¬¤Ê¤¤ AFTER cutting it ... ¥¢¥ó¥°¥ë¤Î¡ÖĶ-¸Ô´Ö¤Î¥¢¥ó¥°¥ë¡×¥·¥ê¡¼¥º£Ä£Ø¡¢Â³¡¹Åо졪¤¿¤À¤ÎºÆÊÔ¤â¤Î¤Ç¤Ï¤¢¤ê¤Þ� -- Edit this bug report at http://bugs.php.net/?id=22041&edit=1
#18648 [Opn->Fbk]: Single entry form POST gives incorrect variable content
ID: 18648 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Feedback Bug Type: Apache2 related Operating System: All PHP Version: 5CVS-2003-01-29 (dev) / 4CVS-20020121 (stable) New Comment: [To anyone who experiences this trouble] Are you sure that your httpd.conf has just A SINGLE KIND OF PHP RELATED DIRECTIVE? Then try grep "\(OutputFilter\|InputFilter\|AddType\)" < httpd.conf or whatsoever. # bad example (a) AddInputFilter PHP php AddOutputFilter PHP php ... AddType x-httpd-php .php # bad example (b) SetInputFilter PHP SetOutputFilter PHP ... AddType x-httpd-php .php # not bad (c) AddInputFilter PHP php AddOutputFilter PHP php # good (d) AddType x-httpd-php .php Previous Comments: [2003-02-04 09:16:42] [EMAIL PROTECTED] Tested in RH8.0 + PHP 4.2.2 + Apache 2. - Is ok when you add the 'enctype="multipart/form-data"' propety to the form tag. - Is ok when you send using GET method instead POST. - Is ok when you send more than one field: if you have a text and a button, if you send it pressing enter only the text send and the problem occurs. When you press the button, text and button are send and the problem not occur. ciao. [2003-02-03 12:36:09] [EMAIL PROTECTED] I can _NOT_ reproduce this with Apache 2.0.44 and PHP 4.3.1-dev.. [2003-02-03 11:55:47] [EMAIL PROTECTED] array(4) { [0]=> string(1) "1" [1]=> string(1) "2" [2]=> string(1) "1" [3]=> string(1) "2" } >From the latest snap's (php4-STABLE, php5). cvs commit (?) :) [2003-01-31 19:52:37] [EMAIL PROTECTED] Have Apache/2.0.44 (RedHat8.0 (LastUpdates) mod_ssl/2.0.44 OpenSSL/0.9.6b PHP/4.3.0 Starting Apache answers - [root@delta bin]# httpd -DSSL httpd: module "/usr/src/php-4.3.0/sapi/apache2filter/sapi_apache2.c" is not comp atible with this version of Apache. Please contact the vendor for the correct version. Where troubles ? [2003-01-30 03:52:45] [EMAIL PROTECTED] [EMAIL PROTECTED], Thank you for the info! Okay, updating version. 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/18648 -- Edit this bug report at http://bugs.php.net/?id=18648&edit=1
#22064 [Opn]: mb_send_mail hard-coded to send text/plain
ID: 22064 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: mbstring related Operating System: Red Hat Linux 7.2 PHP Version: 4.3.0 -Assigned To: +Assigned To: moriyoshi New Comment: This work is in progress. Stay tuned! Previous Comments: [2003-02-05 01:06:20] [EMAIL PROTECTED] Feature request: Currently mb_send_mail() is hard-coded to send a Content-type of text/plain. Would it be possible to add a way to change this (being able to set it to text/html would be very useful). Either a parameter to mb_send_email or a function such as mb_send_mail_set_content_type(string)? Thanks! Jc -- Edit this bug report at http://bugs.php.net/?id=22064&edit=1
#22041 [Opn]: mb_substr produces "mojibake" on certain strings ...
ID: 22041 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: mbstring related Operating System: Red Hat Linux 7.2 PHP Version: 4.3.0 New Comment: Since mb_substr() internally converts input strings to the Unicode character set representation, if it find such an "illegal" character that is not supposed to be a member of the input character set, it simply ends up returning wrong results. eucjp-win is prepared for convenience so that users can handle strings whose components are represented in CP932 character set and encoded in EUC-JP. Practically, there are some EUC-JP variants because EUC-JP itself originally represents just an encoding rather than a whole character set. I think this practice is quite confusing too, but please keep it in your mind that an encoding doesn't always have a single corresponding character set even though their names are the same. In this context, it could be said EUC-JP is rather a name of an encoding and often mistaken as a character set name, where the actual names of character sets which EUC-JP _can_ represent are ISO646, JISX0201-1976, JISX0208-1990, JISX0212-1990, JISX0213-2000, and so on. Anyway, did you try it out? Previous Comments: [2003-02-04 21:20:49] [EMAIL PROTECTED] Glad you could see the funny side of this bug report :) I did try very hard to find a better example ... but couldn't get mb_substr to break on anything else. Why set internal encoding to eucJP-win? The data is from a database and is in EUC-JP ... When I entered the data into the DB if the were any illegal EUC-JP characters it should have complained ... And as you can see I can display the whole string as EUC-JP perfectly. It's only *after* I use mb_substr() that the string becomes mojibake ... Thanks! [2003-02-04 07:36:19] [EMAIL PROTECTED] LOL! It's indeed so OFFENSIVE I have no idea how to translate those words to English. But perhaps you know what that means? Ehm, first try setting the internal encoding to "eucJP-win". [2003-02-04 05:28:48] [EMAIL PROTECTED] First, sorry for any offensive japanese words. I can't read/write japanese very well, and the error in mb_substr occurs on data from a list of video titles ... I tried to find another less offensive example but couldn't. I'm just posting this bug report in order to help ... I am trying to use mb_substr on data I get from a postgreSQL DB and in some cases mb_substr seems to cut the string in the middle of a multibyte char .. which turns the "cut" char into mojibake ... The DB is in EUC-JP and my internal encoding is set to EUC-JP in my php.ini file ... As you can see the last character of the string has been improperly cut ... Here is my test program and output: CODE: substr; echo "String: "; echo $c .""; $c = mb_substr($c, 0, 80); echo " After cutting it ... "; echo $c .""; ?> OUPUT: COMMENT2: ¥¢¥ó¥°¥ë¤Î¡ÖĶ-¸Ô´Ö¤Î¥¢¥ó¥°¥ë¡×¥·¥ê¡¼¥º£Ä£Ø¡¢Â³¡¹Åо졪¤¿¤À¤ÎºÆÊÔ¤â¤Î¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡ªÍ¾Ê¬¤Ê²è¤¬¤Ê¤¤ AFTER cutting it ... ¥¢¥ó¥°¥ë¤Î¡ÖĶ-¸Ô´Ö¤Î¥¢¥ó¥°¥ë¡×¥·¥ê¡¼¥º£Ä£Ø¡¢Â³¡¹Åо졪¤¿¤À¤ÎºÆÊÔ¤â¤Î¤Ç¤Ï¤¢¤ê¤Þ� -- Edit this bug report at http://bugs.php.net/?id=22041&edit=1
#22041 [Opn->Bgs]: mb_substr produces "mojibake" on certain strings ...
ID: 22041 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: mbstring related Operating System: Red Hat Linux 7.2 PHP Version: 4.3.0 New Comment: First, let me mark this report as bogus, because it doesn't appear a bug after all. > But now makes me wonder what character set my data is in?? And I set my It's up to the browser you are using how posted form data are encoded and submitted to a php script. > Postgresql database to be EUC-JP, but since you say that could mean more > than one thing, I wonder which one PostgreSQL uses?? Inside PostgreSQL, "EUC-JP" encoded characters are handled in a character-set independent way, Whilst it is treated as a name of a charset - encoding mapping in mbstring. Previous Comments: [2003-02-05 07:55:59] [EMAIL PROTECTED] Wow, thanks for the long answer! I didn't realize that EUC-JP was not a single character set ... I tried what you suggested and that fixed the problem ... But now makes me wonder what character set my data is in?? And I set my Postgresql database to be EUC-JP, but since you say that could mean more than one thing, I wonder which one PostgreSQL uses?? Since I am so confused as to what format my data is in, I ended up using the database's substr() function instead of PHP's ... I figure that is safer ... So I guess the is no problem with mb_substr() then ... just that even though the DB says the data is in EUC-JP it really is in eucJP-win? Thanks! PS You can close the report if you agree that there is no error in mb_substr() PPS I love PHP's mb functions, thanks for your work. I just wish the world would agree on ONE japanese encoding =) It would save me a lot of headaches ... [2003-02-05 07:47:27] [EMAIL PROTECTED] Since mb_substr() internally converts input strings to the Unicode character set representation, if it find such an "illegal" character that is not supposed to be a member of the input character set, it simply ends up returning wrong results. eucjp-win is prepared for convenience so that users can handle strings whose components are represented in CP932 character set and encoded in EUC-JP. Practically, there are some EUC-JP variants because EUC-JP itself originally represents just an encoding rather than a whole character set. I think this practice is quite confusing too, but please keep it in your mind that an encoding doesn't always have a single corresponding character set even though their names are the same. In this context, it could be said EUC-JP is rather a name of an encoding and often mistaken as a character set name, where the actual names of character sets which EUC-JP _can_ represent are ISO646, JISX0201-1976, JISX0208-1990, JISX0212-1990, JISX0213-2000, and so on. Anyway, did you try it out? [2003-02-04 21:20:49] [EMAIL PROTECTED] Glad you could see the funny side of this bug report :) I did try very hard to find a better example ... but couldn't get mb_substr to break on anything else. Why set internal encoding to eucJP-win? The data is from a database and is in EUC-JP ... When I entered the data into the DB if the were any illegal EUC-JP characters it should have complained ... And as you can see I can display the whole string as EUC-JP perfectly. It's only *after* I use mb_substr() that the string becomes mojibake ... Thanks! [2003-02-04 07:36:19] [EMAIL PROTECTED] LOL! It's indeed so OFFENSIVE I have no idea how to translate those words to English. But perhaps you know what that means? Ehm, first try setting the internal encoding to "eucJP-win". [2003-02-04 05:28:48] [EMAIL PROTECTED] First, sorry for any offensive japanese words. I can't read/write japanese very well, and the error in mb_substr occurs on data from a list of video titles ... I tried to find another less offensive example but couldn't. I'm just posting this bug report in order to help ... I am trying to use mb_substr on data I get from a postgreSQL DB and in some cases mb_substr seems to cut the string in the middle of a multibyte char .. which turns the "cut" char into mojibake ... The DB is in EUC-JP and my internal encoding is set to EUC-JP in my php.ini file ... As you can see the last character of the string has been improperly cut ... Here is my test program and output: CODE: substr; echo "String: "; echo $c .""; $c = mb_substr($c, 0, 80); echo " After cutting it ... "; echo $c .""; ?> OUPUT: COMMENT2: ¥¢¥ó¥°¥ë¤Î¡ÖĶ-¸Ô´Ö¤Î¥¢¥ó¥°¥ë¡×¥·¥ê¡¼¥º£Ä£Ø¡¢Â³¡¹Åо졪¤¿¤À¤ÎºÆÊÔ¤â¤
#22078 [Opn->Fbk]: iconv is not recognized during ./configure
ID: 22078 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Feedback -Bug Type: *General Issues +Bug Type: ICONV related Operating System: OpenBSD 3.2 sparc64 PHP Version: 4.2.3 New Comment: 1) What option did you specify at the libiconv's configure script? 2) Please check whether another iconv library such as BSD iconv is installed somewhere else. When two different iconv implementations are installed, configure may fail. 3) Try the best available version, 4.3.0. Previous Comments: [2003-02-05 11:50:12] [EMAIL PROTECTED] I reproduced this with iconv 1.8 & 1.7. Tried the packages and compiling iconv myself. The outcome was identical. ./configure --with-zlib --with-gd --with-jpeg --with-png --with-mysql=/usr/local/mysql --with-curl --with-gdbm --with-xmlrpc --with-dom --with-dom-xslt --with-expat --with -iconv=/usr/local/libiconv/ --with-iconv-dir=/usr/local/libiconv/ configure: error: Please specify the install prefix of iconv with --with-iconv= -- Edit this bug report at http://bugs.php.net/?id=22078&edit=1
#22078 [Opn->Fbk]: iconv is not recognized during ./configure
ID: 22078 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Feedback Bug Type: ICONV related Operating System: OpenBSD 3.2 sparc64 PHP Version: 4.2.3 New Comment: As we don't support older versions anymore, I yet think the best solution is to use 4.3.0. Then, what's wrong with the latest version? Previous Comments: [2003-02-05 13:50:45] [EMAIL PROTECTED] 1. ./configure --prefix=/usr/local/libiconv 2. Not the case; always uninstalled previous versions before I tried a new one. 3. Works; however I have other problems with 4.3.0 hence me trying 4.2.3 [2003-02-05 13:36:37] [EMAIL PROTECTED] 1) What option did you specify at the libiconv's configure script? 2) Please check whether another iconv library such as BSD iconv is installed somewhere else. When two different iconv implementations are installed, configure may fail. 3) Try the best available version, 4.3.0. [2003-02-05 11:50:12] [EMAIL PROTECTED] I reproduced this with iconv 1.8 & 1.7. Tried the packages and compiling iconv myself. The outcome was identical. ./configure --with-zlib --with-gd --with-jpeg --with-png --with-mysql=/usr/local/mysql --with-curl --with-gdbm --with-xmlrpc --with-dom --with-dom-xslt --with-expat --with -iconv=/usr/local/libiconv/ --with-iconv-dir=/usr/local/libiconv/ configure: error: Please specify the install prefix of iconv with --with-iconv= -- Edit this bug report at http://bugs.php.net/?id=22078&edit=1
#22078 [Opn->Csd]: iconv is not recognized during ./configure
ID: 22078 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Closed Bug Type: ICONV related Operating System: OpenBSD 3.2 sparc64 PHP Version: 4.2.3 New Comment: O.k. we'll take a look into the other problems. Now closing this report... (fixed in later versions) Previous Comments: [2003-02-05 15:30:31] [EMAIL PROTECTED] See bug #22076 & #22077 [2003-02-05 14:05:41] [EMAIL PROTECTED] As we don't support older versions anymore, I yet think the best solution is to use 4.3.0. Then, what's wrong with the latest version? [2003-02-05 13:50:45] [EMAIL PROTECTED] 1. ./configure --prefix=/usr/local/libiconv 2. Not the case; always uninstalled previous versions before I tried a new one. 3. Works; however I have other problems with 4.3.0 hence me trying 4.2.3 [2003-02-05 13:36:37] [EMAIL PROTECTED] 1) What option did you specify at the libiconv's configure script? 2) Please check whether another iconv library such as BSD iconv is installed somewhere else. When two different iconv implementations are installed, configure may fail. 3) Try the best available version, 4.3.0. [2003-02-05 11:50:12] [EMAIL PROTECTED] I reproduced this with iconv 1.8 & 1.7. Tried the packages and compiling iconv myself. The outcome was identical. ./configure --with-zlib --with-gd --with-jpeg --with-png --with-mysql=/usr/local/mysql --with-curl --with-gdbm --with-xmlrpc --with-dom --with-dom-xslt --with-expat --with -iconv=/usr/local/libiconv/ --with-iconv-dir=/usr/local/libiconv/ configure: error: Please specify the install prefix of iconv with --with-iconv= -- Edit this bug report at http://bugs.php.net/?id=22078&edit=1
#22108 [Bgs->Opn]: php doesn't ignore the utf-8 BOM
ID: 22108 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Bogus +Status: Open -Bug Type: Output Control +Bug Type: Feature/Change Request Operating System: windows 2000 PHP Version: 4.2.3 New Comment: Because BOM issue has been referenced repeatedly as a header output preventer and we should be more aware of this, I don't see any reason we have to mark this report as bogus. Changing category from "output control" to a kind of "feature request". Previous Comments: [2003-02-07 13:57:22] [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 BOM = Byte Order Mark for UCS-2 encoding This value sould not be used in UTF-8 since the only reason besides detecting the byte order of UCS-2 was a special non breaking space. And newer Unicode versions have another representation for the same thing. Anyhow BOM = FE FF That makes depending on the byte order: UCS-2BE <-> "\xFE\xFF" UCS-2LE <-> "\xFF\xFE" Therefore a sequence of "EF BB" is another character and must not be ignored. [2003-02-07 10:42:16] [EMAIL PROTECTED] sniper, imagine someone would want to echo some text in eg. French. In that case, if you'd save it as ascii, you would get corrupted output. So instead you'd have to save as utf-8. Which seems to cause problems (or so [EMAIL PROTECTED] tells us) [2003-02-07 08:58:21] [EMAIL PROTECTED] And why an earth would you save PHP files in any other format than ascii? [2003-02-07 08:53:10] [EMAIL PROTECTED] What is a BOM ? Derick [2003-02-07 08:46:36] [EMAIL PROTECTED] Problem: When a php file is saved in utf-8 format with the UTF-8 BOM as the first three bytes of the file (EF BB BF), PHP doesn't ignore these bytes when loading and compiling the file, but instead considers them output coming prior to the http://bugs.php.net/?id=22108&edit=1
#18648 [Fbk->Bgs]: Single entry form POST gives incorrect variable content
ID: 18648 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Feedback +Status: Bogus Bug Type: Apache2 related Operating System: All PHP Version: 5CVS-2003-01-29 (dev) / 4CVS-20020121 (stable) New Comment: First I made a typo in my previous comment. I mean "application/x-httpd-php" everywhere I wrote "x-http-php". Anyway let me mark this as bogus... (The problem turned out to be a user fault.) Previous Comments: [2003-02-07 19:33:06] [EMAIL PROTECTED] Apache 2.0.44 / PHP 4.3.1-dev (php4-STABLE-200302071830) No more problem. Neither sessions, neither forms Good job ! [2003-02-06 03:57:54] [EMAIL PROTECTED] That's it. [2003-02-04 20:49:40] [EMAIL PROTECTED] Thanks... It works ok. [2003-02-04 15:05:45] [EMAIL PROTECTED] [To anyone who experiences this trouble] Are you sure that your httpd.conf has just A SINGLE KIND OF PHP RELATED DIRECTIVE? Then try grep "\(OutputFilter\|InputFilter\|AddType\)" < httpd.conf or whatsoever. # bad example (a) AddInputFilter PHP php AddOutputFilter PHP php ... AddType x-httpd-php .php # bad example (b) SetInputFilter PHP SetOutputFilter PHP ... AddType x-httpd-php .php # not bad (c) AddInputFilter PHP php AddOutputFilter PHP php # good (d) AddType x-httpd-php .php [2003-02-04 09:16:42] [EMAIL PROTECTED] Tested in RH8.0 + PHP 4.2.2 + Apache 2. - Is ok when you add the 'enctype="multipart/form-data"' propety to the form tag. - Is ok when you send using GET method instead POST. - Is ok when you send more than one field: if you have a text and a button, if you send it pressing enter only the text send and the problem occurs. When you press the button, text and button are send and the problem not occur. ciao. 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/18648 -- Edit this bug report at http://bugs.php.net/?id=18648&edit=1
#22108 [Opn]: php doesn't ignore the utf-8 BOM
ID: 22108 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Feature/Change Request Operating System: windows 2000 PHP Version: 4.2.3 New Comment: Yes, I suppose this might be a bug, but most of developers involved in PHP are not just so aware of this issue as you expected (and I had expected). So I thought that changing the category is a better choice than bogusing. Previous Comments: [2003-02-07 23:13:07] [EMAIL PROTECTED] The BOM (byte order mark) is a few bytes at the very front of a file that act as a signature denoting what type of encoding has been used, and in UTF16/32 it also makes the byte order (LE or BE). Although utf-8 is byte order independent, it has become popular on windows (perhaps not so on unix) to make use of the BOM encoded in UTF-8 to flag the file as being in UTF-8 format. This allows editors to determine the type of the file from the first few characters instead of trying to guess what type the file is. Ref: Textpad 4.6 (http://textpad.com) See the Unicode FAQ for details of the utf-8 BOM... http://www.unicode.org/unicode/faq/utf_bom.html#25 The use of this should be obvious, you have to leave the my-language-only mindset that afflicts too many programmers (myself included before this job) and think about the growing multiplicity of languages on the web. I am writing web applications in Japan, with European language and CJK (Chinese/Japanese/Korean) language processing and interfaces. Thus I have php files where variable values are strings of all sorts of languages - hence utf-8 encoding. I feel that this is definitely a bug in php. Considering that: * php is slowly growing into a language-neutral (i18n/l10n possible) language * php is designed such that php commands can be liberally sprinkled through html, and html is increasing encoded in utf-8 these days * the utf-8 bom is becoming increasingly popular for reasons of indentifying the file character format * if the utf-8 bom exists php actually outputs it incorrectly and in doing so prevents header output I request that you don't see this as a feature request, but as a bug in the handling of utf-8 files. Whether the output generator is the correct characterization of this bug or not I leave up to you. Regards, Brodie. [2003-02-07 21:41:23] [EMAIL PROTECTED] Because BOM issue has been referenced repeatedly as a header output preventer and we should be more aware of this, I don't see any reason we have to mark this report as bogus. Changing category from "output control" to a kind of "feature request". [2003-02-07 13:57:22] [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 BOM = Byte Order Mark for UCS-2 encoding This value sould not be used in UTF-8 since the only reason besides detecting the byte order of UCS-2 was a special non breaking space. And newer Unicode versions have another representation for the same thing. Anyhow BOM = FE FF That makes depending on the byte order: UCS-2BE <-> "\xFE\xFF" UCS-2LE <-> "\xFF\xFE" Therefore a sequence of "EF BB" is another character and must not be ignored. [2003-02-07 10:42:16] [EMAIL PROTECTED] sniper, imagine someone would want to echo some text in eg. French. In that case, if you'd save it as ascii, you would get corrupted output. So instead you'd have to save as utf-8. Which seems to cause problems (or so [EMAIL PROTECTED] tells us) [2003-02-07 08:58:21] [EMAIL PROTECTED] And why an earth would you save PHP files in any other format than ascii? 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/22108 -- Edit this bug report at http://bugs.php.net/?id=22108&edit=1
#16769 [Bgs]: Upgraded to Apache 2 with PHP not working
ID: 16769 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Bogus Bug Type: Apache2 related Operating System: Windows 2000 PHP Version: 4.2.0 New Comment: 1. Use the appropriate version of PHP matching to the installed Apache2 binary. 2. Be sure to remove all the related binaries (.exe and .dll) that came with the previous version of PHP and have probably been installed in c:\windows, c:\winnt or c:\winnt\system32, whenever you reinstall either Apache2 or PHP. 3. Recheck your httpd.conf to avoid enabling two conflicting directives. You always have to use a single AddType directive instead of old-fashioned Filter directives. Previous Comments: [2003-02-08 02:08:44] [EMAIL PROTECTED] I met the same issue. who can help me? [2002-11-18 16:22:59] [EMAIL PROTECTED] I recently downloaded Apache 2.0.43 Windows MSI Installer, and Php 4.2.3 as well. I set up the server and it works fine. However when uncommenting the lines I put so it loads the php modules the apache server gives me two different errors. When using the php4apache.dll it tells me that the required libraries to run php are missing and it points to a directory wich doesn't even exist. When I use the php4apache2.dll, apache says that it needs a newer version of the dll. Is this an apache or a php problem? I tried both the installer package of php (Which says the scripts to configure apache aren't ready yet) and the binary zip distribution as well. [2002-07-02 21:31:29] [EMAIL PROTECTED] For apache2 you need latest CVS versions of both apache2 and PHP. Someone might have compiled those already for Win32, but that's really not our problem. [2002-07-02 21:17:09] [EMAIL PROTECTED] Lets look at this, and what about version 4.2.1 However, the latest Apache patch 1.3.26 for the chunk code overflow and PHP 4.2.0 is still working. Its just 2.0.35 that I am conceared with [2002-06-30 09:11:15] [EMAIL PROTECTED] I have the same Problem as [EMAIL PROTECTED] 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/16769 -- Edit this bug report at http://bugs.php.net/?id=16769&edit=1
#22108 [Opn]: php doesn't ignore the utf-8 BOM
ID: 22108 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Feature/Change Request -Operating System: windows 2000 +Operating System: Any -PHP Version: 4.2.3 +PHP Version: All (as of the current implementation) -Assigned To: +Assigned To: moriyoshi New Comment: And assigning this task to me. Previous Comments: [2003-02-08 01:48:15] [EMAIL PROTECTED] Yes, I suppose this might be a bug, but most of developers involved in PHP are not just so aware of this issue as you expected (and I had expected). So I thought that changing the category is a better choice than bogusing. [2003-02-07 23:13:07] [EMAIL PROTECTED] The BOM (byte order mark) is a few bytes at the very front of a file that act as a signature denoting what type of encoding has been used, and in UTF16/32 it also makes the byte order (LE or BE). Although utf-8 is byte order independent, it has become popular on windows (perhaps not so on unix) to make use of the BOM encoded in UTF-8 to flag the file as being in UTF-8 format. This allows editors to determine the type of the file from the first few characters instead of trying to guess what type the file is. Ref: Textpad 4.6 (http://textpad.com) See the Unicode FAQ for details of the utf-8 BOM... http://www.unicode.org/unicode/faq/utf_bom.html#25 The use of this should be obvious, you have to leave the my-language-only mindset that afflicts too many programmers (myself included before this job) and think about the growing multiplicity of languages on the web. I am writing web applications in Japan, with European language and CJK (Chinese/Japanese/Korean) language processing and interfaces. Thus I have php files where variable values are strings of all sorts of languages - hence utf-8 encoding. I feel that this is definitely a bug in php. Considering that: * php is slowly growing into a language-neutral (i18n/l10n possible) language * php is designed such that php commands can be liberally sprinkled through html, and html is increasing encoded in utf-8 these days * the utf-8 bom is becoming increasingly popular for reasons of indentifying the file character format * if the utf-8 bom exists php actually outputs it incorrectly and in doing so prevents header output I request that you don't see this as a feature request, but as a bug in the handling of utf-8 files. Whether the output generator is the correct characterization of this bug or not I leave up to you. Regards, Brodie. [2003-02-07 21:41:23] [EMAIL PROTECTED] Because BOM issue has been referenced repeatedly as a header output preventer and we should be more aware of this, I don't see any reason we have to mark this report as bogus. Changing category from "output control" to a kind of "feature request". [2003-02-07 13:57:22] [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 BOM = Byte Order Mark for UCS-2 encoding This value sould not be used in UTF-8 since the only reason besides detecting the byte order of UCS-2 was a special non breaking space. And newer Unicode versions have another representation for the same thing. Anyhow BOM = FE FF That makes depending on the byte order: UCS-2BE <-> "\xFE\xFF" UCS-2LE <-> "\xFF\xFE" Therefore a sequence of "EF BB" is another character and must not be ignored. [2003-02-07 10:42:16] [EMAIL PROTECTED] sniper, imagine someone would want to echo some text in eg. French. In that case, if you'd save it as ascii, you would get corrupted output. So instead you'd have to save as utf-8. Which seems to cause problems (or so [EMAIL PROTECTED] tells us) 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/22108 -- Edit this bug report at http://bugs.php.net/?id=22108&edit=1
#22108 [Opn]: php doesn't ignore the utf-8 BOM
ID: 22108 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Feature/Change Request Operating System: Any PHP Version: All (as of the current implementation) -Assigned To: +Assigned To: moriyoshi New Comment: reassigning Previous Comments: [2003-02-08 06:10:51] [EMAIL PROTECTED] Ok, the UTF-8 BOM was new to me. If i find the time i'll have a look at it over the weekend. I think the solution would be somewhere in zend's multibyte support since i fear adding that bom to mbstring alone does not do the trick. [2003-02-08 05:43:14] [EMAIL PROTECTED] derick, assuming that you wanted to create a version of the the example at http://www.php.net/manual/en/introduction.php#intro-whatis which displayed the text "Hi, I'm a PHP script" in multiple languages, how would you propose doing it? The only way is to use a form of unicode encoding. The least intrusive of these ways is utf-8 because it encodes the text in such a way that ascii characters (7 bit characters) are still plain ascii characters, and all encoded characters are always >128 and will never be mistaken for ascii. I haven't seen any documentation which states that php can only handle ascii text, please direct me to it if it exists. If there is some known problem with PHP parsing UTF-8 scripts, I haven't found it yet in a multitude of different files with different languages which PHP is parsing happily. The only problem that I have had is that any files which have an UTF-8 BOM, PHP is mistakenly outputting the BOM as input. This is a bug of PHP. The solution is easy, on loading a file, strip the BOM if it exists. Make it optional processing via a php.ini config argument if necessary. Don't be US-centric in your thinking, there is far more world existing outside those borders. Regards, Brodie. [2003-02-08 04:24:12] [EMAIL PROTECTED] PHP doesn't want UNICODE scripts, but just ASCII ones. Not a bug -> bogus. [2003-02-08 02:01:11] [EMAIL PROTECTED] And assigning this task to me. [2003-02-08 01:48:15] [EMAIL PROTECTED] Yes, I suppose this might be a bug, but most of developers involved in PHP are not just so aware of this issue as you expected (and I had expected). So I thought that changing the category is a better choice than bogusing. 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/22108 -- Edit this bug report at http://bugs.php.net/?id=22108&edit=1
#21918 [Ver]: strange behaviour of mixed type in array-keys
ID: 21918 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Verified Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 4.3.0/5.0.0 New Comment: Related to bug #8325 Previous Comments: [2003-01-29 02:22:57] [EMAIL PROTECTED] I relied on http://www.php.net/manual/en/language.types.array.php it states: "A key is either an integer or a string. If a key is the standard representation of an integer, it will be interpreted as such (i.e. "8" will be interpreted as 8, while "08" will be interpreted as "08")." so the keys should be casted to int, or it is a documentation-bug, or "-1" is not a "standard representation of an integer". [2003-01-29 00:57:01] [EMAIL PROTECTED] '-1', '0' => '0', '1' => '1', ); var_dump($a); ?> Output: array(3) { ["-1"]=> string(2) "-1" [0]=> string(1) "0" [1]=> string(1) "1" } (the '0' and '1' indexes are converted to integers..) Not sure if this is actually expected behaviour. :) [2003-01-29 00:39:34] [EMAIL PROTECTED] The bug can be that it shouldn't cast positive numbers to string and not that it should cast negative numbers to string. [2003-01-29 00:31:41] [EMAIL PROTECTED] Verified under PHP 4.3.0 with Zend Engine v1.3.0 and PHP 5.0.0-dev with Zend Engine v2.0.0-dev. It looks like '-1' isn't casted to int as it should. [2003-01-28 04:58:13] [EMAIL PROTECTED] 1, '-1'=>2, 0=>3, '0'=>4, 1=>5, '1'=>6 ); print_r($a); ?> produces: Array ( [-1] => 1 [-1] => 2 [0] => 4 [1] => 6 ) foreach (array_keys($a) as $key) echo $key, ': ', gettype($key), "\n"; produces: -1: integer -1: string 0: integer 1: integer so it seems strings containing negative integers do not get converted to integers automagically but positive integers are. -- Edit this bug report at http://bugs.php.net/?id=21918&edit=1
#8325 [Opn]: numeric strings used as keys are converted to longs
ID: 8325 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Feature/Change Request Operating System: * PHP Version: 4.0 Latest CVS (19/12/2000) New Comment: Related to bug #21918 Previous Comments: [2000-12-19 15:54:22] [EMAIL PROTECTED] (Actually, this is for PHP 4 versions up to 4.0.4 RC6, but it ain't in the version list.) I don't want to sound harsh or something, and this behavior seemed to be accepted as feature from what I saw elsewhere in the bug database (can't find it, though), but I think it shouldn't be that way. Current behavior: '' ) ; var_dump( $a ) ; ?> output (note: casting within the array() doesn't help): string(1) "1" array(1) { [1]=> string(4) "" } 'Right' (YMMV) behavior: string(1) "1" array(1) { ["1"]=> string(4) "" } -- Edit this bug report at http://bugs.php.net/?id=8325&edit=1
#15599 [Opn->WFx]: functions returning references, oddity(?)
ID: 15599 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Wont fix Bug Type: Feature/Change Request Operating System: all PHP Version: 4.1.1 New Comment: We won't make such a change that would definitely break backwards compatibility even though the behaviour is not intuitive. Previous Comments: [2002-03-31 13:47:33] [EMAIL PROTECTED] don't think so example: $var = "a"; // var $c->b $ref = &$var; // function $c->fc(); and how do u think about: $a = $ref;// $myvar = $c->fc(); and $b = &$ref; // $myvar = $c->fc(); which is copy and which is reference? $a or $b? [2002-02-18 10:33:14] [EMAIL PROTECTED] I think it is a bit funny that when returning references from functions you get something looking kind of this in the end: $a = & & $b; That is, I think it would be more logic if a function that is specified to return a reference wouldn't need to be set on the return side to return a reference.. since I doesn't make my self clear, here is as an example what I mean: class a { var $b; function &fc() { return $this->b; } } $c = new a(); // A) $myvar = $c->fc(); --- Now this will not work as I seem would be logical, instead one need to do the last line: // B) $myvar = &$c->fc(); This seems funny.. My logic says that since the function is defined to return a reference it would be enough (A).. no need to do it again like in (B). This is true when passing a reference: somefunc($myvar) will result in passing an reference if the func is defined like function somefunc(&$arg) Is there any chance of a change? Opinions, comments etc. ? -- Edit this bug report at http://bugs.php.net/?id=15599&edit=1
#15920 [Opn->Csd]: range() with a step parameter
ID: 15920 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Closed Bug Type: Feature/Change Request Operating System: Any PHP Version: 4.1.2 New Comment: Thank you for your bug report. This issue has already been fixed in the latest released version of PHP, which you can download at http://www.php.net/downloads.php Previous Comments: [2002-03-06 20:54:25] [EMAIL PROTECTED] I think it would be useful in some situation if the range() function can take a third optional parameter (called "step" or whatever you want) which specifies the space between two consecutive elements in the resulting array. For example: $array = range(1, 5, 2); // array(1,3,5); It might be always positive to understand its effect easily. $array = range('Z', 'A', 3); // array('Z', 'W', 'T', 'Q', ...); If the second boundary cannot be included regarding to the step parameter, just simply leave it out: $array = range(1, 6, 2); // array(1,3,5); That's all. -- Edit this bug report at http://bugs.php.net/?id=15920&edit=1
#15920 [Csd]: range() with a step parameter
ID: 15920 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Closed Bug Type: Feature/Change Request Operating System: Any PHP Version: 4.1.2 New Comment: No, sorry, this request is realised in CVS versions you can fetch at http://snaps.php.net/ Previous Comments: [2003-02-08 12:55:30] [EMAIL PROTECTED] Thank you for your bug report. This issue has already been fixed in the latest released version of PHP, which you can download at http://www.php.net/downloads.php [2002-03-06 20:54:25] [EMAIL PROTECTED] I think it would be useful in some situation if the range() function can take a third optional parameter (called "step" or whatever you want) which specifies the space between two consecutive elements in the resulting array. For example: $array = range(1, 5, 2); // array(1,3,5); It might be always positive to understand its effect easily. $array = range('Z', 'A', 3); // array('Z', 'W', 'T', 'Q', ...); If the second boundary cannot be included regarding to the step parameter, just simply leave it out: $array = range(1, 6, 2); // array(1,3,5); That's all. -- Edit this bug report at http://bugs.php.net/?id=15920&edit=1
#19654 [Opn->Fbk]: function to call class methods
ID: 19654 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Feedback Bug Type: Feature/Change Request Operating System: n/a PHP Version: 4.2.3 New Comment: Did you mean the same thing as how this script works? Previous Comments: [2002-09-28 17:30:46] [EMAIL PROTECTED] We have $$objname->$methodname() for dinamic method calls, and even call_user_func(array(&$$objname, $methodname), but we have no $classname::$methodname() or call_class_method($classname, $methodname) or anything like this. It would be nice to call class methods dinamicaly, as many times classes are used for namespace resons, and there is no need to have instances of them. -- Edit this bug report at http://bugs.php.net/?id=19654&edit=1
#17312 [NoF]: Build problem with GCC 3.1
ID: 17312 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: No Feedback Bug Type: MySQL related Operating System: Redhat 7.2 PHP Version: 4.2.1 New Comment: Be sure to use the latest version of binutils that matches the gcc version you are using. Previous Comments: [2003-02-06 17:40:53] [EMAIL PROTECTED] /usr/bin/ld: Dwarf Error: Invalid or unhandled FORM value: 14. ext/mysql/libmysql/my_tempnam.o: In function `my_tempnam': /local/src/php-4.3.0/ext/mysql/libmysql/my_tempnam.c:103: the use of `tempnam' is dangerous, better use `mkstemp' collect2: ld returned 1 exit status make: *** [sapi/cli/php] Error 1 Here's the gcc ver: gcc-2.96-98 gcc3-g77-3.0.4-1 gcc-g77-2.96-98 libgcc-3.0.4-1 gcc-chill-2.96-98 gcc3-3.0.4-1 gcc3-objc-3.0.4-1 gcc-c++-2.96-98 gcc-objc-2.96-98 gcc3-java-3.0.4-1 gcc-java-2.96-98 gcc3-c++-3.0.4-1 -- I'm not sure what the problem is. It seems that I have no problems with another machine, here's the gcc ver on that: gcc-chill-2.96-98 libgcc-3.0.1-3 gcc-g77-2.96-98 gcc-c++-2.96-98 gcc3-g77-3.0.1-3 gcc-java-2.96-98 gcc-2.96-98 gcc3-objc-3.0.1-3 gcc3-c++-3.0.1-3 gcc-objc-2.96-98 gcc3-3.0.1-3 gcc3-java-3.0.1-3 Both are redhat linux, eric [2003-01-08 01:17:00] [EMAIL PROTECTED] OS: linux mandrake 2.4.18 PHP: 4.3.0 i got the problem... again... my 4.2.3 make nicely. my 4.3.0 screw up with this error ext/mysql/libmysql/my_tempnam.o: In function `my_tempnam': /home/install/tmp/php-4.3.0/ext/mysql/libmysql/my_tempnam.c:103: the use of `tempnam' is dangerous, better use `mkstemp' can anyone tell me which files in my php-4.3.0/ext/mysql/ should i replace to re-fix the problem, please? thanks [2002-08-03 01:00:11] [EMAIL PROTECTED] No feedback was provided for this bug for over a month, 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". [2002-07-02 09:56:01] [EMAIL PROTECTED] Please try this snapshot: http://snaps.php.net/php4-latest.tar.gz (has updated bundled libmysql) [2002-05-29 23:56:23] [EMAIL PROTECTED] Is this something that could be caught when ./configure is run? My concern is that ./configure checks for tempnam successfully eventhough it will not link. However, since this seems to be the behavior of AC_CHECK_FUNCS there might not be anything to do. 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/17312 -- Edit this bug report at http://bugs.php.net/?id=17312&edit=1
#22126 [Fbk]: file uploads double in size
ID: 22126 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Feedback Bug Type: Apache2 related Operating System: linux PHP Version: 4.2.3 New Comment: Dupe of bug #19263, bug #21819 or bug #18648? Please check if your problem is the same as that one. Previous Comments: [2003-02-08 14:33:25] [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 [2003-02-08 14:31:18] [EMAIL PROTECTED] Files uploaded via PHP double in size and become corrupt when using the Apache 2 web server. This bug only applies to files larger than about 2K, smaller files arrive on the server unaffected. When the file is of a certain size, the file is filled with sets of duplicate data. This happens regardless of file type. Due to the fact that smaller files are unaffected, this bug is not always initially noticed. This bug occurred for me in a clean install of Redhat 8 using Apache 2 and PHP 4.2.3. Since posting to various news forums, however, I have received emails from other experiencing the same problem with various configurations of PHP and Apache2. -- Edit this bug report at http://bugs.php.net/?id=22126&edit=1
#22138 [Opn->Fbk]: File upload can't exceed 500k
ID: 22138 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Feedback Bug Type: Apache2 related Operating System: redhat linux 8.0 PHP Version: 4.2.2 New Comment: Please check if your httpd.conf has a LimitRequestBody directive to limit the amount of incoming data. Previous Comments: [2003-02-09 09:33:42] [EMAIL PROTECTED] Hi! I wrote a simple script to upload files through web sever. However, the script work fine with apache 1.3. As upgrading to redhat 8.0. The script can't upload files exceed 500k. It report "Request entity too large." I tried to change post_max_size, upload_max_filesize. It still can't work. Does someone can help me? Thanks! -- Edit this bug report at http://bugs.php.net/?id=22138&edit=1
#18926 [Opn]: cannot call self::method() or parent::method() via call_user_func_array()
ID: 18926 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Zend Engine 2 problem Operating System: OS X 10.1 PHP Version: 4CVS-2002-10-26 New Comment: Related to bug #21849 Previous Comments: [2002-10-29 19:16:16] [EMAIL PROTECTED] Wrong summary, cut & paste error. [2002-10-28 15:48:42] [EMAIL PROTECTED] Still doesn't work on ZE2. [2002-10-28 15:46:45] [EMAIL PROTECTED] If this is not a bug, then how exactly is one supposed to be able to make the function call self::method($a,$b,$etc) using call_user_func_array()??? or is that not supported? because this still doesn't work. a word or two of explanation would be polite. [2002-10-28 14:10:29] [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 [2002-08-15 21:09:04] [EMAIL PROTECTED] presuming ZE == ZE1.3.0, this is on a vanilla build from CVS (just checked it out, ran buildconf, then configure w/o options): gives you: # sapi/cli/php -v PHP 4.3.0-dev (cli), Copyright (c) 1997-2002 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies # sapi/cli/php ctest.php i am from foo: foo::from_foo i am from foo: call_user_func(array(foo,from_foo)) i am from foo: parent::from_foo Warning: call_user_func(): First argumented is expected to be a valid callback, 'parent::from_foo' was given in ctest.php on line 14 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/18926 -- Edit this bug report at http://bugs.php.net/?id=18926&edit=1
#21849 [Ver]: self::constant doesn't work as method's default parameter
ID: 21849 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Verified Bug Type: Zend Engine 2 problem Operating System: Windows 2000 PHP Version: 5CVS-2003-01-23 (dev) New Comment: Related to bug #18926 Previous Comments: [2003-01-23 16:51:05] [EMAIL PROTECTED] foobar(); ?> works, but foobar(); ?> does not and prints "Fatal error: Undefined class 'self' in c:\test.php on line 5". -- Edit this bug report at http://bugs.php.net/?id=21849&edit=1
#19973 [Opn->Csd]: compile zlib and pcre as shared fails
ID: 19973 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Closed Bug Type: Compile Failure Operating System: RedHat 7.2 (kernel 2.4.19) PHP Version: 4CVS-2002-10-18 New Comment: See bug #22136 & bug #22131 Previous Comments: [2002-11-27 23:08:00] [EMAIL PROTECTED] Same thing on Mandrake 9.0 [2002-10-18 05:37:21] [EMAIL PROTECTED] I've tried to complile additional modules for as shared with the latest snap (18.10.2002) http://snaps.php.net/php4-latest.tar.gz and the operation failed - the same with php version 4.2.3 produces all chosen modules without any problems here's what I've done: ./configure --with-apache=/usr/src/apache_1.3.27 --with-mysql=shared,/usr --enable-dba=shared --with-db3=/usr --with-gd=shared --with-zlib=shared,/usr --with-pcre-regex=shared --with-curl=shared,/usr --enable-bcmath=shared --enable-posix=shared --enable-calendar=shared --enable-ctype=shared --enable-filepro=shared --enable-shmop=shared --enable-sysvsem=shared --enable-sysvshm=shared --with-xml=shared --enable-wddx=shared --with-domxml=shared,/usr --enable-ftp=shared --enable-sockets=shared --enable-yp=shared --enable-dbase=shared --enable-exif=shared and then: make and I've got this error: ext/standard/image.o: In function `php_handle_swc': /usr/src/php-4.3.0-021018/ext/standard/image.c:222: undefined reference to `uncompress' /usr/src/php-4.3.0-021018/ext/standard/image.c:242: undefined reference to `uncompress' ext/standard/aggregation.o: In function `aggregate_methods': /usr/src/php-4.3.0-021018/ext/standard/aggregation.c:103: undefined reference to `pcre_get_compiled_regex' /usr/src/php-4.3.0-021018/ext/standard/aggregation.c:126: undefined reference to `php_pcre_exec' ext/standard/aggregation.o: In function `aggregate_properties': /usr/src/php-4.3.0-021018/ext/standard/aggregation.c:209: undefined reference to `pcre_get_compiled_regex' /usr/src/php-4.3.0-021018/ext/standard/aggregation.c:232: undefined reference to `php_pcre_exec' main/SAPI.o: In function `sapi_header_op': /usr/src/php-4.3.0-021018/main/SAPI.c:519: undefined reference to `zlib_globals' main/SAPI.o: In function `sapi_send_headers': /usr/src/php-4.3.0-021018/main/SAPI.c:668: undefined reference to `zlib_globals' /usr/src/php-4.3.0-021018/main/SAPI.c:669: undefined reference to `zlib_globals' collect2: ld returned 1 exit status make: *** [sapi/cli/php] Error 1 without options: --with-zlib=shared,/usr --with-pcre-regex=shared the whole thing compiles fine -- Edit this bug report at http://bugs.php.net/?id=19973&edit=1