Bug #60828 [Opn->Bgs]: crash with specific php.ini
Edit report at https://bugs.php.net/bug.php?id=60828&edit=1 ID: 60828 Updated by: paj...@php.net Reported by:bugzilla33 at gmail dot com Summary:crash with specific php.ini -Status: Open +Status: Bogus Type: Bug Package:Reproducible crash Operating System: Win 7 32/64 bit PHP Version:5.4.0RC6 Block user comment: N Private report: N New Comment: It is not a crash but a configuration. mbstring has to be loaded before exif. That means you have to put extension=php_mbstring.dll before extension=php_exif.dll Also cannot reproduce any crash using header. Double check your error log for the actual error message. Previous Comments: [2012-01-21 01:29:32] anon at anon dot anon A possibly related issue: it also crashes with php_exif.dll listed before php_mbstring.dll. It has done for years. [2012-01-20 21:39:02] bugzilla33 at gmail dot com Description: 1. use Apache 2.2.21 VC9 2. download http://windows.php.net/downloads/qa/php-5.4.0RC6-Win32-VC9-x86.zip 3. unpack to c:\php5\ 4. use php.ini-production -> php.ini 5. change php.ini: extension_dir = "c:\php5\ext" extension=php_gd2.dll extension=php_mbstring.dll extension=php_openssl.dll extension=php_sockets.dll 6. or download php.ini from http://host0001.webd.pl/bugs/php/crash.zip 7. restart apache 8. run test script Test script: --- http://php.net/'); ?> or Expected result: no crush like 5.4 RC4 - bug introduced in PHP 5.4 RC5 Actual result: -- crush on first (second) script run after apache restart -- Edit this bug report at https://bugs.php.net/bug.php?id=60828&edit=1
Bug #60828 [Com]: crash with specific php.ini
Edit report at https://bugs.php.net/bug.php?id=60828&edit=1 ID: 60828 Comment by: bugzilla33 at gmail dot com Reported by:bugzilla33 at gmail dot com Summary:crash with specific php.ini Status: Bogus Type: Bug Package:Reproducible crash Operating System: Win 7 32/64 bit PHP Version:5.4.0RC6 Block user comment: N Private report: N New Comment: I do not understand - in my case php_exif.dll is not loaded. I will test this bug on Monday on another machine. Previous Comments: [2012-01-21 09:28:05] paj...@php.net It is not a crash but a configuration. mbstring has to be loaded before exif. That means you have to put extension=php_mbstring.dll before extension=php_exif.dll Also cannot reproduce any crash using header. Double check your error log for the actual error message. [2012-01-21 01:29:32] anon at anon dot anon A possibly related issue: it also crashes with php_exif.dll listed before php_mbstring.dll. It has done for years. [2012-01-20 21:39:02] bugzilla33 at gmail dot com Description: 1. use Apache 2.2.21 VC9 2. download http://windows.php.net/downloads/qa/php-5.4.0RC6-Win32-VC9-x86.zip 3. unpack to c:\php5\ 4. use php.ini-production -> php.ini 5. change php.ini: extension_dir = "c:\php5\ext" extension=php_gd2.dll extension=php_mbstring.dll extension=php_openssl.dll extension=php_sockets.dll 6. or download php.ini from http://host0001.webd.pl/bugs/php/crash.zip 7. restart apache 8. run test script Test script: --- http://php.net/'); ?> or Expected result: no crush like 5.4 RC4 - bug introduced in PHP 5.4 RC5 Actual result: -- crush on first (second) script run after apache restart -- Edit this bug report at https://bugs.php.net/bug.php?id=60828&edit=1
Bug #56213 [Opn->Bgs]: tidy.so not recognized as a valid Zend Extension
Edit report at https://bugs.php.net/bug.php?id=56213&edit=1 ID: 56213 Updated by: nlop...@php.net Reported by:nicolas dot guennoc at edf dot fr Summary:tidy.so not recognized as a valid Zend Extension -Status: Open +Status: Bogus Type: Bug -Package:tidy +Package:*General Issues Operating System: Linux RH 7.2 PHP Version:4.3.3 Block user comment: N Private report: N New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. Previous Comments: [2004-10-12 10:06:58] nicolas dot guennoc at edf dot fr Description: Hello, I can't load the tidy php extension. Here is a description of the employed versions of the softwares : - Apache 2.0.49 - PHP 4.3.5 - Linux RedHat 7.2 - tidy-02October2003-1 (RPM build from the last sources of tidy) Here is my PHP configuration line : './configure' '--prefix=/logiciels/apache/apa_2.0.49/php_4.3.5' '--enable-calendar' '--with-config-file-path=/logiciels/apache/apa_2.0.49/php_4.3.5' '--with-apxs2=/logiciels/apache/apa_2.0.49/bin/apxs' '--with-dom=/logiciels/apache/apa_2.0.49/lib/libxml2_2.6.4' '--with-zlib-dir=/logiciels/apache/apa_2.0.49/lib/zlib_1.2.1' '--with-zlib=/logiciels/apache/apa_2.0.49/lib/zlib_1.2.1' '--with-gd' '--enable-gd-native-ttf' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-dom-xslt=/logiciels/apache/apa_2.0.49/lib/libxslt_1.1.2' '--with-dom-exslt=/logiciels/apache/apa_2.0.49/lib/libxslt_1.1.2' '--with-ldap=/logiciels/apache/apa_2.0.49/lib/old_2.1.22' '--with-mysql=/logiciels/apache/apa_2.0.49/lib/sql_4.0.18' '--with-mm=/logiciels/apache/apa_2.0.49/lib/mm_1.3.0' '--with-iconv=/logiciels/apache/apa_2.0.49/lib/libiconv_1.9.1' '--with-openssl-dir=/logiciels/apache/apa_2.0.49/lib/openssl_0.9.7c' '--with-openssl=/logiciels/apache/apa_2.0.49/lib/openssl_0.9.7c' '--enable-ftp' '--enable-sockets' '--enable-static' '--disable-shared' '--enable-memory-limit'. i've tried the following installations of the extension : - pear installation of tidy 1.1 (using a local download archive, can't go through the auth proxy) - pear installation of tidy 1.0 (using a local download archive, can't go through the auth proxy) - manual installation of tidy 1.1 - manual installation of tidy 1.0 none of them worked. BTW, i'm also using xdebug and mmcache on this installation and they're both working. php.ini : ... Zend_extension="/logiciels/apache/apa_2.0.49/php_4.3.5/lib/php/extensions/no-debug-non-zts-20020429/xdebug.so" Zend_extension="/logiciels/apache/apa_2.0.49/php_4.3.5/lib/php/extensions/no-debug-non-zts-20020429/mmcache.so" Zend_extension="/logiciels/apache/apa_2.0.49/php_4.3.5/lib/php/extensions/no-debug-non-zts-20020429/tidy.so" ... If you wish, i can send you my compiled versions of tidy.so for esasier debugging. Yours sincerely, NG Reproduce code: --- Expected result: Tidy Module loaded and available Actual result: -- Here is the error shown in the error log : /logiciels/apache/apa_2.0.49/php_4.3.5/lib/php/extensions/no-debug-non-zts-20020429/tidy.so doesn't appear to be a valid Zend extension -- Edit this bug report at https://bugs.php.net/bug.php?id=56213&edit=1
[PHP-BUG] Req #60831 [NEW]: Optimization
From: Operating system: no matter PHP version: 5.4.0RC6 Package: *Programming Data Structures Bug Type: Feature/Change Request Bug description:Optimization Description: First sorry for my English, it's not perfect. In this case if($a==1 and $b==2) { echo 'hello there'; } I think $b==2 checking is unnecessary if $a==1 it's not true. PHP will be faster. -- Edit bug report at https://bugs.php.net/bug.php?id=60831&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60831&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60831&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60831&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60831&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60831&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60831&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60831&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60831&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60831&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60831&r=support Expected behavior: https://bugs.php.net/fix.php?id=60831&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60831&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60831&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60831&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60831&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=60831&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60831&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60831&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60831&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60831&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60831&r=mysqlcfg
Req #60831 [Opn->Bgs]: Optimization
Edit report at https://bugs.php.net/bug.php?id=60831&edit=1 ID: 60831 Updated by: dtajchre...@php.net Reported by:iivanov2 at yahoo dot com Summary:Optimization -Status: Open +Status: Bogus Type: Feature/Change Request Package:*Programming Data Structures Operating System: no matter PHP Version:5.4.0RC6 Block user comment: N Private report: N New Comment: PHP already does this. [1] http://us.php.net/manual/en/language.operators.logical.php [2] http://en.wikipedia.org/wiki/Short-circuit_evaluation Previous Comments: [2012-01-21 14:09:39] iivanov2 at yahoo dot com Description: First sorry for my English, it's not perfect. In this case if($a==1 and $b==2) { echo 'hello there'; } I think $b==2 checking is unnecessary if $a==1 it's not true. PHP will be faster. -- Edit this bug report at https://bugs.php.net/bug.php?id=60831&edit=1
[PHP-BUG] Req #60832 [NEW]: run webserver in silent-mode for script
From: Operating system: winXP PHP version: 5.4.0RC6 Package: Built-in web server Bug Type: Feature/Change Request Bug description:run webserver in silent-mode for script Description: I want to run the built-in Webserver in silent Mode. Why? I love the ultramicro built-in-server to execute some scripts written in php by browsing an ultramicro-website or to generate file-overview to browse in. The php-win isn't able to run that built-in server and so its not possible to run that server real quitly in background. All i want is the built-in-server functions without that annoying cli-window :) So please add the builtin-webserver in the php-win.exe!! -- Edit bug report at https://bugs.php.net/bug.php?id=60832&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60832&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60832&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60832&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60832&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60832&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60832&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60832&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60832&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60832&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60832&r=support Expected behavior: https://bugs.php.net/fix.php?id=60832&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60832&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60832&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60832&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60832&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=60832&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60832&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60832&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60832&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60832&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60832&r=mysqlcfg
Bug #60825 [Ctl]: Segfault when running symfony 2 tests
Edit report at https://bugs.php.net/bug.php?id=60825&edit=1 ID: 60825 Updated by: larue...@php.net Reported by:php at wallbash dot com Summary:Segfault when running symfony 2 tests Status: Critical Type: Bug Package:Reproducible crash Operating System: Ubuntu 10.04.3 LTS PHP Version:5.4.0RC6 Assigned To:stas Block user comment: N Private report: N New Comment: fixed in trunk, will commit to branch when I got the permission from stas, and a simple reproduce script: http://svn.php.net/viewvc/?view=revision&revision=322541 Log: Fixed bug #60825 (Segfault when running symfony 2 tests) [2012-01-21 07:52:38] php at wallbash dot com Yes. It is that function that cases the crash rasmus. Compiling php-5.4 from current SVN the tests run just fine :) Regards, Edorian [2012-01-21 05:23:50] ras...@php.net Can you try reproducing with the current svn code? I went through the reproduce steps and the unit tests ran to completion for me. However, under Valgrind I did get some complaints for one of the tests. Can you tell if your crash is on this same test? Starting test 'Symfony\Bundle\SecurityBundle\Tests\Functional\FormLoginTest::testFormLogin with data set #0 ('config.yml')'. ==24587== Conditional jump or move depends on uninitialised value(s) ==24587==at 0x9DE434: zend_call_function (zend_execute_API.c:925) ==24587==by 0xA128C3: zend_call_method (zend_interfaces.c:97) ==24587==by 0xA2BAE6: zend_std_cast_object_tostring (zend_object_handlers.c:1494) ==24587==by 0x9E582A: _convert_to_string (zend_operators.c:588) ==24587==by 0xB05BB6: ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER (zend_vm_execute.h:27073) ==24587==by 0xA342CC: execute (zend_vm_execute.h:410) ==24587==by 0x9DE67C: zend_call_function (zend_execute_API.c:958) ==24587==by 0x74F4C9: zim_reflection_method_invokeArgs (php_reflection.c:2926) ==24587==by 0xA35C22: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:642) ==24587==by 0xA36C1E: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:752) ==24587==by 0xA342CC: execute (zend_vm_execute.h:410) ==24587==by 0x9F2AEF: zend_execute_scripts (zend.c:1272) ==24587== ==24587== Conditional jump or move depends on uninitialised value(s) ==24587==at 0x9DBB70: _zval_ptr_dtor (zend_execute_API.c:433) ==24587==by 0x9DED15: zend_call_function (zend_execute_API.c:1019) ==24587==by 0xA128C3: zend_call_method (zend_interfaces.c:97) ==24587==by 0xA2BAE6: zend_std_cast_object_tostring (zend_object_handlers.c:1494) ==24587==by 0x9E582A: _convert_to_string (zend_operators.c:588) ==24587==by 0xB05BB6: ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER (zend_vm_execute.h:27073) ==24587==by 0xA342CC: execute (zend_vm_execute.h:410) ==24587==by 0x9DE67C: zend_call_function (zend_execute_API.c:958) ==24587==by 0x74F4C9: zim_reflection_method_invokeArgs (php_reflection.c:2926) ==24587==by 0xA35C22: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:642) ==24587==by 0xA36C1E: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:752) ==24587==by 0xA342CC: execute (zend_vm_execute.h:410) ==24587== ==24587== Conditional jump or move depends on uninitialised value(s) ==24587==at 0x9DBC28: _zval_ptr_dtor (zend_execute_API.c:444) ==24587==by 0x9DED15: zend_call_function (zend_execute_API.c:1019) ==24587==by 0xA128C3: zend_call_method (zend_interfaces.c:97) ==24587==by 0xA2BAE6: zend_std_cast_object_tostring (zend_object_handlers.c:1494) ==24587==by 0x9E582A: _convert_to_string (zend_operators.c:588) ==24587==by 0xB05BB6: ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER (zend_vm_execute.h:27073) ==24587==by 0xA342CC: execute (zend_vm_execute.h:410) ==24587==by 0x9DE67C: zend_call_function (zend_execute_API.c:958) ==24587==by 0x74F4C9: zim_reflection_method_invokeArgs (php_reflection.c:2926) ==24587==by 0xA35C22: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:642) ==24587==by 0xA36C1E: ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (zend_vm_execute.h:752) ==24587==by 0xA342CC: execute (zend_vm_execute.h:410) [2012-01-21 04:59:45] ras...@php.net Stas, this looks like a blocker for 5.4 [2012-01-20 20:20:21] php at wallbash dot com Description: First off: Sorry not being able to provide a better reproduce. I tried to dig into symfony but failed as I'm not familiar with it. I was testing phpunit against frameworks when I found this. Running the symfony 2 test suite with RC6 leads to a segfault that I had across two machines so I'll open this just in case it helps out and ask sf people
Bug #60786 [Opn->Bgs]: Force seeding to srand different numbers still gives the same random number
Edit report at https://bugs.php.net/bug.php?id=60786&edit=1 ID: 60786 Updated by: ras...@php.net Reported by:jazzerman at gmail dot com Summary:Force seeding to srand different numbers still gives the same random number -Status: Open +Status: Bogus Type: Bug Package:*General Issues PHP Version:Irrelevant Block user comment: N Private report: N New Comment: Yes, no bug here. There are plenty of seeds that lead to the same initial random number. You will notice, however, that the second number in the sequence is different across the 2 seeds. Previous Comments: [2012-01-18 06:17:05] phpmpan at mpan dot pl With 5.3.9 on Arch64 I'm getting 266557046 in both cases. Pair 53923 and 40348 causes the same bahaviour. And I believe there are many more. But none of this cases indicate a problem. It's normal that values are repeating in sequences. [2012-01-18 05:53:28] anon at anon dot anon I get this: 898434 822276816 351663 561490788 (Windows/PHP 5.3.2) [2012-01-18 03:29:13] phpmpan at mpan dot pl I see no reason to assume that two pseudorandom sequences don't contain common values. "Random" doesn't mean that values in a single sequence or a set of sequences can't repeat. In fact it's perfectly normal and expected that the do share some elements. Othwerwise they would not be pseudorandom anymore. I must admit, however, that you're quite lucky guy. Finding by accident two different sequences that share a common element at the same position and, what's more interesting, it is the first element. What made you selecting 822276816 and 561490788 as the seeds? [2012-01-17 23:06:36] jazzerman at gmail dot com Description: srand( 822276816 ); $a = rand(123456, 987654); echo $a; echo "\n"; echo '822276816'; echo "\n"; srand( 561490788 ); $a = rand(123456, 987654); echo $a; echo "\n"; echo '561490788'; echo "\n"; Test script: --- Expected result: Since I'm seeding to srand different integers, it should echo two different random numbers. Actual result: -- It echos the same numbers even when seeding to srand two different integers -- Edit this bug report at https://bugs.php.net/bug.php?id=60786&edit=1
Bug #60828 [Com]: crash with specific php.ini
Edit report at https://bugs.php.net/bug.php?id=60828&edit=1 ID: 60828 Comment by: anon at anon dot anon Reported by:bugzilla33 at gmail dot com Summary:crash with specific php.ini Status: Bogus Type: Bug Package:Reproducible crash Operating System: Win 7 32/64 bit PHP Version:5.4.0RC6 Block user comment: N Private report: N New Comment: @pajoye Fix it then so that the internal loading order is not strictly tied to the order in php.ini. By the way, they're listed in the ini file in the broken order by default. Previous Comments: [2012-01-21 10:35:04] bugzilla33 at gmail dot com I do not understand - in my case php_exif.dll is not loaded. I will test this bug on Monday on another machine. [2012-01-21 09:28:05] paj...@php.net It is not a crash but a configuration. mbstring has to be loaded before exif. That means you have to put extension=php_mbstring.dll before extension=php_exif.dll Also cannot reproduce any crash using header. Double check your error log for the actual error message. [2012-01-21 01:29:32] anon at anon dot anon A possibly related issue: it also crashes with php_exif.dll listed before php_mbstring.dll. It has done for years. [2012-01-20 21:39:02] bugzilla33 at gmail dot com Description: 1. use Apache 2.2.21 VC9 2. download http://windows.php.net/downloads/qa/php-5.4.0RC6-Win32-VC9-x86.zip 3. unpack to c:\php5\ 4. use php.ini-production -> php.ini 5. change php.ini: extension_dir = "c:\php5\ext" extension=php_gd2.dll extension=php_mbstring.dll extension=php_openssl.dll extension=php_sockets.dll 6. or download php.ini from http://host0001.webd.pl/bugs/php/crash.zip 7. restart apache 8. run test script Test script: --- http://php.net/'); ?> or Expected result: no crush like 5.4 RC4 - bug introduced in PHP 5.4 RC5 Actual result: -- crush on first (second) script run after apache restart -- Edit this bug report at https://bugs.php.net/bug.php?id=60828&edit=1
Bug #60828 [Bgs]: crash with specific php.ini
Edit report at https://bugs.php.net/bug.php?id=60828&edit=1 ID: 60828 Updated by: paj...@php.net Reported by:bugzilla33 at gmail dot com Summary:crash with specific php.ini Status: Bogus Type: Bug Package:Reproducible crash Operating System: Win 7 32/64 bit PHP Version:5.4.0RC6 Block user comment: N Private report: N New Comment: You are welcome to contribute a patch. However there is no crash but a warning, as I told you already, check your logs. Previous Comments: [2012-01-21 19:21:18] anon at anon dot anon @pajoye Fix it then so that the internal loading order is not strictly tied to the order in php.ini. By the way, they're listed in the ini file in the broken order by default. [2012-01-21 10:35:04] bugzilla33 at gmail dot com I do not understand - in my case php_exif.dll is not loaded. I will test this bug on Monday on another machine. [2012-01-21 09:28:05] paj...@php.net It is not a crash but a configuration. mbstring has to be loaded before exif. That means you have to put extension=php_mbstring.dll before extension=php_exif.dll Also cannot reproduce any crash using header. Double check your error log for the actual error message. [2012-01-21 01:29:32] anon at anon dot anon A possibly related issue: it also crashes with php_exif.dll listed before php_mbstring.dll. It has done for years. [2012-01-20 21:39:02] bugzilla33 at gmail dot com Description: 1. use Apache 2.2.21 VC9 2. download http://windows.php.net/downloads/qa/php-5.4.0RC6-Win32-VC9-x86.zip 3. unpack to c:\php5\ 4. use php.ini-production -> php.ini 5. change php.ini: extension_dir = "c:\php5\ext" extension=php_gd2.dll extension=php_mbstring.dll extension=php_openssl.dll extension=php_sockets.dll 6. or download php.ini from http://host0001.webd.pl/bugs/php/crash.zip 7. restart apache 8. run test script Test script: --- http://php.net/'); ?> or Expected result: no crush like 5.4 RC4 - bug introduced in PHP 5.4 RC5 Actual result: -- crush on first (second) script run after apache restart -- Edit this bug report at https://bugs.php.net/bug.php?id=60828&edit=1
[PHP-BUG] Bug #60833 [NEW]: self, parent, static behave inconsistently case-sensitive
From: Operating system: Linux PHP version: 5.4.0RC6 Package: Scripting Engine problem Bug Type: Bug Bug description:self, parent, static behave inconsistently case-sensitive Description: "parent" and "self", "static" LSB tokens behave inconsistent when it comes to case-sensitivity. Class names in PHP are case-insensitive, but these three keywords aren't always, as the parser sees them as raw T_STRINGs. That is, you cannot do `SELF::CNST` or `SELF::$VAR` or `SELF::METHOD()` But it's possible to use `constant("SELF::CNST")` or `call_user_func` with uppercase `SELF` keyword. Likewise do you get an error message for `class SELF {}` declarations, even if the other error messages indicate the uppercase class name wasn't reserved. Patch: It's just a matter of exchanging `memcmp` against `strncasecmp` in `zend_get_class_fetch_type`. Not sure if that is a sufficient substition though. It works well, and all comparisons are shadowed by a length check anyway, so little worries about NUL byte length discrepancies. Performance: No idea. This affects the parser, hard to test without memory exhausting script (eval to redeclare classes). But in clang build no measurable difference (again, pointless test with only x1 runs). Should this be fixed? Well, of course. This might not matter to most people, never run into this myself IIRC, but it does in fact come up as issue occasionally: http://stackoverflow.com/questions/8953208/fatal-error-class-self-not-found Also because it's not mentioned in the manual yet. http://www.php.net/manual/en/language.oop5.late-static-bindings.php (I shall commit a note there myself...) And of course, the whole PHP 5.3 series doesn't support it. But that doesn't mean it shouldn't be normalized in later versions, specifically the upcoming 5.4. ("Never too later to fix a mistake.." bla bla) Test script: --- class a { const C = "C"; function __construct() { print SELF::C; } } new a; -- Edit bug report at https://bugs.php.net/bug.php?id=60833&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60833&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60833&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60833&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60833&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60833&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60833&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60833&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60833&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60833&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60833&r=support Expected behavior: https://bugs.php.net/fix.php?id=60833&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60833&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60833&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60833&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60833&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=60833&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60833&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60833&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60833&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60833&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60833&r=mysqlcfg
[PHP-BUG] Req #60836 [NEW]: Improve array_intersect_key performance
From: Operating system: PHP version: Irrelevant Package: Arrays related Bug Type: Feature/Change Request Bug description:Improve array_intersect_key performance Description: The trivial test script below runs longer than the extpected "instant" execution (lot longer). This is because the algorithm walks the first argument and looks up the key in every other array supplied as an argument. Instead it should walk the shortest array given, and look up the keys in every other array. Maybe this issue or similar ones also apply to other array functions, which perform set operations, but I have not checked the code of them. Of course the optimization could be done in userland, but that feels not right. Test script: --- $arr = array_fill(0, 100, '...'); $i = 1000; while($i--) { array_intersect_key($arr, array()); } -- Edit bug report at https://bugs.php.net/bug.php?id=60836&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60836&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60836&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60836&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60836&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60836&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60836&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60836&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60836&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60836&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60836&r=support Expected behavior: https://bugs.php.net/fix.php?id=60836&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60836&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60836&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60836&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60836&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=60836&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60836&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60836&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60836&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60836&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60836&r=mysqlcfg