Bug #55061 [Com]: Array autoindex[] overflow
Edit report at https://bugs.php.net/bug.php?id=55061&edit=1 ID: 55061 Comment by: larue...@php.net Reported by:vovan-ve at yandex dot ru Summary:Array autoindex[] overflow Status: Open Type: Bug Package:Arrays related Operating System: WindowsXP SP3 PHP Version:5.3.6 Block user comment: N Private report: N New Comment: I can not reproduce this warning, do you have non-php-official extension installed? if yes, plz remove them then check again. thanks Previous Comments: [2011-06-29 06:03:07] vovan-ve at yandex dot ru Sorry for typo. var_dymp == var_dump [2011-06-29 04:47:05] vovan-ve at yandex dot ru Description: There is a test code: $a = array(0x7FFF => 42); $a[] = 37; var_dymp($a); Second line emits warning: Warning: Cannot add element to the array as the next element is already occupied in ... on line 2 and doesn't add element with value 37. This is absolutely abnormal behaviour. At least there is incorrect text for Warning. I expect, the element should be added with any index (i.e. string "2147483648" as the result of 0x7FFF+1 thru float), or something else. But element was not added even. Test script: --- $a = array(0x7FFF => 42); $a[] = 37; var_dymp($a); Expected result: array(1) { [2147483647]=> int(42) ["2147483648"]=> int(37) } OR (when int will become int64): array(1) { [2147483647]=> int(42) [2147483648]=> int(37) } Actual result: -- Warning: Cannot add element to the array as the next element is already occupied in ... on line 2 array(1) { [2147483647]=> int(42) } -- Edit this bug report at https://bugs.php.net/bug.php?id=55061&edit=1
Bug #55277 [Com]: After OS X Lion upgrade, file_get_contents issues a warning
Edit report at https://bugs.php.net/bug.php?id=55277&edit=1 ID: 55277 Comment by: larue...@php.net Reported by:michaelozeryansky at hotmail dot com Summary:After OS X Lion upgrade, file_get_contents issues a warning Status: Open Type: Bug Package:*Network Functions Operating System: OS X Lion PHP Version:5.3.6 Block user comment: N Private report: N New Comment: Please check that your nameserver is running and setup correctly. Check the same with your internet server. Previous Comments: [2011-07-24 19:10:49] michaelozeryansky at hotmail dot com Description: After I upgraded to Mac OS X Lion, my php script issues a warning for file_get_contents(). If I run the script a second time, there's no warnings. This script runs when I open my browser to check if I'm logged into my schools network. Then if I'm not logged in, it uses curl to log in. but the problem is with file_get_contents(). I did test getaddrinfo() in a cpp program. When I used "http://www.google.com"; it fails with the same error as php displays, but when I use "www.google.com" it succeeds. This didn't happen before, but could this be the problem? Then again the example on php.net is: http://www.example.com/'); echo $homepage; ?> Test script: --- http://www.google.com/";); ?> Expected result: No warnings, like when I had OS X Snow Leopard. Actual result: -- Warning: file_get_contents() [function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in /Users/michael/Sites/personal/homepage.php on line 3 Warning: file_get_contents(http://www.google.com/) [function.file-get-contents]: failed to open stream: php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in /Users/michael/Sites/personal/homepage.php on line 3 -- Edit this bug report at https://bugs.php.net/bug.php?id=55277&edit=1
Bug #55288 [Com]: usort segfaults
Edit report at https://bugs.php.net/bug.php?id=55288&edit=1 ID: 55288 Comment by: larue...@php.net Reported by:jstephens at qualtrics dot com Summary:usort segfaults Status: Open Type: Bug Package:Arrays related Operating System: Linux PHP Version:5.3.6 Block user comment: N Private report: N New Comment: I can not reproduce the segfault with your test script in my envrion, and I noticed that you have xdebug install in, plz remove all other php extensions then check if this bug exists again, thanks Previous Comments: [2011-07-26 19:19:42] jstephens at qualtrics dot com Description: usort and uksort (and possibly other related functions) will segfault with the given script. I believe it is related to Zend's internal array "copy-on-write". Test script: --- class X { function __construct($v) { $this->v = $v; } } function sortIt(&$list) { usort($list, function($a, $b) use ($list) { return $a->v - $b->v; }); } $list = array(); for($i = 0; $i < 10; ++$i) $list[mt_rand()] = new X(mt_rand()); echo "Sort..."; sortIt($list); gc_collect_cycles();//segfault echo "pass.\n"; Expected result: "Sort...pass." Actual result: -- "Sort...Segmentation fault" [dev@box dev]$ php --version PHP 5.3.6 (cli) (built: Mar 17 2011 19:14:03) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies with Xdebug v2.1.1, Copyright (c) 2002-2011, by Derick Rethans [dev@box dev]$ gdb php Reading symbols from /usr/bin/php...(no debugging symbols found)...done. (gdb) run usortCrash.php Starting program: /usr/bin/php usortCrash.php [Thread debugging using libthread_db enabled] Sort... Program received signal SIGSEGV, Segmentation fault. 0x005db586 in ?? () (gdb) bt #0 0x005db586 in ?? () #1 0x005db610 in ?? () #2 0x005dbef5 in gc_collect_cycles () #3 0x005cee1d in ?? () #4 0x2e139d0a in xdebug_execute_internal () from /usr/lib64/php/modules/xdebug.so #5 0x005e669d in ?? () #6 0x005e5dcb in execute () #7 0x2e13998e in xdebug_execute () from /usr/lib64/php/modules/xdebug.so #8 0x005bf395 in zend_execute_scripts () #9 0x0056f628 in php_execute_script () #10 0x00648ce0 in ?? () #11 0x0033ad41d994 in __libc_start_main () from /lib64/libc.so.6 #12 0x00422009 in _start () -- Edit this bug report at https://bugs.php.net/bug.php?id=55288&edit=1
Req #55128 [Ana]: SplFixedArray::fromArray() does not use extended class
Edit report at https://bugs.php.net/bug.php?id=55128&edit=1 ID: 55128 User updated by:ar at ez dot no Reported by:ar at ez dot no Summary:SplFixedArray::fromArray() does not use extended class Status: Analyzed Type: Feature/Change Request Package:SPL related Operating System: * PHP Version:5.3.6 Block user comment: N Private report: N New Comment: that sounds like potentially breaking code. cant see the patch from here(surfing on kindle while on vacation), but isn`t it something like "new static()" that can be used? Previous Comments: [2011-07-26 10:10:24] larue...@php.net After much thought, I think there maybe no reason for fixedarray extended class to define it's own constructor, since we provide fixedarrary::__construct and fromArray already, and extended class should only get an instance through calling them. so I think we can make fixedarray::__construct final to make this feature works. [2011-07-26 09:57:47] larue...@php.net The following patch has been added/updated: Patch Name: php-5-3-splfixedarray-fromarray-should-return-call-scope-instance Revision: 1311674267 URL: https://bugs.php.net/patch-display.php?bug=55128&patch=php-5-3-splfixedarray-fromarray-should-return-call-scope-instance&revision=1311674267 [2011-07-26 09:49:52] larue...@php.net hmm, that's a really problem, if we want to provide this feature, we should make fixedarray::__construct final. [2011-07-26 08:36:08] cataphr...@php.net What if FixedCollection has a constructor? [2011-07-26 05:35:55] larue...@php.net The following patch has been added/updated: Patch Name: php-5-3-splfixedarray-fromarray-should-return-call-scope-instance Revision: 1311658555 URL: https://bugs.php.net/patch-display.php?bug=55128&patch=php-5-3-splfixedarray-fromarray-should-return-call-scope-instance&revision=1311658555 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 https://bugs.php.net/bug.php?id=55128 -- Edit this bug report at https://bugs.php.net/bug.php?id=55128&edit=1
Req #55247 [PATCH]: Parser problem with static calls using string method name
Edit report at https://bugs.php.net/bug.php?id=55247&edit=1 ID: 55247 Patch added by: pierr...@php.net Reported by:gehrig at teqneers dot de Summary:Parser problem with static calls using string method name Status: Open Type: Feature/Change Request Package:*General Issues Operating System: Darwin 10.8.0 PHP Version:5.3.6 Block user comment: N Private report: N New Comment: The following patch has been added/updated: Patch Name: 55247.diff Revision: 1311742018 URL: https://bugs.php.net/patch-display.php?bug=55247&patch=55247.diff&revision=1311742018 Previous Comments: [2011-07-22 18:53:20] fel...@php.net It isn't supposed to work, so not a bug. Changed to feature request. [2011-07-20 05:55:26] gehrig at teqneers dot de Description: PHP allows to call instance methods using the {} syntax together with a string - such as $obj->{'my-method'} for example. This allows developers to call methods whose names are not valid PHP method names. The same does not work with static method calls. Test script: --- method(); $test->$method(); $test->{'method'}(); Test::method(); Test::$method(); Test::{'method'}(); Expected result: method method method method method method Actual result: -- PHP Parse error: syntax error, unexpected '{', expecting T_STRING or T_VARIABLE or '$' in Untitled.php on line 21 -- Edit this bug report at https://bugs.php.net/bug.php?id=55247&edit=1
Bug #48615 [Com]: Will not install. Exits with error 2711
Edit report at https://bugs.php.net/bug.php?id=48615&edit=1 ID: 48615 Comment by: edub at scripturechannel dot org Reported by:codeblock at eighthbit dot net Summary:Will not install. Exits with error 2711 Status: Closed Type: Bug Package:Windows Installer Operating System: Windows XP PHP Version:6CVS-2009-06-20 (snap) Assigned To:jmertic Block user comment: N Private report: N New Comment: I had this same problem.. I found that it was because I was installing the NON thread safe version of PHP... when I downloaded the Thread Safe Version it worked fine. Previous Comments: [2010-03-25 19:05:53] jmer...@php.net Closing since 6.0 as we knew it is gone and the snaps are down. [2010-01-01 15:47:54] uwe_markus at hotmail dot com === Verbose logging started: 01.01.2010 16:42:56 Build type: SHIP UNICODE 5.00.7600.00 Calling process: C:\Windows\system32\msiexec.exe === MSI (c) (0C:44) [16:42:56:672]: Font created. Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg MSI (c) (0C:44) [16:42:56:672]: Font created. Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg MSI (c) (0C:A0) [16:42:56:703]: Resetting cached policy values MSI (c) (0C:A0) [16:42:56:703]: Machine policy value 'Debug' is 0 MSI (c) (0C:A0) [16:42:56:703]: *** RunEngine: *** Product: php-5.3-nts-win32-VC9-x64-latest.msi *** Action: *** CommandLine: ** MSI (c) (0C:A0) [16:42:56:703]: Machine policy value 'DisableUserInstalls' is 0 MSI (c) (0C:A0) [16:42:56:719]: Note: 1: 1402 2: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\E xplorer 3: 2 MSI (c) (0C:A0) [16:42:56:719]: SOFTWARE RESTRICTION POLICY: Verifying package --> 'C:\Users\Administrator\Desktop\PHP\php-5.3-nts-win32-VC9- x64-latest.msi' against software restriction policy MSI (c) (0C:A0) [16:42:56:719]: Note: 1: 2262 2: DigitalSignature 3: - 2147287038 MSI (c) (0C:A0) [16:42:56:719]: SOFTWARE RESTRICTION POLICY: C:\Users\Administrator\Desktop\PHP\php-5.3-nts-win32-VC9-x64- latest.msi is not digitally signed MSI (c) (0C:A0) [16:42:56:719]: SOFTWARE RESTRICTION POLICY: C:\Users\Administrator\Desktop\PHP\php-5.3-nts-win32-VC9-x64- latest.msi is permitted to run at the 'unrestricted' authorization level. MSI (c) (0C:A0) [16:42:56:719]: Cloaking enabled. MSI (c) (0C:A0) [16:42:56:719]: Attempting to enable all disabled privileges before calling Install on Server MSI (c) (0C:A0) [16:42:56:734]: End dialog not enabled MSI (c) (0C:A0) [16:42:56:734]: Original package ==> C:\Users\Administrator\Desktop\PHP\php-5.3-nts-win32-VC9-x64- latest.msi MSI (c) (0C:A0) [16:42:56:734]: Package we're running from ==> C:\Users\Administrator\Desktop\PHP\php-5.3-nts-win32-VC9-x64- latest.msi MSI (c) (0C:A0) [16:42:56:734]: APPCOMPAT: Compatibility mode property overrides found. MSI (c) (0C:A0) [16:42:56:734]: APPCOMPAT: looking for appcompat database entry with ProductCode '{C9E68706-081D-4302-8EED- 309849864DA7}'. MSI (c) (0C:A0) [16:42:56:734]: APPCOMPAT: no matching ProductCode found in database. MSI (c) (0C:A0) [16:42:56:750]: MSCOREE not loaded loading copy from system32 MSI (c) (0C:A0) [16:42:56:750]: Machine policy value 'TransformsSecure' is 1 MSI (c) (0C:A0) [16:42:56:750]: Machine policy value 'DisablePatch' is 0 MSI (c) (0C:A0) [16:42:56:750]: Machine policy value 'AllowLockdownPatch' is 0 MSI (c) (0C:A0) [16:42:56:750]: Machine policy value 'DisableLUAPatching' is 0 MSI (c) (0C:A0) [16:42:56:750]: Machine policy value 'DisableFlyWeightPatching' is 0 MSI (c) (0C:A0) [16:42:56:750]: APPCOMPAT: looking for appcompat database entry with ProductCode '{C9E68706-081D-4302-8EED- 309849864DA7}'. MSI (c) (0C:A0) [16:42:56:750]: APPCOMPAT: no matching ProductCode found in database. MSI (c) (0C:A0) [16:42:56:750]: Transforms are not secure. MSI (c) (0C:A0) [16:42:56:750]: PROPERTY CHANGE: Adding MsiLogFileLocation property. Its value is 'C:\Users\Administrator\Desktop\PHP\error.log'. MSI (c) (0C:A0) [16:42:56:750]: Command Line: CURRENTDIRECTORY=C:\Users\Administrator\Desktop\PHP CLIENTUILEVEL=0 CLIENTPROCESSID=2572 MSI (c) (0C:A0) [16:42:56:750]: PROPERTY CHANGE: Adding PackageCode property. Its value is '{DC36AD73-169E-41EC-8C45-016D75DA70E4}'. MSI (c) (0C:A0) [16:42:56:750]: Product Code passed to Engine.Initialize: '' MSI (c) (0C:A0) [16:42:56:750]: Product Code from property table before transforms: '{C9E68706-081D-4302-8EED-309849864DA7}' MSI (c) (0C:A0) [16:42:56:750]: Product Code from property table after transforms: '{C9E68706-081D-4302-8EED-309849864DA7}' MSI (c) (0C:A0) [16:42:56:750]: Product not registered: beginning first-time install MSI (c) (0C:A0) [16:42:56:750]: PROPERTY
Req #50648 [Opn->Csd]: Format for binary numbers
Edit report at https://bugs.php.net/bug.php?id=50648&edit=1 ID: 50648 Updated by: paj...@php.net Reported by:robert_xp at gmx dot net Summary:Format for binary numbers -Status: Open +Status: Closed Type: Feature/Change Request Package:Scripting Engine problem -PHP Version:5.3.1 +PHP Version:5.4 -Assigned To: +Assigned To:pajoye Block user comment: N Private report: N New Comment: I applied the pach to 5.4 and trunk. Thanks for your work! It would rock if you would have some time to add some test cases, string conversion, etc. Previous Comments: [2010-11-11 07:15:50] jonah dot harris at gmail dot com Per discussion, two patches are attached: - php-src-5.3-50648_p1.patch is a subset and clean up of Robert's original patch for binary notation of integer support. - phpdoc-50648_p1.patch is an English documentation update. NOTE: re2c will have to be run post-patch and pre-commit because the re2c-related diffs could not be included as they pushed the patch size over 100K. [2010-01-04 11:50:15] robert_xp at gmx dot net Description: I think it would be a good improvement to have a short form for binary numbers like C# with 0b101010. More information and a patch is provided here: http://www.xarg.org/2009/12/php-hacking/ Reproduce code: --- 0b101 Expected result: 5 Actual result: -- compile-error -- Edit this bug report at https://bugs.php.net/bug.php?id=50648&edit=1
Bug #55269 [Asn->Csd]: --enable-dtrace fail on FreeBSD
Edit report at https://bugs.php.net/bug.php?id=55269&edit=1 ID: 55269 Updated by: d...@php.net Reported by:samm at os2 dot kiev dot ua Summary:--enable-dtrace fail on FreeBSD -Status: Assigned +Status: Closed Type: Bug Package:Compile Failure Operating System: FreeBSD 8-STABLE PHP Version:5.4SVN-2011-07-22 (SVN) Assigned To:dsp Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. 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/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Previous Comments: [2011-07-26 23:49:38] d...@php.net Automatic comment from SVN on behalf of dsp Revision: http://svn.php.net/viewvc/?view=revision&revision=313752 Log: Fix #55269 (--enable-dtrace fail on FreeBSD) [2011-07-22 15:19:01] samm at os2 dot kiev dot ua Description: Dtrace/userland is supported in the current FreeBSD version. I found that autoconf expecting Solaris only and producing broken makefiles on FreeBSD. Also libelf is required on FreeBSD to link with dtrace for userland applications. Test script: --- ./buildconf; configure --enable-dtrace && make Expected result: php with dtrace Actual result: -- a lot of unresolved functions on the link stage. -- Edit this bug report at https://bugs.php.net/bug.php?id=55269&edit=1
[PHP-BUG] Bug #55291 [NEW]: All ODBC Queries Return INTs as Strings For Multiple ODBC Drivers
From: Operating system: SUSE SLES 10 SP2 PHP version: 5.3.6 Package: ODBC related Bug Type: Bug Bug description:All ODBC Queries Return INTs as Strings For Multiple ODBC Drivers Description: odbc_* and PDO ODBC functions are each returning SQL integer values as PHP strings. However, SQL NULL values properly appear as PHP NULL values. I have tested against multiple ODBC providers (FreeTDS and iSeries Access for Linux). System: SUSE Enterprise Linux Server 10 (SP2) - 32bit Linux dev-webhost1 2.6.16.60-0.42.5-default #1 Mon Aug 24 09:41:41 UTC 2009 i686 i686 i386 GNU/Linux UnixODBC PHP 5.3.6 from source ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with- mssql=/usr/local/freetds --with-ldap --prefix=/usr/local/php5 --with-config- file- path=/usr/local/php5/etc --enable-sockets --enable-soap --with-openssl --with- unixODBC=/usr --with-gd --with-jpeg-dir=/usr/lib --with-pdo-odbc=unixODBC,/usr Test script: --- 1. odbc_* against FreeTDS to SQL Server 2008: $odbc = odbc_connect('hpsql3','--censored--','--censored--'); $or = odbc_exec($odbc,'SELECT 1'); var_dump(odbc_fetch_array($or)); // array( string "1" ) 2. odbc_* against iSeries Access for Linux to AS/400: $odbc = odbc_connect('iSeriesDSN','--','--'); $or = odbc_exec($odbc,'SELECT 1 FROM SYSIBM.SYSDUMMY1'); var_dump(odbc_fetch_array($or)); // array( string "1" ) 3. PDO against FreeTDS to SQL Server 2008 $pdo = new PDO('odbc:hpsql3','--','--'); var_dump($pdo->query('SELECT 1')->fetch(PDO::FETCH_ASSOC)); // array (string "1") 4. PDO against iSeries Access for Linux to AS/400 $pdo = new PDO('odbc:iSeriesDSN','--','--'); var_dump($pdo->query('SELECT 1 FROM SYSIBM.SYSDUMMY1')->fetch(PDO::FETCH_ASSOC)); // array (string "1") Expected result: I expect to get arrays containing (int) 1 Actual result: -- I actually get arrays containing (string) "1" -- Edit bug report at https://bugs.php.net/bug.php?id=55291&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55291&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55291&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55291&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=55291&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55291&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=55291&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=55291&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=55291&r=needscript Try newer version: https://bugs.php.net/fix.php?id=55291&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=55291&r=support Expected behavior: https://bugs.php.net/fix.php?id=55291&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=55291&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=55291&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=55291&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55291&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=55291&r=dst IIS Stability: https://bugs.php.net/fix.php?id=55291&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=55291&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=55291&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=55291&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=55291&r=mysqlcfg
Req #51882 [Opn]: Call To Member Function on Non-Object Should Throw An Exception
Edit report at https://bugs.php.net/bug.php?id=51882&edit=1 ID: 51882 User updated by:jacob at mediashaker dot com Reported by:jacob at mediashaker dot com Summary:Call To Member Function on Non-Object Should Throw An Exception Status: Open Type: Feature/Change Request Package:*General Issues Operating System: Centos 5.3 PHP Version:5.2.13 Block user comment: N Private report: N New Comment: It's simply a general headache. I'm aware of the register_shutdown_function tricks but unless I've done it wrong, they don't provide a full, accurate stacktrace. In any case, this is exactly what this proposal is meant to avoid - created separate error-handling code paths for a common error that does not, from experience with other dynamic languages, need to be fatal. In Python I get: AttributeError: User instance has no attribute 'sayHello' It's got a full traceback, it's catchable, it has a nicely subclassed error type. Fatal errors have none of this. It's a larger issue in cases where you have more complex object object graphs, in cases where you have references to objects that pass hands frequently. etc. In an enterprise application with object compositions and complex class hierarchies, it's not unusual to have situations where you don't have the object you expect to have. Certainly, this is a bug, but bugs are the reality of software development and tracing them should be as easy as reasonably possible. Unless you have xdebug installed for traceback information, you've got to find the line of code that initially caused the error and then do something like `var_dump(debug_backtrace())` to figure out the code path that led to the error. In a production system with hundreds of deployments, you often can't simply go around sprinkling debug statements in production code just to get debug information you could've had for free if the thing were an exception. If my web app has a nice exception handling mechanism where uncaught errors are caught by a final, top-level exception handler, where I do things such as e-mail a sysadmin, or display the error in a pretty-formatted HTML page, these fatal errors slip through the cracks. Unless this is a performance decision, or because the development team is limited by legacy support / backwards compatibility, the behavior simply sucks. From my POV, this does not need to be as difficult as PHP makes it. In general, PHP's errors are wonky. Half of them use trigger_error and error codes, others use exceptions, and finally, there's this big guy which is a fatal error. Previous Comments: [2011-07-20 15:47:43] binarycleric at gmail dot com I disagree with changing this from being a fatal error. Trying to call a method on an object that doesn't exist should always result in a fatal error because you are especially calling non-existent code. Trying to call a procedural function that doesn't exist should result in the same behavior. I personally wouldn't want anything other than a fatal error to occur if I tried to call "some_import_func($herp, $derp);" and it didn't exist, because there is really no sane way to recover from that. We have "function_exists" and "method_exists" for a reason. If you are having constant problems like this with your code then that is usually a symptom of a larger problem in how your application is structured. There are hacks and workarounds to get stacktrace information after a fatal error using things like "register_shutdown_function", but your code really shouldn't try to "recover" from a failure that catastrophic. I don't mean for this comment to have an "internet toughguy" additude, I'm just trying to show you that your code may have more serious problems then you realize. You already have a good number of tools in your toolbox, you just need to learn to use them better. [2010-05-21 19:19:32] jacob at mediashaker dot com Description: Call to a member function on a non-object is one of the most common reasons a php script might crash. Granted, there's often a whole chain of responsibility that falls apart for it to get to this point. The problem with this fatal error is that it provides absolutely no debugging or traceback information when it happens. PHP blows up on fatal errors and all you're left with is a line number and no idea how it got there. It would be awesome if it threw an exception with it's requisite traceback information. -- Edit this bug report at https://bugs.php.net/bug.php?id=51882&edit=1
[PHP-BUG] Bug #55290 [NEW]: \NumberFormatter::parseCurrency() fails
From: Operating system: Ubuntu 11.04 PHP version: 5.3.6 Package: I18N and L10N related Bug Type: Bug Bug description:\NumberFormatter::parseCurrency() fails Description: Hi, The example code at http://nl2.php.net/manual/en/numberformatter.parsecurrency.php doesn't seem to work for me. This is perhaps also related to bug #54163 (?) --- version1.1.0 ICU version4.4.1 Directive Local ValueMaster Value intl.default_localeno value no value intl.error_level 0 0 Test script: --- parseCurrency($num, $curr)." in $curr\n"; die; Expected result: We have 1234567.89 in USD We have 1234567.89 in USD Actual result: -- We have in We have in -- Edit bug report at https://bugs.php.net/bug.php?id=55290&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55290&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55290&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55290&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=55290&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55290&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=55290&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=55290&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=55290&r=needscript Try newer version: https://bugs.php.net/fix.php?id=55290&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=55290&r=support Expected behavior: https://bugs.php.net/fix.php?id=55290&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=55290&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=55290&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=55290&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55290&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=55290&r=dst IIS Stability: https://bugs.php.net/fix.php?id=55290&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=55290&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=55290&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=55290&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=55290&r=mysqlcfg
[PHP-BUG] Bug #55289 [NEW]: XSLTProcessor::getParameter returns false on unset parameters
From: Operating system: Linux PHP version: 5.3.6 Package: XSLT related Bug Type: Bug Bug description:XSLTProcessor::getParameter returns false on unset parameters Description: The PHP manual says that XSLTProcessor::getParameter returns NULL for unset paremeters. However it seems that it results in the return value (bool)false. Test script: --- $xsl = new XSLTProcessor(); var_dump($xsl->getParameter("", "foobar")); Expected result: NULL Actual result: -- bool(false) -- Edit bug report at https://bugs.php.net/bug.php?id=55289&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55289&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55289&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55289&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=55289&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55289&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=55289&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=55289&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=55289&r=needscript Try newer version: https://bugs.php.net/fix.php?id=55289&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=55289&r=support Expected behavior: https://bugs.php.net/fix.php?id=55289&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=55289&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=55289&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=55289&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55289&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=55289&r=dst IIS Stability: https://bugs.php.net/fix.php?id=55289&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=55289&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=55289&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=55289&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=55289&r=mysqlcfg
Bug #54676 [Com]: Current php dev snapshort doesn't handle soap services at all
Edit report at https://bugs.php.net/bug.php?id=54676&edit=1 ID: 54676 Comment by: davetcoleman at gmail dot com Reported by:xuytrpoiuyter at inbox dot ru Summary:Current php dev snapshort doesn't handle soap services at all Status: Open Type: Bug Package:SOAP related Operating System: Linux PHP Version:5.3SVN-2011-05-06 (snap) Block user comment: N Private report: N New Comment: I've had this problem on Ubuntu 11.04 for several weeks now. The same code works fine in Redhat and WAMP Windows. Please help! Previous Comments: [2011-05-24 02:11:21] xuytrpoiuyter at inbox dot ru still not working :(( [2011-05-06 17:23:36] xuytrpoiuyter at inbox dot ru Description: Current php 5.3 development snapshort has stopped handling soap web services. PHP 5.3.6 works fine. Test script: --- $service = new SoapClient($wsdl_url); Expected result: a correctly functioning SoapClient object Actual result: -- Exception: Error Fetching http headers -- Edit this bug report at https://bugs.php.net/bug.php?id=54676&edit=1
[PHP-BUG] Bug #55288 [NEW]: usort segfaults
From: Operating system: Linux PHP version: 5.3.6 Package: Arrays related Bug Type: Bug Bug description:usort segfaults Description: usort and uksort (and possibly other related functions) will segfault with the given script. I believe it is related to Zend's internal array "copy-on-write". Test script: --- class X { function __construct($v) { $this->v = $v; } } function sortIt(&$list) { usort($list, function($a, $b) use ($list) { return $a->v - $b->v; }); } $list = array(); for($i = 0; $i < 10; ++$i) $list[mt_rand()] = new X(mt_rand()); echo "Sort..."; sortIt($list); gc_collect_cycles();//segfault echo "pass.\n"; Expected result: "Sort...pass." Actual result: -- "Sort...Segmentation fault" [dev@box dev]$ php --version PHP 5.3.6 (cli) (built: Mar 17 2011 19:14:03) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies with Xdebug v2.1.1, Copyright (c) 2002-2011, by Derick Rethans [dev@box dev]$ gdb php Reading symbols from /usr/bin/php...(no debugging symbols found)...done. (gdb) run usortCrash.php Starting program: /usr/bin/php usortCrash.php [Thread debugging using libthread_db enabled] Sort... Program received signal SIGSEGV, Segmentation fault. 0x005db586 in ?? () (gdb) bt #0 0x005db586 in ?? () #1 0x005db610 in ?? () #2 0x005dbef5 in gc_collect_cycles () #3 0x005cee1d in ?? () #4 0x2e139d0a in xdebug_execute_internal () from /usr/lib64/php/modules/xdebug.so #5 0x005e669d in ?? () #6 0x005e5dcb in execute () #7 0x2e13998e in xdebug_execute () from /usr/lib64/php/modules/xdebug.so #8 0x005bf395 in zend_execute_scripts () #9 0x0056f628 in php_execute_script () #10 0x00648ce0 in ?? () #11 0x0033ad41d994 in __libc_start_main () from /lib64/libc.so.6 #12 0x00422009 in _start () -- Edit bug report at https://bugs.php.net/bug.php?id=55288&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55288&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55288&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55288&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=55288&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55288&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=55288&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=55288&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=55288&r=needscript Try newer version: https://bugs.php.net/fix.php?id=55288&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=55288&r=support Expected behavior: https://bugs.php.net/fix.php?id=55288&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=55288&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=55288&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=55288&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55288&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=55288&r=dst IIS Stability: https://bugs.php.net/fix.php?id=55288&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=55288&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=55288&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=55288&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=55288&r=mysqlcfg
Req #52982 [PATCH]: Expose php_session_active to userland via new function (patch included)
Edit report at https://bugs.php.net/bug.php?id=52982&edit=1 ID: 52982 Patch added by: ar...@php.net Reported by:php dot net at kenman dot net Summary:Expose php_session_active to userland via new function (patch included) Status: Assigned Type: Feature/Change Request Package:Session related PHP Version:5.3.3 Assigned To:kalle Block user comment: N Private report: N New Comment: The following patch has been added/updated: Patch Name: php-trunk-session-status-bools Revision: 1311706403 URL: https://bugs.php.net/patch-display.php?bug=52982&patch=php-trunk-session-status-bools&revision=1311706403 Previous Comments: [2011-07-26 18:52:27] ar...@php.net The following patch has been added/updated: Patch Name: php-trunk-session-status Revision: 1311706347 URL: https://bugs.php.net/patch-display.php?bug=52982&patch=php-trunk-session-status&revision=1311706347 [2011-07-26 14:31:21] php dot net at kenman dot net Thank you very much, Arpad; my rudimentary C skills were barely enough for me to craft the patch (which I somehow managed to compile and use), and so I appreciate the background info. I would be happy with any solution that helps me to solve the problem! [2011-07-25 22:37:37] ar...@php.net If you're trying to establish whether it's safe to start your own session, this patch is deficient because PS(session_status) is not a boolean - it could also be php_session_disabled. I'd imagine robust code to handle this (rather unusual) case where you require a session but don't know if it's present, would be something like: if (session_is_available()) { if (!session_is_active()) { if (headers_sent()) { // bail out } else { session_start(); } } } else { // bail out } We could instead provide a session_status() function which corresponds to the internal enum (returning SESSION_DISABLED, SESSION_NONE or SESSION_ACTIVE.) I assume this is what Kalle was talking about WRT exposing the other values. Both options are trivial patches. The former seems friendlier but more prone to error. [2011-07-25 17:25:54] php dot net at kenman dot net Any update on this? Simple request; I'm not exactly sure what all Kalle was speaking to WRT "expose the other values", but what I'm requested here is a tiny piece of functionality, and that is *all* that is being requested. [2010-10-05 07:34:11] php dot net at kenman dot net pajoye, I'm not sure if you understand which problem I'm trying to address here; it's not whether or not session_start() was successful, it's whether or not there is a current active session. Many times, in frameworks or other large-scale applications, you have no way of knowing whether session_start() has already been called. You cannot rely on session_id(), SID, session_start(), $_SESSION, or any other session functions or session functionality (that I'm aware of) to tell me "yes, you already have a session open" or "no, you do not have a session open" _before_ I call session_start(). 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 https://bugs.php.net/bug.php?id=52982 -- Edit this bug report at https://bugs.php.net/bug.php?id=52982&edit=1
Req #52982 [PATCH]: Expose php_session_active to userland via new function (patch included)
Edit report at https://bugs.php.net/bug.php?id=52982&edit=1 ID: 52982 Patch added by: ar...@php.net Reported by:php dot net at kenman dot net Summary:Expose php_session_active to userland via new function (patch included) Status: Assigned Type: Feature/Change Request Package:Session related PHP Version:5.3.3 Assigned To:kalle Block user comment: N Private report: N New Comment: The following patch has been added/updated: Patch Name: php-trunk-session-status Revision: 1311706347 URL: https://bugs.php.net/patch-display.php?bug=52982&patch=php-trunk-session-status&revision=1311706347 Previous Comments: [2011-07-26 14:31:21] php dot net at kenman dot net Thank you very much, Arpad; my rudimentary C skills were barely enough for me to craft the patch (which I somehow managed to compile and use), and so I appreciate the background info. I would be happy with any solution that helps me to solve the problem! [2011-07-25 22:37:37] ar...@php.net If you're trying to establish whether it's safe to start your own session, this patch is deficient because PS(session_status) is not a boolean - it could also be php_session_disabled. I'd imagine robust code to handle this (rather unusual) case where you require a session but don't know if it's present, would be something like: if (session_is_available()) { if (!session_is_active()) { if (headers_sent()) { // bail out } else { session_start(); } } } else { // bail out } We could instead provide a session_status() function which corresponds to the internal enum (returning SESSION_DISABLED, SESSION_NONE or SESSION_ACTIVE.) I assume this is what Kalle was talking about WRT exposing the other values. Both options are trivial patches. The former seems friendlier but more prone to error. [2011-07-25 17:25:54] php dot net at kenman dot net Any update on this? Simple request; I'm not exactly sure what all Kalle was speaking to WRT "expose the other values", but what I'm requested here is a tiny piece of functionality, and that is *all* that is being requested. [2010-10-05 07:34:11] php dot net at kenman dot net pajoye, I'm not sure if you understand which problem I'm trying to address here; it's not whether or not session_start() was successful, it's whether or not there is a current active session. Many times, in frameworks or other large-scale applications, you have no way of knowing whether session_start() has already been called. You cannot rely on session_id(), SID, session_start(), $_SESSION, or any other session functions or session functionality (that I'm aware of) to tell me "yes, you already have a session open" or "no, you do not have a session open" _before_ I call session_start(). [2010-10-04 12:15:56] paj...@php.net The notice is documented and can be disabled using the display error settings. To detect whether or not session_start was successful, you have to test its return value (as of 5.3.0). It is actually a documentation problem as the examples in the manual does not check the return values (maybe add one on top of them using 5.3+). 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 https://bugs.php.net/bug.php?id=52982 -- Edit this bug report at https://bugs.php.net/bug.php?id=52982&edit=1
Bug #55124 [Ver->Asn]: recursive mkdir fails with current (dot) directory in path
Edit report at https://bugs.php.net/bug.php?id=55124&edit=1 ID: 55124 Updated by: paj...@php.net Reported by:cwei...@php.net Summary:recursive mkdir fails with current (dot) directory in path -Status: Verified +Status: Assigned Type: Bug Package:Directory function related PHP Version:5.3.6 -Assigned To: +Assigned To:pajoye Block user comment: N Private report: N New Comment: Fixed in 5.4 and trunk. 5.3 requires more work, can be done later but most probably post 5.3.7. Previous Comments: [2011-07-26 17:44:21] paj...@php.net Automatic comment from SVN on behalf of pajoye Revision: http://svn.php.net/viewvc/?view=revision&revision=313743 Log: - Fixed bug 55124, recursive mkdir fails with current (dot) directory in path [2011-07-26 12:57:28] paj...@php.net verified in ts mode at least. [2011-07-04 02:41:27] cwei...@php.net Description: Running recursive mkdir fails when there is a "." directory in the path: PHP Warning: mkdir(): File exists in Command line code on line 1 Warning: mkdir(): File exists in Command line code on line 1 When a does not exist, "a" is generated, but "b" is not. When a exists already, everything is fine. Note that I cannot use realpath() to sanitize the path because the path does not exist yet. Test script: --- Actual result: -- $ /opt/phpfarm/inst/bin/php-5.3.6 -v PHP 5.3.6 (cli) (built: Mar 18 2011 09:27:59) (DEBUG) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies $ LC_ALL=C ls a ls: cannot access a: No such file or directory $ /opt/phpfarm/inst/bin/php-5.3.6 -r 'mkdir("a/./b", 0755, true);' PHP Warning: mkdir(): File exists in Command line code on line 1 Warning: mkdir(): File exists in Command line code on line 1 -- Edit this bug report at https://bugs.php.net/bug.php?id=55124&edit=1
Req #46260 [Com]: __FILE__ should not resolve symlink paths
Edit report at https://bugs.php.net/bug.php?id=46260&edit=1 ID: 46260 Comment by: tony at brown dot org Reported by:bugs dot php dot net at callum-macdonald dot com Summary:__FILE__ should not resolve symlink paths Status: Open Type: Feature/Change Request Package:Feature/Change Request Operating System: Linux PHP Version:5.2.6 Block user comment: N Private report: N New Comment: I'm another +1 for this, causing me some real headaches because for deployment I store multiple versions of a site with the latest been symlinked to for apache. There are modules in the application which are licensed and use the file path as part of it's verification. When we deploy, the path is seen as changed and the modules get disabled. :-( Previous Comments: [2011-04-27 04:38:48] gnoodl+php at gmail dot com $_SERVER["SCRIPT_FILENAME"] cannot be used in place of __FILE__ as it does not resolve the path of an included file. Eg, // file1.php include 'file2.php'; // file2.php echo $_SERVER['SCRIPT_FILENAME']; Executing file1.php will result in "/path/to/file1.php" [2010-12-10 18:12:17] php at micropro dot cz I think I have a resoulution ... use $_SERVER["SCRIPT_FILENAME"] instead of __file__. It should work the same way, but is absolute path, not resolved. It works for me fine :-) [2010-11-10 16:52:41] jimmy at powerzone dot dk I agree. Hosting multiple PHP systems based on the same installation is no easy task, when __FILE__ is used in conjunction with symlinks. Very frustrating. I vote for a new contant; __FILEPATH__ which does not resolve symlinks. [2010-08-26 09:12:33] rix at mindginative dot com +1 for this. I encountered this issue today and was hoping that there's a better way not to resolve symlink in __FILE__. As suggested above, perhaps __FILE_LINK__ that either return the symlink path or false if none. [2009-09-26 21:01:15] miguel-php at cr dot uz Another vote for this. The current implementation does not seem like the proper way to treat symlinks, and it makes sharing included files between directories very difficult. I understand that changing this now has the potential to cause breakage in scripts that depend on the current behaviour. But there really does need to be a way for a file to find its own effective location. 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 https://bugs.php.net/bug.php?id=46260 -- Edit this bug report at https://bugs.php.net/bug.php?id=46260&edit=1
Bug #55121 [Fbk->Csd]: Segfault with multipart/form-data POST / 404 request
Edit report at https://bugs.php.net/bug.php?id=55121&edit=1 ID: 55121 Updated by: f...@php.net Reported by:nbpo...@php.net Summary:Segfault with multipart/form-data POST / 404 request -Status: Feedback +Status: Closed Type: Bug Package:Built-in web server Operating System: Ubuntu 10.04.2 LTS (64-bit) PHP Version:5.4SVN-2011-07-03 (snap) -Assigned To:moriyoshi +Assigned To:fa Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. 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/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Previous Comments: [2011-07-25 20:18:37] nbpo...@php.net OK. I retested again just now with the latest snapshot on both OS X and Ubuntu. No segfaults anymore. [2011-07-25 18:11:10] nbpo...@php.net Tested latest snapshot on OS X. Same backtrace. [2011-07-25 16:47:21] f...@php.net Could you please try if this fix works on OS X as well? Tested on debian stable. [2011-07-25 16:45:42] f...@php.net Automatic comment from SVN on behalf of fa Revision: http://svn.php.net/viewvc/?view=revision&revision=313677 Log: Fix #55121 Segfault with multipart/form-data POST [2011-07-20 13:41:49] nbpo...@php.net A similar segfault on OS X 10.6.7 can be caused using the original steps to reproduce: $ curl --form a=b http://127.0.0.1:8000/file.php $ curl http://127.0.0.1:8000/does_not_exist Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x0002011b0b30 0x00010024a3b5 in _zend_mm_free_int (heap=0x10100, p=0x1006651e0) at zend_alloc.c:2097 2097heap->size -= size; (gdb) bt #0 0x00010024a3b5 in _zend_mm_free_int (heap=0x10100, p=0x1006651e0) at zend_alloc.c:2097 #1 0x00010021e6af in destroy_uploaded_files_hash () at rfc1867.c:199 #2 0x00010021b252 in sapi_deactivate () at SAPI.c:535 #3 0x0001002fd61e in php_cli_server_send_error_page (server=0x7fff5fbfa730, client=0x100b4e6f0, status=404) at php_cli_server.c:1525 #4 0x0001002fb31e in php_cli_server_dispatch [inlined] () at /Users/nbpoole/php-test/php5.4-201107201630/sapi/cli/php_cli_server.c:1636 #5 0x0001002fb31e in php_cli_server_recv_event_read_request (server=0x7fff5fbfe970, client=0x1006651e0) at php_cli_server.c:1924 #6 0x0001002fcae5 in php_cli_server_do_event_for_each_fd_callback [inlined] () at /Users/nbpoole/php-test/php5.4-201107201630/sapi/cli/php_cli_server.c:2010 #7 0x0001002fcae5 in php_cli_server_do_event_for_each_fd [inlined] () at php_cli_server.c:671 #8 0x0001002fcae5 in php_cli_server_poller_iter_on_active [inlined] () at /Users/nbpoole/php-test/php5.4-201107201630/sapi/cli/php_cli_server.c:2046 #9 0x0001002fcae5 in php_cli_server_do_event_loop [inlined] () at /Users/nbpoole/php-test/php5.4-201107201630/sapi/cli/php_cli_server.c:2036 #10 0x0001002fcae5 in do_cli_server (argc=4, argv=0x10) at php_cli_server.c:2147 #11 0x0001002f6aa4 in main (argc=1606415328, argv=0x7fff5fbff400) at php_cli.c:1359 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 https://bugs.php.net/bug.php?id=55121 -- Edit this bug report at https://bugs.php.net/bug.php?id=55121&edit=1
Req #28261 [Com]: Lifting reserved keyword restriction for method names
Edit report at https://bugs.php.net/bug.php?id=28261&edit=1 ID: 28261 Comment by: info at strictcoding dot co dot uk Reported by:Philippe dot Jausions at 11abacus dot com Summary:Lifting reserved keyword restriction for method names Status: Open Type: Feature/Change Request Package:Scripting Engine problem Operating System: * PHP Version:* Block user comment: N Private report: N New Comment: +1 for this feature request! Previous Comments: [2011-07-10 19:47:43] s...@php.net The patch seems not to work with tokenizer extension - the extension returns wrong tokens (T_EVAL instead of expected T_STRING). [2009-06-30 05:52:23] taufiq at krimnet dot com I need this bug to be resolved. I'm writing Javascript/CSS collector & minify library. I would like to code like below. JS::include(FILE_PATH)->include(FILE_PATH2)->include(FILE_PATH3); having method name other than include() is pretty annoying. [2007-12-16 00:46:09] kentfredric at gmail dot com At the moment (5.2.3 ) this is perfectly valid. Class A{ function __call( $function, $args ){ if( $function == 'print' ){ print "MyPrint: {$args[0]}"; } } } $a = new A(); $a->print( "hello" ); #<-- surprisingly, this is not an invalid use of a keyword to the lexer. # >> MyPrint: hello but this Class A{ function print( $args ){ print "MyPrint: {$args}"; } } $a = new A(); $a->print( "hello" ); Yields a parse error "Parse error: syntax error, unexpected T_PRINT, expecting T_STRING" which appears to be an illogical design contstraint. I've seen rather brutal slander for people attempting to perform this ( #14178 , this bug ) amounting to "hey, you suck, dont do that" without any rational explanation. So yes, I look forward to this feature being integrated. [2007-10-05 02:13:49] cel...@php.net as new reserved words are introduced, they tend to clash with existing class's method names. import and namespace are particularly nasty examples of methods that are likely to clash, although I have also run into problems with "list" which is a very nice method name for many tasks. The patches linked to in this comment provides a simple and effective means of allowing reserved words in method names. Not only is it possible, but it is quite elegant :). It also fixes, as a side effect, a bug in the parsing of this code: list = 1; $a-> list = 2; // parse error, unexpected T_LIST ?> whitespace between T_OBJECT_OPERATOR and the variable name changes the token returned from T_STRING to any valid token. Patch for PHP 5: http://pear.php.net/~greg/smarter_lexer.patch.txt Patch for PHP 6: http://pear.php.net/~greg/php6_smarter_lexer.patch.txt [2004-05-04 18:18:05] he...@php.net That's simply impossible. 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 https://bugs.php.net/bug.php?id=28261 -- Edit this bug report at https://bugs.php.net/bug.php?id=28261&edit=1
[PHP-BUG] Bug #55287 [NEW]: trunk's spl_classes() not includes CallbackFilter classes
From: Operating system: any PHP version: 5.4SVN-2011-07-26 (SVN) Package: SPL related Bug Type: Bug Bug description:trunk's spl_classes() not includes CallbackFilter classes Description: spl_classes() not includes "CallbackFilterIterator" and "RecursiveCallbackFilterIterator". Test script: --- On terminal emulator, type as below: php -r 'print_r(spl_classes());' | grep 'FilterIterator' Expected result: [FilterIterator] => FilterIterator [CallbackFilterIterator] => CallbackFilterIterator [RecursiveFilterIterator] => RecursiveFilterIterator [RecursiveCallbackFilterIterator] => RecursiveCallbackFilterIterator Actual result: -- [FilterIterator] => FilterIterator [RecursiveFilterIterator] => RecursiveFilterIterator -- Edit bug report at https://bugs.php.net/bug.php?id=55287&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55287&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55287&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55287&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=55287&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55287&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=55287&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=55287&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=55287&r=needscript Try newer version: https://bugs.php.net/fix.php?id=55287&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=55287&r=support Expected behavior: https://bugs.php.net/fix.php?id=55287&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=55287&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=55287&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=55287&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55287&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=55287&r=dst IIS Stability: https://bugs.php.net/fix.php?id=55287&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=55287&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=55287&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=55287&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=55287&r=mysqlcfg
Bug #55231 [Csd]: Unsatisfied symbols __sync_fetch_and_add_4
Edit report at https://bugs.php.net/bug.php?id=55231&edit=1 ID: 55231 User updated by:php at dactar dot ch Reported by:php at dactar dot ch Summary:Unsatisfied symbols __sync_fetch_and_add_4 Status: Closed Type: Bug Package:*Compile Issues Operating System: HP-UX 11.11 PHP Version:5.3.7RC3 Assigned To:felipe Block user comment: N Private report: N New Comment: Perfect, thanks :) Previous Comments: [2011-07-26 14:53:30] fel...@php.net It's already in 5.3 branch. Thanks. [2011-07-26 14:47:09] php at dactar dot ch Hello felipe, I've tested your additionnal check and it's OK for me :) Can you merge that for official next php 5.3.7 ? Thanks :) @++ JC [2011-07-22 21:09:13] fel...@php.net I've added a check for HP-UX, GCC seems not have implemented __sync_fetch_and_add_4 for all targets. [2011-07-20 11:33:27] php at dactar dot ch Hello, Sorry, with : #elif (defined(__GNUC__) && (__GNUC__ > 4 || \ (__GNUC__ == 4 && (__GNUC_MINOR__ > 1 || (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ > 1) it doesn't work ( Unresolved symbol: __sync_fetch_and_add_4 (code) ) I don't have the problem with : #elif (defined(__GNUC__) && (__GNUC__ >= 4 && __GNUC_MINOR__ >= 2)) Thanks @++ JC [2011-07-19 18:12:07] fel...@php.net Automatic comment from SVN on behalf of felipe Revision: http://svn.php.net/viewvc/?view=revision&revision=313452 Log: - Fixed bug #55231 (Unsatisfied symbols __sync_fetch_and_add_4) 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 https://bugs.php.net/bug.php?id=55231 -- Edit this bug report at https://bugs.php.net/bug.php?id=55231&edit=1
Bug #55231 [Ana->Csd]: Unsatisfied symbols __sync_fetch_and_add_4
Edit report at https://bugs.php.net/bug.php?id=55231&edit=1 ID: 55231 Updated by: fel...@php.net Reported by:php at dactar dot ch Summary:Unsatisfied symbols __sync_fetch_and_add_4 -Status: Analyzed +Status: Closed Type: Bug Package:*Compile Issues Operating System: HP-UX 11.11 PHP Version:5.3.7RC3 Assigned To:felipe Block user comment: N Private report: N New Comment: It's already in 5.3 branch. Thanks. Previous Comments: [2011-07-26 14:47:09] php at dactar dot ch Hello felipe, I've tested your additionnal check and it's OK for me :) Can you merge that for official next php 5.3.7 ? Thanks :) @++ JC [2011-07-22 21:09:13] fel...@php.net I've added a check for HP-UX, GCC seems not have implemented __sync_fetch_and_add_4 for all targets. [2011-07-20 11:33:27] php at dactar dot ch Hello, Sorry, with : #elif (defined(__GNUC__) && (__GNUC__ > 4 || \ (__GNUC__ == 4 && (__GNUC_MINOR__ > 1 || (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ > 1) it doesn't work ( Unresolved symbol: __sync_fetch_and_add_4 (code) ) I don't have the problem with : #elif (defined(__GNUC__) && (__GNUC__ >= 4 && __GNUC_MINOR__ >= 2)) Thanks @++ JC [2011-07-19 18:12:07] fel...@php.net Automatic comment from SVN on behalf of felipe Revision: http://svn.php.net/viewvc/?view=revision&revision=313452 Log: - Fixed bug #55231 (Unsatisfied symbols __sync_fetch_and_add_4) [2011-07-19 18:11:20] fel...@php.net Please try using this snapshot: http://snaps.php.net/php-trunk-latest.tar.gz For Windows: http://windows.php.net/snapshots/ Such feature requires GCC >= 4.1.2, I've ajusted the check for the version. Can you test it? :) 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 https://bugs.php.net/bug.php?id=55231 -- Edit this bug report at https://bugs.php.net/bug.php?id=55231&edit=1
Bug #55231 [Ana]: Unsatisfied symbols __sync_fetch_and_add_4
Edit report at https://bugs.php.net/bug.php?id=55231&edit=1 ID: 55231 User updated by:php at dactar dot ch Reported by:php at dactar dot ch Summary:Unsatisfied symbols __sync_fetch_and_add_4 Status: Analyzed Type: Bug Package:*Compile Issues Operating System: HP-UX 11.11 PHP Version:5.3.7RC3 Assigned To:felipe Block user comment: N Private report: N New Comment: Hello felipe, I've tested your additionnal check and it's OK for me :) Can you merge that for official next php 5.3.7 ? Thanks :) @++ JC Previous Comments: [2011-07-22 21:09:13] fel...@php.net I've added a check for HP-UX, GCC seems not have implemented __sync_fetch_and_add_4 for all targets. [2011-07-20 11:33:27] php at dactar dot ch Hello, Sorry, with : #elif (defined(__GNUC__) && (__GNUC__ > 4 || \ (__GNUC__ == 4 && (__GNUC_MINOR__ > 1 || (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ > 1) it doesn't work ( Unresolved symbol: __sync_fetch_and_add_4 (code) ) I don't have the problem with : #elif (defined(__GNUC__) && (__GNUC__ >= 4 && __GNUC_MINOR__ >= 2)) Thanks @++ JC [2011-07-19 18:12:07] fel...@php.net Automatic comment from SVN on behalf of felipe Revision: http://svn.php.net/viewvc/?view=revision&revision=313452 Log: - Fixed bug #55231 (Unsatisfied symbols __sync_fetch_and_add_4) [2011-07-19 18:11:20] fel...@php.net Please try using this snapshot: http://snaps.php.net/php-trunk-latest.tar.gz For Windows: http://windows.php.net/snapshots/ Such feature requires GCC >= 4.1.2, I've ajusted the check for the version. Can you test it? :) [2011-07-18 10:42:42] php at dactar dot ch Hello pajoye. I can't do that because I don't understand why the 97th line has changed on 24 may. I don't have low level system / compiler skills to be exactly sure what I'm doing and how to correct that properly. I can however test any patch and validate it. Thanks for your help, @++ JC 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 https://bugs.php.net/bug.php?id=55231 -- Edit this bug report at https://bugs.php.net/bug.php?id=55231&edit=1
Req #52982 [Com]: Expose php_session_active to userland via new function (patch included)
Edit report at https://bugs.php.net/bug.php?id=52982&edit=1 ID: 52982 Comment by: php dot net at kenman dot net Reported by:php dot net at kenman dot net Summary:Expose php_session_active to userland via new function (patch included) Status: Assigned Type: Feature/Change Request Package:Session related PHP Version:5.3.3 Assigned To:kalle Block user comment: N Private report: N New Comment: Thank you very much, Arpad; my rudimentary C skills were barely enough for me to craft the patch (which I somehow managed to compile and use), and so I appreciate the background info. I would be happy with any solution that helps me to solve the problem! Previous Comments: [2011-07-25 22:37:37] ar...@php.net If you're trying to establish whether it's safe to start your own session, this patch is deficient because PS(session_status) is not a boolean - it could also be php_session_disabled. I'd imagine robust code to handle this (rather unusual) case where you require a session but don't know if it's present, would be something like: if (session_is_available()) { if (!session_is_active()) { if (headers_sent()) { // bail out } else { session_start(); } } } else { // bail out } We could instead provide a session_status() function which corresponds to the internal enum (returning SESSION_DISABLED, SESSION_NONE or SESSION_ACTIVE.) I assume this is what Kalle was talking about WRT exposing the other values. Both options are trivial patches. The former seems friendlier but more prone to error. [2011-07-25 17:25:54] php dot net at kenman dot net Any update on this? Simple request; I'm not exactly sure what all Kalle was speaking to WRT "expose the other values", but what I'm requested here is a tiny piece of functionality, and that is *all* that is being requested. [2010-10-05 07:34:11] php dot net at kenman dot net pajoye, I'm not sure if you understand which problem I'm trying to address here; it's not whether or not session_start() was successful, it's whether or not there is a current active session. Many times, in frameworks or other large-scale applications, you have no way of knowing whether session_start() has already been called. You cannot rely on session_id(), SID, session_start(), $_SESSION, or any other session functions or session functionality (that I'm aware of) to tell me "yes, you already have a session open" or "no, you do not have a session open" _before_ I call session_start(). [2010-10-04 12:15:56] paj...@php.net The notice is documented and can be disabled using the display error settings. To detect whether or not session_start was successful, you have to test its return value (as of 5.3.0). It is actually a documentation problem as the examples in the manual does not check the return values (maybe add one on top of them using 5.3+). [2010-10-04 10:31:43] ka...@php.net If we are going to expose php_session_active, we might aswell expose the other values. I will cook up a patch and apply it to trunk shortly 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 https://bugs.php.net/bug.php?id=52982 -- Edit this bug report at https://bugs.php.net/bug.php?id=52982&edit=1
Bug #55286 [Opn->Bgs]: error in the assigning integer values for the variables
Edit report at https://bugs.php.net/bug.php?id=55286&edit=1 ID: 55286 Updated by: bj...@php.net Reported by:balezin at yandex dot ru Summary:error in the assigning integer values for the variables -Status: Open +Status: Bogus Type: Bug Package:*General Issues Operating System: FreeBSD 8.2 PHP Version:5.3.6 Block user comment: N Private report: N 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 See the error on http://no2.php.net/types.integer Previous Comments: [2011-07-26 14:02:33] balezin at yandex dot ru I am sorry for my mistake: it is not a "Documentation problem" - it is a Bug. [2011-07-26 13:53:31] balezin at yandex dot ru Description: # php --version PHP 5.3.6 with Suhosin-Patch (cli) (built: Jul 21 2011 10:37:27) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies Hi! I found PHP error in the process assigning for integer variables. Test script: --- $a1=02; $a2=2; $a3=09; $a4=9; print("$a1, $a2, $a3, $a4"); Expected result: 2, 2, 9, 9 Actual result: -- 2, 2, 0, 9 -- Edit this bug report at https://bugs.php.net/bug.php?id=55286&edit=1
Doc->Bug #55286 [Opn]: error in the assigning integer values for the variables
Edit report at https://bugs.php.net/bug.php?id=55286&edit=1 ID: 55286 User updated by:balezin at yandex dot ru Reported by:balezin at yandex dot ru -Summary:error in assign variable +Summary:error in the assigning integer values for the variables Status: Open -Type: Documentation Problem +Type: Bug Package:*General Issues Operating System: FreeBSD 8.2 PHP Version:5.3.6 Block user comment: N Private report: N New Comment: I am sorry for my mistake: it is not a "Documentation problem" - it is a Bug. Previous Comments: [2011-07-26 13:53:31] balezin at yandex dot ru Description: # php --version PHP 5.3.6 with Suhosin-Patch (cli) (built: Jul 21 2011 10:37:27) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies Hi! I found PHP error in the process assigning for integer variables. Test script: --- $a1=02; $a2=2; $a3=09; $a4=9; print("$a1, $a2, $a3, $a4"); Expected result: 2, 2, 9, 9 Actual result: -- 2, 2, 0, 9 -- Edit this bug report at https://bugs.php.net/bug.php?id=55286&edit=1
Bug #54538 [Com]: setlocale() interferes with NumberFormatter class
Edit report at https://bugs.php.net/bug.php?id=54538&edit=1 ID: 54538 Comment by: radek dot dvorak at gmail dot com Reported by:davidkarlin at gmail dot com Summary:setlocale() interferes with NumberFormatter class Status: Open Type: Bug Package:Unknown/Other Function Operating System: OS X PHP Version:5.3.6 Block user comment: N Private report: N New Comment: I have observed a workaround. Setting LC_MESSAGES does not affect NumberFormatter and is sufficient for gettext translations at the same time. Previous Comments: [2011-04-16 16:52:30] cataphr...@php.net PHP passes the correct value to ICU, namely it passes the expected double to unum_formatDouble. This is likely an ICU defect. See: http://bugs.icu-project.org/trac/ticket/8214 [2011-04-15 13:34:02] davidkarlin at gmail dot com Sorry - I typed the wrong lines in the expected and actual results. Should be "123.456,789" in both cases. But you get the idea... [2011-04-15 13:32:41] davidkarlin at gmail dot com Description: --- >From manual page: http://www.php.net/class.numberformatter --- When I have my locale set to 'en' with setlocale(), the NumberFormatter class works just fine. If I set the locale to, for example, 'fr_FR', the NumberFormatter class fails, giving a 'NaN' result. This is irrespective of the fact that the setlocale() function has clearly worked, as evidenced by gettext() working just fine. I can't see any reason why the setlocale function should have anything to do with the operation of NumberFormatter: this isn't documented, and I'm explicitly passing the locale I want to use in the parameter. Using 5.3.5 (the most recent available through MacPorts) Test script: --- setlocale(LC_ALL, 'en'); $nf = new NumberFormatter('de_DE',NumberFormatter::DECIMAL); print $nf->format(123456.789); // Outputs the correct answer 123.456,789 print "\n"; setlocale(LC_ALL, 'fr_FR'); $nf = new NumberFormatter('de_DE',NumberFormatter::DECIMAL); print $nf->format(123456.789); // Outputs NaN Expected result: 123456.789 123456.789 Actual result: -- 123456.789 NaN -- Edit this bug report at https://bugs.php.net/bug.php?id=54538&edit=1
Bug #55124 [Opn->Ver]: recursive mkdir fails with current (dot) directory in path
Edit report at https://bugs.php.net/bug.php?id=55124&edit=1 ID: 55124 Updated by: paj...@php.net Reported by:cwei...@php.net Summary:recursive mkdir fails with current (dot) directory in path -Status: Open +Status: Verified Type: Bug Package:Directory function related PHP Version:5.3.6 Block user comment: N Private report: N New Comment: verified in ts mode at least. Previous Comments: [2011-07-04 02:41:27] cwei...@php.net Description: Running recursive mkdir fails when there is a "." directory in the path: PHP Warning: mkdir(): File exists in Command line code on line 1 Warning: mkdir(): File exists in Command line code on line 1 When a does not exist, "a" is generated, but "b" is not. When a exists already, everything is fine. Note that I cannot use realpath() to sanitize the path because the path does not exist yet. Test script: --- Actual result: -- $ /opt/phpfarm/inst/bin/php-5.3.6 -v PHP 5.3.6 (cli) (built: Mar 18 2011 09:27:59) (DEBUG) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies $ LC_ALL=C ls a ls: cannot access a: No such file or directory $ /opt/phpfarm/inst/bin/php-5.3.6 -r 'mkdir("a/./b", 0755, true);' PHP Warning: mkdir(): File exists in Command line code on line 1 Warning: mkdir(): File exists in Command line code on line 1 -- Edit this bug report at https://bugs.php.net/bug.php?id=55124&edit=1
[PHP-BUG] Bug #55285 [NEW]: XMLReader::getAttribute/No/Ns methods inconsistency
From: Operating system: Mac OS X 10.6.3 PHP version: 5.3.6 Package: XML Reader Bug Type: Bug Bug description:XMLReader::getAttribute/No/Ns methods inconsistency Description: There are three methods available to retrieve an attribute - getAttribute, getAttributeNo, getAttributeNs. It seems to be natural to expect the similar kind of behavior from them in case when no attribute by given parameters is found. Which is not the case - first one returns NULL, the rest - string(0) "". Test script: --- xml(''); $reader->read(); var_dump($reader->getAttribute('x')); var_dump($reader->getAttributeNs('x', 'http://example.com')); var_dump($reader->getAttributeNo(2)); ?> Expected result: NULL NULL NULL Actual result: -- NULL string(0) "" string(0) "" -- Edit bug report at https://bugs.php.net/bug.php?id=55285&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55285&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55285&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55285&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=55285&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55285&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=55285&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=55285&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=55285&r=needscript Try newer version: https://bugs.php.net/fix.php?id=55285&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=55285&r=support Expected behavior: https://bugs.php.net/fix.php?id=55285&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=55285&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=55285&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=55285&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55285&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=55285&r=dst IIS Stability: https://bugs.php.net/fix.php?id=55285&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=55285&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=55285&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=55285&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=55285&r=mysqlcfg
Req #36944 [PATCH]: strncmp & negative len
Edit report at https://bugs.php.net/bug.php?id=36944&edit=1 ID: 36944 Patch added by: larue...@php.net Reported by:ms419 at freezone dot co dot uk Summary:strncmp & negative len Status: Open Type: Feature/Change Request Package:Strings related Operating System: Debian PHP Version:5.2.6 Block user comment: N Private report: N New Comment: The following patch has been added/updated: Patch Name: php-5-3-trunk-strncmp-supporting-negative-length Revision: 1311679261 URL: https://bugs.php.net/patch-display.php?bug=36944&patch=php-5-3-trunk-strncmp-supporting-negative-length&revision=1311679261 Previous Comments: [2011-07-25 11:40:24] larue...@php.net The following patch has been added/updated: Patch Name: bug36944.phpt Revision: 1311594024 URL: https://bugs.php.net/patch-display.php?bug=36944&patch=bug36944.phpt&revision=1311594024 [2011-07-25 11:37:53] larue...@php.net The following patch has been added/updated: Patch Name: php-5-3-strn-case-cmp-supporting-negative-length Revision: 1311593873 URL: https://bugs.php.net/patch-display.php?bug=36944&patch=php-5-3-strn-case-cmp-supporting-negative-length&revision=1311593873 [2011-07-25 11:06:44] larue...@php.net The following patch has been added/updated: Patch Name: php-5-3-strncasecmp-supporting-negative-length Revision: 1311592004 URL: https://bugs.php.net/patch-display.php?bug=36944&patch=php-5-3-strncasecmp-supporting-negative-length&revision=1311592004 [2008-11-25 18:45:46] ms419 at freezone dot co dot uk I wish to change this bug report to a feature request. I frequently need to check if a string begins or ends with another string. To check if a string begins with another string, I often use strncmp(): ket% php -r 'var_dump(strncmp("HTTP_ACCEPT", "HTTP_", 5));' int(0) ket% - but strncmp() is currently not able to check if a string ends with another string: ket% php -r 'var_dump(strncmp("foo_wrapper", "_wrapper", -8));' Warning: Length must be greater than or equal to 0 in Command line code on line 1 Call Stack: 0.0002 62840 1. {main}() Command line code:0 0.0002 62952 2. strncmp() Command line code:1 bool(false) ket% I wish strncmp() were able to check if a string ends with another string. [2006-04-05 11:37:45] tony2...@php.net This bug has been fixed in CVS. 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/. Thank you for the report, and for helping us make PHP better. Negative string length is not allowed in this function. I just committed the patch, from now you'll get an error and FALSE in this case. 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 https://bugs.php.net/bug.php?id=36944 -- Edit this bug report at https://bugs.php.net/bug.php?id=36944&edit=1
Bug #54556 [PATCH]: array access to empty var does not trigger a notice
Edit report at https://bugs.php.net/bug.php?id=54556&edit=1 ID: 54556 Patch added by: larue...@php.net Reported by:kal dot el dot ias at gmx dot net Summary:array access to empty var does not trigger a notice Status: Verified Type: Bug Package:Scripting Engine problem Operating System: Ubuntu 10.04.2 LTS PHP Version:trunk-SVN-2011-04-18 (snap) Block user comment: N Private report: N New Comment: The following patch has been added/updated: Patch Name: php-5-3-use-a-null-as-array-trigger-notice Revision: 1311678742 URL: https://bugs.php.net/patch-display.php?bug=54556&patch=php-5-3-use-a-null-as-array-trigger-notice&revision=1311678742 Previous Comments: [2011-07-25 12:10:52] larue...@php.net The following patch has been added/updated: Patch Name: php-5-3-use-a-null-as-array-trigger-notice Revision: 1311595852 URL: https://bugs.php.net/patch-display.php?bug=54556&patch=php-5-3-use-a-null-as-array-trigger-notice&revision=1311595852 [2011-07-25 05:40:56] larue...@php.net I have submit a patch for this. and I think this situation should trigger a notice to help developers aware of this. since this mostly might be bad codes.. [2011-07-25 05:29:29] larue...@php.net The following patch has been added/updated: Patch Name: php-5-3-use-a-null-as-array-trigger-notice Revision: 1311586169 URL: https://bugs.php.net/patch-display.php?bug=54556&patch=php-5-3-use-a-null-as-array-trigger-notice&revision=1311586169 [2011-04-27 09:56:51] kal dot el dot ias at gmx dot net title changed [2011-04-26 14:42:31] kal dot el dot ias at gmx dot net bump 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 https://bugs.php.net/bug.php?id=54556 -- Edit this bug report at https://bugs.php.net/bug.php?id=54556&edit=1
Req #55128 [Com]: SplFixedArray::fromArray() does not use extended class
Edit report at https://bugs.php.net/bug.php?id=55128&edit=1 ID: 55128 Comment by: larue...@php.net Reported by:ar at ez dot no Summary:SplFixedArray::fromArray() does not use extended class Status: Analyzed Type: Feature/Change Request Package:SPL related Operating System: * PHP Version:5.3.6 Block user comment: N Private report: N New Comment: After much thought, I think there maybe no reason for fixedarray extended class to define it's own constructor, since we provide fixedarrary::__construct and fromArray already, and extended class should only get an instance through calling them. so I think we can make fixedarray::__construct final to make this feature works. Previous Comments: [2011-07-26 09:57:47] larue...@php.net The following patch has been added/updated: Patch Name: php-5-3-splfixedarray-fromarray-should-return-call-scope-instance Revision: 1311674267 URL: https://bugs.php.net/patch-display.php?bug=55128&patch=php-5-3-splfixedarray-fromarray-should-return-call-scope-instance&revision=1311674267 [2011-07-26 09:49:52] larue...@php.net hmm, that's a really problem, if we want to provide this feature, we should make fixedarray::__construct final. [2011-07-26 08:36:08] cataphr...@php.net What if FixedCollection has a constructor? [2011-07-26 05:35:55] larue...@php.net The following patch has been added/updated: Patch Name: php-5-3-splfixedarray-fromarray-should-return-call-scope-instance Revision: 1311658555 URL: https://bugs.php.net/patch-display.php?bug=55128&patch=php-5-3-splfixedarray-fromarray-should-return-call-scope-instance&revision=1311658555 [2011-07-04 09:50:10] ar at ez dot no Description: It would be nice if SplFixedArray::fromArray() returned the child class instance instead of SplFixedArray instance. Test script: --- class FixedCollection extends SplFixedArray { // impl } $collection = FixedCollection::fromArray( array( 22, 42 ) ); if ( 'FixedCollection' !== get_class( $collection ) ) trigger_error( "fromArray() does not use 'new static'" ) Expected result: I would have expected that function returned an instance of FixedCollection. -- Edit this bug report at https://bugs.php.net/bug.php?id=55128&edit=1
Req #55128 [PATCH]: SplFixedArray::fromArray() does not use extended class
Edit report at https://bugs.php.net/bug.php?id=55128&edit=1 ID: 55128 Patch added by: larue...@php.net Reported by:ar at ez dot no Summary:SplFixedArray::fromArray() does not use extended class Status: Analyzed Type: Feature/Change Request Package:SPL related Operating System: * PHP Version:5.3.6 Block user comment: N Private report: N New Comment: The following patch has been added/updated: Patch Name: php-5-3-splfixedarray-fromarray-should-return-call-scope-instance Revision: 1311674267 URL: https://bugs.php.net/patch-display.php?bug=55128&patch=php-5-3-splfixedarray-fromarray-should-return-call-scope-instance&revision=1311674267 Previous Comments: [2011-07-26 09:49:52] larue...@php.net hmm, that's a really problem, if we want to provide this feature, we should make fixedarray::__construct final. [2011-07-26 08:36:08] cataphr...@php.net What if FixedCollection has a constructor? [2011-07-26 05:35:55] larue...@php.net The following patch has been added/updated: Patch Name: php-5-3-splfixedarray-fromarray-should-return-call-scope-instance Revision: 1311658555 URL: https://bugs.php.net/patch-display.php?bug=55128&patch=php-5-3-splfixedarray-fromarray-should-return-call-scope-instance&revision=1311658555 [2011-07-04 09:50:10] ar at ez dot no Description: It would be nice if SplFixedArray::fromArray() returned the child class instance instead of SplFixedArray instance. Test script: --- class FixedCollection extends SplFixedArray { // impl } $collection = FixedCollection::fromArray( array( 22, 42 ) ); if ( 'FixedCollection' !== get_class( $collection ) ) trigger_error( "fromArray() does not use 'new static'" ) Expected result: I would have expected that function returned an instance of FixedCollection. -- Edit this bug report at https://bugs.php.net/bug.php?id=55128&edit=1
Req #55128 [Com]: SplFixedArray::fromArray() does not use extended class
Edit report at https://bugs.php.net/bug.php?id=55128&edit=1 ID: 55128 Comment by: larue...@php.net Reported by:ar at ez dot no Summary:SplFixedArray::fromArray() does not use extended class Status: Analyzed Type: Feature/Change Request Package:SPL related Operating System: * PHP Version:5.3.6 Block user comment: N Private report: N New Comment: hmm, that's a really problem, if we want to provide this feature, we should make fixedarray::__construct final. Previous Comments: [2011-07-26 08:36:08] cataphr...@php.net What if FixedCollection has a constructor? [2011-07-26 05:35:55] larue...@php.net The following patch has been added/updated: Patch Name: php-5-3-splfixedarray-fromarray-should-return-call-scope-instance Revision: 1311658555 URL: https://bugs.php.net/patch-display.php?bug=55128&patch=php-5-3-splfixedarray-fromarray-should-return-call-scope-instance&revision=1311658555 [2011-07-04 09:50:10] ar at ez dot no Description: It would be nice if SplFixedArray::fromArray() returned the child class instance instead of SplFixedArray instance. Test script: --- class FixedCollection extends SplFixedArray { // impl } $collection = FixedCollection::fromArray( array( 22, 42 ) ); if ( 'FixedCollection' !== get_class( $collection ) ) trigger_error( "fromArray() does not use 'new static'" ) Expected result: I would have expected that function returned an instance of FixedCollection. -- Edit this bug report at https://bugs.php.net/bug.php?id=55128&edit=1
Req #55128 [Ana]: SplFixedArray::fromArray() does not use extended class
Edit report at https://bugs.php.net/bug.php?id=55128&edit=1 ID: 55128 Updated by: cataphr...@php.net Reported by:ar at ez dot no Summary:SplFixedArray::fromArray() does not use extended class Status: Analyzed Type: Feature/Change Request Package:SPL related Operating System: * PHP Version:5.3.6 Block user comment: N Private report: N New Comment: What if FixedCollection has a constructor? Previous Comments: [2011-07-26 05:35:55] larue...@php.net The following patch has been added/updated: Patch Name: php-5-3-splfixedarray-fromarray-should-return-call-scope-instance Revision: 1311658555 URL: https://bugs.php.net/patch-display.php?bug=55128&patch=php-5-3-splfixedarray-fromarray-should-return-call-scope-instance&revision=1311658555 [2011-07-04 09:50:10] ar at ez dot no Description: It would be nice if SplFixedArray::fromArray() returned the child class instance instead of SplFixedArray instance. Test script: --- class FixedCollection extends SplFixedArray { // impl } $collection = FixedCollection::fromArray( array( 22, 42 ) ); if ( 'FixedCollection' !== get_class( $collection ) ) trigger_error( "fromArray() does not use 'new static'" ) Expected result: I would have expected that function returned an instance of FixedCollection. -- Edit this bug report at https://bugs.php.net/bug.php?id=55128&edit=1