[PHP-BUG] Bug #64307 [NEW]: Floating point error
From: sokkis at gmail dot com Operating system: Gentoo linux PHP version: 5.4.12 Package: Variables related Bug Type: Bug Bug description:Floating point error Description: Floating point rounded when print, but won't on subtraction. Test script: --- ?php $n1 = 905000; $n2 = 0.27; $ertek =$n1*$n2; $egesz = round( $ertek ); $eredmeny = $ertek-$egesz; echo $ertek - $egesz = $eredmeny\n; $n1 = 905000; $n2 = 0.27; $ertek =$n1*$n2; $egesz = (int) $ertek; $eredmeny = $ertek-$egesz; echo $ertek - $egesz = $eredmeny; Expected result: 244350 - 244350 = 0 244350 - 244350 = 0 Actual result: -- 244350 - 244350 = 2.9103830456734E-11 244350 - 244350 = 2.9103830456734E-11 -- Edit bug report at https://bugs.php.net/bug.php?id=64307edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64307r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64307r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64307r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=64307r=fixed Fixed in release: https://bugs.php.net/fix.php?id=64307r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=64307r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=64307r=needscript Try newer version: https://bugs.php.net/fix.php?id=64307r=oldversion Not developer issue:https://bugs.php.net/fix.php?id=64307r=support Expected behavior: https://bugs.php.net/fix.php?id=64307r=notwrong Not enough info: https://bugs.php.net/fix.php?id=64307r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=64307r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=64307r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64307r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=64307r=dst IIS Stability: https://bugs.php.net/fix.php?id=64307r=isapi Install GNU Sed:https://bugs.php.net/fix.php?id=64307r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=64307r=float No Zend Extensions: https://bugs.php.net/fix.php?id=64307r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=64307r=mysqlcfg
Bug #64307 [Opn-Nab]: Floating point error
Edit report at https://bugs.php.net/bug.php?id=64307edit=1 ID: 64307 Updated by: paj...@php.net Reported by:sokkis at gmail dot com Summary:Floating point error -Status: Open +Status: Not a bug Type: Bug Package:Variables related Operating System: Gentoo linux PHP Version:5.4.12 Block user comment: N Private report: N New Comment: Floating point values have a limited precision. Hence a value might not have the same string representation after any processing. That also includes writing a floating point value in your script and directly printing it without any mathematical operations. If you would like to know more about floats and what IEEE 754 is, read this: http://www.floating-point-gui.de/ Thank you for your interest in PHP. Previous Comments: [2013-02-27 09:31:27] sokkis at gmail dot com Description: Floating point rounded when print, but won't on subtraction. Test script: --- ?php $n1 = 905000; $n2 = 0.27; $ertek =$n1*$n2; $egesz = round( $ertek ); $eredmeny = $ertek-$egesz; echo $ertek - $egesz = $eredmeny\n; $n1 = 905000; $n2 = 0.27; $ertek =$n1*$n2; $egesz = (int) $ertek; $eredmeny = $ertek-$egesz; echo $ertek - $egesz = $eredmeny; Expected result: 244350 - 244350 = 0 244350 - 244350 = 0 Actual result: -- 244350 - 244350 = 2.9103830456734E-11 244350 - 244350 = 2.9103830456734E-11 -- Edit this bug report at https://bugs.php.net/bug.php?id=64307edit=1
Bug #64307 [Com]: Floating point error
Edit report at https://bugs.php.net/bug.php?id=64307edit=1 ID: 64307 Comment by: sokkis at gmail dot com Reported by:sokkis at gmail dot com Summary:Floating point error Status: Not a bug Type: Bug Package:Variables related Operating System: Gentoo linux PHP Version:5.4.12 Block user comment: N Private report: N New Comment: Floating point values have a limited precision It's ok, but why not: 244350,... - 244350 = 2.9103830456734E-11 the output? So, if floating point variable has limited precision, it has it if echod, and has if make subractions, or any other. Previous Comments: [2013-02-27 09:42:45] paj...@php.net Floating point values have a limited precision. Hence a value might not have the same string representation after any processing. That also includes writing a floating point value in your script and directly printing it without any mathematical operations. If you would like to know more about floats and what IEEE 754 is, read this: http://www.floating-point-gui.de/ Thank you for your interest in PHP. [2013-02-27 09:31:27] sokkis at gmail dot com Description: Floating point rounded when print, but won't on subtraction. Test script: --- ?php $n1 = 905000; $n2 = 0.27; $ertek =$n1*$n2; $egesz = round( $ertek ); $eredmeny = $ertek-$egesz; echo $ertek - $egesz = $eredmeny\n; $n1 = 905000; $n2 = 0.27; $ertek =$n1*$n2; $egesz = (int) $ertek; $eredmeny = $ertek-$egesz; echo $ertek - $egesz = $eredmeny; Expected result: 244350 - 244350 = 0 244350 - 244350 = 0 Actual result: -- 244350 - 244350 = 2.9103830456734E-11 244350 - 244350 = 2.9103830456734E-11 -- Edit this bug report at https://bugs.php.net/bug.php?id=64307edit=1
Bug #64214 [Com]: PHAR PHPTs intermittently crash when run on DFS or SMB
Edit report at https://bugs.php.net/bug.php?id=64214edit=1 ID: 64214 Comment by: user at kkdf2 dot sakura dot ne dot jp Reported by:mattfic...@php.net Summary:PHAR PHPTs intermittently crash when run on DFS or SMB Status: Open Type: Bug Package:PHAR related Operating System: Windows PHP Version:5.5.0alpha4 Block user comment: N Private report: N New Comment: About NAS, it may be possible. For example, My company's NAS Buffalo Ls-L series freezes sometimes when I try simultaneous client accesses. It seems that NAS exhausts its ram memory by operating multiple file requests. Previous Comments: [2013-02-14 23:52:25] mattfic...@php.net Description: I am running PHPT tests on an SMB file share (and also sometimes DFS) served by a remote file server. The share is mounted to a local drive (H:) on Windows. This issue occurs on Windows 7, Vista, 2008, 2008r2, 8, 2012, x64 and x86 (I am using the PHP on Windows binary build from windows.php.net without any modification). When I run these 2 PHAR tests, sometimes, they crash: ext/phar/tests/zip/phar_commitwrite.phpt ext/phar/tests/tar/phar_setsignaturealgo2.phpt See attached BTs. If I add additional traffic to the network or file server (ex: download a big file on another computer), the crashes happen more frequently. Even then, I'm only adding max ~10MiB/S to network or file server which isn't really heavy load. The file access times on the share are still pretty normal (fraction of a second max, to read a PHPT file, so the network or file server is never heavily loaded). I believe this is a time issue that is load induced. Actual result: -- ext/phar/tests/zip/phar_commitwrite.phpt php5ts.dll!_php_stream_write(_php_stream * stream, const char * buf, unsigned int count, void * * * tsrm_ls) Line 1233 + 0x10 bytes C php5ts.dll!phar_zip_flush(_phar_archive_data * phar, char * user_stub, long len, int defaultstub, char * * error, void * * * tsrm_ls) Line 1304 + 0x18 bytes C php5ts.dll!phar_flush(_phar_archive_data * phar, char * user_stub, long len, int convert, char * * error, void * * * tsrm_ls) Line 2601 + 0x18 bytes C php5ts.dll!phar_add_file(_phar_archive_data * * pphar, char * filename, int filename_len, char * cont_str, int cont_len, _zval_struct * zresource, void * * * tsrm_ls) Line 3737 + 0x11 bytesC php5ts.dll!zim_Phar_offsetSet(int ht, _zval_struct * return_value, _zval_struct * * return_value_ptr, _zval_struct * this_ptr, int return_value_used, void * * * tsrm_ls) Line 3818 + 0x14 bytes C php5ts.dll!zend_call_function(_zend_fcall_info * fci, _zend_fcall_info_cache * fci_cache, void * * * tsrm_ls) Line 959 + 0x1f bytes C php5ts.dll!zend_call_method(_zval_struct * * object_pp, _zend_class_entry * obj_ce, _zend_function * * fn_proxy, const char * function_name, int function_name_len, _zval_struct * * retval_ptr_ptr, int param_count, _zval_struct * arg1, _zval_struct * arg2, void * * * tsrm_ls) Line 97 + 0x14 bytes C php5ts.dll!zend_std_write_dimension(_zval_struct * object, _zval_struct * offset, _zval_struct * value, void * * * tsrm_ls) Line 678 + 0x1e bytes C php5ts.dll!ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER(_zend_execute_data * execute_data, void * * * tsrm_ls) Line 32607 + 0xbc bytes C ext/phar/tests/tar/phar_setsignaturealgo2.phpt php5ts.dll!user_wrapper_opener(_php_stream_wrapper * wrapper, char * filename, char * mode, int options, char * * opened_path, _php_stream_context * context, void * * * tsrm_ls) Line 346 + 0x2f bytes C php5ts.dll!_php_stream_open_wrapper_ex(char * path, char * mode, int options, char * * opened_path, _php_stream_context * context, void * * * tsrm_ls) Line 2054 + 0x24 bytes C php5ts.dll!php_if_fopen(int ht, _zval_struct * return_value, _zval_struct * * return_value_ptr, _zval_struct * this_ptr, int return_value_used, void * * * tsrm_ls) Line 869 + 0x1a bytes C php5ts.dll!phar_fopen(int ht, _zval_struct * return_value, _zval_struct * * return_value_ptr, _zval_struct * this_ptr, int return_value_used, void * * * tsrm_ls) Line 418 + 0x22 bytes C php5ts.dll!zend_do_fcall_common_helper_SPEC(_zend_execute_data * execute_data, void * * * tsrm_ls) Line 542 + 0x5e bytes C php5ts.dll!ZEND_DO_FCALL_SPEC_CONST_HANDLER(_zend_execute_data * execute_data, void * * * tsrm_ls) Line 2305 + 0xb bytes C php5ts.dll!execute_ex(_zend_execute_data * execute_data, void * * * tsrm_ls) Line 356 + 0xa bytes C
[PHP-BUG] Bug #64309 [NEW]: asdadasdasdad
From: tgfh at df dot com Operating system: xp PHP version: 5.3.22 Package: *General Issues Bug Type: Bug Bug description:asdadasdasdad Description: --- From manual page: http://www.php.net/function.implode#refsect1-function.implode- examples --- Expected result: dsf Actual result: -- dsf -- Edit bug report at https://bugs.php.net/bug.php?id=64309edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64309r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64309r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64309r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=64309r=fixed Fixed in release: https://bugs.php.net/fix.php?id=64309r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=64309r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=64309r=needscript Try newer version: https://bugs.php.net/fix.php?id=64309r=oldversion Not developer issue:https://bugs.php.net/fix.php?id=64309r=support Expected behavior: https://bugs.php.net/fix.php?id=64309r=notwrong Not enough info: https://bugs.php.net/fix.php?id=64309r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=64309r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=64309r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64309r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=64309r=dst IIS Stability: https://bugs.php.net/fix.php?id=64309r=isapi Install GNU Sed:https://bugs.php.net/fix.php?id=64309r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=64309r=float No Zend Extensions: https://bugs.php.net/fix.php?id=64309r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=64309r=mysqlcfg
Bug #64309 [Opn-Spm]: asdadasdasdad
Edit report at https://bugs.php.net/bug.php?id=64309edit=1 ID: 64309 Updated by: paj...@php.net Reported by:tgfh at df dot com Summary:asdadasdasdad -Status: Open +Status: Spam Type: Bug Package:*General Issues Operating System: xp PHP Version:5.3.22 Block user comment: N Private report: N Previous Comments: [2013-02-27 11:38:29] tgfh at df dot com Description: --- From manual page: http://www.php.net/function.implode#refsect1-function.implode- examples --- Expected result: dsf Actual result: -- dsf -- Edit this bug report at https://bugs.php.net/bug.php?id=64309edit=1
Bug #64307 [Nab]: Floating point error
Edit report at https://bugs.php.net/bug.php?id=64307edit=1 ID: 64307 Updated by: ni...@php.net Reported by:sokkis at gmail dot com Summary:Floating point error Status: Not a bug Type: Bug Package:Variables related Operating System: Gentoo linux PHP Version:5.4.12 Block user comment: N Private report: N New Comment: @sokkis: I don't quite understand what you are asking, but maybe you are looking for the precision ini option, which controls with how much precision floats will be displayed when converted to string. See here for an example: http://codepad.viper-7.com/o4M9q3 Previous Comments: [2013-02-27 09:46:45] sokkis at gmail dot com Floating point values have a limited precision It's ok, but why not: 244350,... - 244350 = 2.9103830456734E-11 the output? So, if floating point variable has limited precision, it has it if echod, and has if make subractions, or any other. [2013-02-27 09:42:45] paj...@php.net Floating point values have a limited precision. Hence a value might not have the same string representation after any processing. That also includes writing a floating point value in your script and directly printing it without any mathematical operations. If you would like to know more about floats and what IEEE 754 is, read this: http://www.floating-point-gui.de/ Thank you for your interest in PHP. [2013-02-27 09:31:27] sokkis at gmail dot com Description: Floating point rounded when print, but won't on subtraction. Test script: --- ?php $n1 = 905000; $n2 = 0.27; $ertek =$n1*$n2; $egesz = round( $ertek ); $eredmeny = $ertek-$egesz; echo $ertek - $egesz = $eredmeny\n; $n1 = 905000; $n2 = 0.27; $ertek =$n1*$n2; $egesz = (int) $ertek; $eredmeny = $ertek-$egesz; echo $ertek - $egesz = $eredmeny; Expected result: 244350 - 244350 = 0 244350 - 244350 = 0 Actual result: -- 244350 - 244350 = 2.9103830456734E-11 244350 - 244350 = 2.9103830456734E-11 -- Edit this bug report at https://bugs.php.net/bug.php?id=64307edit=1
Bug #64312 [Com]: set_error_handler always return handler if called inside an error_handler
Edit report at https://bugs.php.net/bug.php?id=64312edit=1 ID: 64312 Comment by: php at maisqi dot com Reported by:php at maisqi dot com Summary:set_error_handler always return handler if called inside an error_handler Status: Open Type: Bug Package:*General Issues Operating System: Win7 32 bits PHP Version:5.4.12 Block user comment: N Private report: N New Comment: Test script: http://maisqi.com/outros/bugs/php/64312 Previous Comments: [2013-02-27 15:43:04] php at maisqi dot com Description: If you set an error handler when inside an error handling function, set_error_handler will always return NULL. Test script: --- pre ?php function first_handler () { echo first_handler\n; echo ' Set to second handler: strong', gettype (set_error_handler ('second_handler')), /strong\n; echo \n\n, '$y = $o', \n; $y = $o; } function second_handler () { echo second_handler\n; } set_error_handler ('first_handler'); echo '$x = $y', \n; $x = $y; echo ' Set to other handler: strong', gettype (set_error_handler (function(){})), /strong\n; Expected result: set_error_handler should return the name of the error handling function, which in this case would be the name of the running function. Actual result: -- It just returns null. -- Edit this bug report at https://bugs.php.net/bug.php?id=64312edit=1
[PHP-BUG] Bug #64312 [NEW]: set_error_handler always return handler if called inside an error_handler
From: php at maisqi dot com Operating system: Win7 32 bits PHP version: 5.4.12 Package: *General Issues Bug Type: Bug Bug description:set_error_handler always return handler if called inside an error_handler Description: If you set an error handler when inside an error handling function, set_error_handler will always return NULL. Test script: --- pre ?php function first_handler () { echo first_handler\n; echo ' Set to second handler: strong', gettype (set_error_handler ('second_handler')), /strong\n; echo \n\n, '$y = $o', \n; $y = $o; } function second_handler () { echo second_handler\n; } set_error_handler ('first_handler'); echo '$x = $y', \n; $x = $y; echo ' Set to other handler: strong', gettype (set_error_handler (function(){})), /strong\n; Expected result: set_error_handler should return the name of the error handling function, which in this case would be the name of the running function. Actual result: -- It just returns null. -- Edit bug report at https://bugs.php.net/bug.php?id=64312edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64312r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64312r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64312r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=64312r=fixed Fixed in release: https://bugs.php.net/fix.php?id=64312r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=64312r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=64312r=needscript Try newer version: https://bugs.php.net/fix.php?id=64312r=oldversion Not developer issue:https://bugs.php.net/fix.php?id=64312r=support Expected behavior: https://bugs.php.net/fix.php?id=64312r=notwrong Not enough info: https://bugs.php.net/fix.php?id=64312r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=64312r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=64312r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64312r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=64312r=dst IIS Stability: https://bugs.php.net/fix.php?id=64312r=isapi Install GNU Sed:https://bugs.php.net/fix.php?id=64312r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=64312r=float No Zend Extensions: https://bugs.php.net/fix.php?id=64312r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=64312r=mysqlcfg
Bug #53467 [Com]: Phar cannot compress large archives
Edit report at https://bugs.php.net/bug.php?id=53467edit=1 ID: 53467 Comment by: cicerc...@php.net Reported by:mep_eisen at web dot de Summary:Phar cannot compress large archives Status: Open Type: Bug Package:PHAR related Operating System: Windows 7 - 64 PHP Version:5.3.3 Block user comment: N Private report: N New Comment: Still present with PHP 5.4 as well (with Ubuntu 12.04). PHP 5.4.12-1~quantal+1 (cli) (built: Feb 25 2013 19:19:48) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans Previous Comments: [2012-07-27 12:10:16] mep_eisen at web dot de This bug is still present. The workarounds on large phar files are resulting high cpu-load and packaging phar in more than 30 mins. [2011-09-05 06:15:37] d dot kreuer at kremedia dot de I have the same problem under Ubuntu 10.04.3 with PHP 5.3.5 PHP 5.3.5-1ubuntu7.2ppa1~lucid with Suhosin-Patch (cli) (built: May 7 2011 03:15:14) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies with the ionCube PHP Loader v4.0.7, Copyright (c) 2002-2011, by ionCube Ltd. with Suhosin v0.9.29, Copyright (c) 2007, by SektionEins GmbH [2010-12-03 20:31:20] mep_eisen at web dot de Description: I tried to create a large phar (exactly 2347 files). However compressing the phar simply fails. That may be a similar problem as closed pecl bug: http://pecl.php.net/bugs/bug.php?id=13727 Smaller phars are working. If using the commented section (compress them by hand) it does work but this is really slow. Test script: --- ?php if (file_exists('D:\\Dev\\ws\\mavenphp-flow3\\FLOW3\\target'.DIRECTORY_SEPARATOR.'FLOW3-1.0.0-alpha-13.phar')) unlink('D:\\Dev\\ws\\mavenphp-flow3\\FLOW3\\target'.DIRECTORY_SEPARATOR.'FLOW3-1.0.0-alpha-13.phar'); $phar = new Phar('D:\\Dev\\ws\\mavenphp-flow3\\FLOW3\\target'.DIRECTORY_SEPARATOR.'FLOW3-1.0.0-alpha-13.phar', 0, 'FLOW3-1.0.0-alpha-13.phar'); $phar-startBuffering(); //$localDir = realpath('D:\\Dev\\ws\\mavenphp-flow3\\FLOW3\\target\\classes\\Packages\\This\\FLOW3'); //$iter = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(realpath('D:\\Dev\\ws\\mavenphp-flow3\\FLOW3\\target\\classes\\Packages\\This\\FLOW3'))); //foreach ($iter as $file) //{ // $pathName = $file-getPathname(); // $localName = substr($pathName, strlen($localDir)); // $phar-addFile($pathName, $localName); // echo adding $localName.PHP_EOL; // $phar[$localName]-compress(Phar::GZ); //} $phar-buildFromIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator(realpath('D:\\Dev\\ws\\mavenphp-flow3\\FLOW3\\target\\classes\\Packages\\This\\FLOW3'))), realpath('D:\\Dev\\ws\\mavenphp-flow3\\FLOW3\\target\\classes\\Packages\\This\\FLOW3')); echo packed .$phar-count(). files.PHP_EOL; echo compressing.PHP_EOL; $phar-compressFiles(Phar::GZ); $phar-setStub('?php die(\'Unable to execute this phar\'); __HALT_COMPILER(); ?'); $phar-stopBuffering(); Expected result: expected to get the phar. Actual result: -- BadMethodCallException: unable to create temporary file in D:\Dev\ws\mavenphp-fl ow3\FLOW3\target\packagePhar.php on line 20 Call Stack: 0.0011 332160 1. {main}() D:\Dev\ws\mavenphp-flow3\FLOW3\target\packag ePhar.php:0 5.15701068784 2. Phar-compressFiles() D:\Dev\ws\mavenphp-flow3\FLOW3\ target\packagePhar.php:20 -- Edit this bug report at https://bugs.php.net/bug.php?id=53467edit=1
[PHP-BUG] Req #64313 [NEW]: DateTime DateTimeZone constructs should emit DateTimeException
From: mattsch at gmail dot com Operating system: PHP version: 5.3.22 Package: Date/time related Bug Type: Feature/Change Request Bug description:DateTime DateTimeZone constructs should emit DateTimeException Description: DateTime and DateTimeZone constructs currently emit Exception but they should really emit an exception related to their respective classes. The reason for this is the code can run in multiple environments (ui, phpunit, etc). If I want the exception to bubble up to the base exception in my application environment, I want to catch it and rethrow it with an exception that ultimately extends my app base exception. As a result, I must catch the base php Exception class and rethrow it with the wrapper exception which extends my base app exception. The problem comes when I try to run testcases on the class in the phpunit environment. Since phpunit emits exceptions, catching Exception will also catch phpunit environment exceptions which is not what I want. As a result, I must check the instance of the exception and allow phpunit exceptions to go through unchanged. If the DateTime and DateTimeZone classes did not throw Exception, then this would not be a problem. In fact, I don't think any php command should actually throw the main php Exception and should always throw an exception that is extended from Exception to avoid problems like this. Test script: --- ?php class DateTimeWrapper { private $dateTime; public function __construct($time = 'now', DateTimeZone $timezone = null, $format = null) { $this-setDateTime($time, $timezone, $format); } public function setDateTime($time = 'now', DateTimeZone $timezone = null, $format = null) { try { $this-dateTime = new DateTime($time, $timezone); } catch (Exception $e) { /* PHP DateTime really shouldn't throw the catch all Exception so the workaround is to keep this from catching phpunit exceptions as well so do instance checks on it. */ // @codeCoverageIgnoreStart if ($e instanceof PHPUnit_Framework_Error || $e instanceof PHPUnit_Framework_Exception) { throw $e; } // @codeCoverageIgnoreEnd throw new DateTimeWrapperException($e-getMessage(), $e-getCode(), $e); } } } Expected result: php should not throw Exception directly but rather an exception that extends Exception. Actual result: -- php throws Exception in places like DateTime and DateTimeZone when it should really throw an exception like DateTimeException instead which would extend Exception. -- Edit bug report at https://bugs.php.net/bug.php?id=64313edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64313r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64313r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64313r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=64313r=fixed Fixed in release: https://bugs.php.net/fix.php?id=64313r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=64313r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=64313r=needscript Try newer version: https://bugs.php.net/fix.php?id=64313r=oldversion Not developer issue:https://bugs.php.net/fix.php?id=64313r=support Expected behavior: https://bugs.php.net/fix.php?id=64313r=notwrong Not enough info: https://bugs.php.net/fix.php?id=64313r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=64313r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=64313r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64313r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=64313r=dst IIS Stability: https://bugs.php.net/fix.php?id=64313r=isapi Install GNU Sed:https://bugs.php.net/fix.php?id=64313r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=64313r=float No Zend Extensions: https://bugs.php.net/fix.php?id=64313r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=64313r=mysqlcfg
Req #64313 [Com]: DateTime DateTimeZone constructs should emit DateTimeException
Edit report at https://bugs.php.net/bug.php?id=64313edit=1 ID: 64313 Comment by: mattsch at gmail dot com Reported by:mattsch at gmail dot com Summary:DateTime DateTimeZone constructs should emit DateTimeException Status: Open Type: Feature/Change Request Package:Date/time related PHP Version:5.3.22 Block user comment: N Private report: N New Comment: Forget the $format part of the test script. I changed the class slightly to show a simplified form of the problem. Previous Comments: [2013-02-27 18:46:31] mattsch at gmail dot com Description: DateTime and DateTimeZone constructs currently emit Exception but they should really emit an exception related to their respective classes. The reason for this is the code can run in multiple environments (ui, phpunit, etc). If I want the exception to bubble up to the base exception in my application environment, I want to catch it and rethrow it with an exception that ultimately extends my app base exception. As a result, I must catch the base php Exception class and rethrow it with the wrapper exception which extends my base app exception. The problem comes when I try to run testcases on the class in the phpunit environment. Since phpunit emits exceptions, catching Exception will also catch phpunit environment exceptions which is not what I want. As a result, I must check the instance of the exception and allow phpunit exceptions to go through unchanged. If the DateTime and DateTimeZone classes did not throw Exception, then this would not be a problem. In fact, I don't think any php command should actually throw the main php Exception and should always throw an exception that is extended from Exception to avoid problems like this. Test script: --- ?php class DateTimeWrapper { private $dateTime; public function __construct($time = 'now', DateTimeZone $timezone = null, $format = null) { $this-setDateTime($time, $timezone, $format); } public function setDateTime($time = 'now', DateTimeZone $timezone = null, $format = null) { try { $this-dateTime = new DateTime($time, $timezone); } catch (Exception $e) { /* PHP DateTime really shouldn't throw the catch all Exception so the workaround is to keep this from catching phpunit exceptions as well so do instance checks on it. */ // @codeCoverageIgnoreStart if ($e instanceof PHPUnit_Framework_Error || $e instanceof PHPUnit_Framework_Exception) { throw $e; } // @codeCoverageIgnoreEnd throw new DateTimeWrapperException($e-getMessage(), $e-getCode(), $e); } } } Expected result: php should not throw Exception directly but rather an exception that extends Exception. Actual result: -- php throws Exception in places like DateTime and DateTimeZone when it should really throw an exception like DateTimeException instead which would extend Exception. -- Edit this bug report at https://bugs.php.net/bug.php?id=64313edit=1
[PHP-BUG] Bug #64314 [NEW]: imagettfbbox loads wrong fontname if using ../ and underscore in font name
From: ctcrmcou at opm dot gov Operating system: W7 PHP version: Irrelevant Package: GD related Bug Type: Bug Bug description:imagettfbbox loads wrong fontname if using ../ and underscore in font name Description: Assuming a subdirectory named fonts contains 30 fonts named font_1.ttf - font_30.ttf, calling imagettfbox with a fontname such as ../fonts/font_10.ttf loads incorrect font, the number part is somehow being altered and the wrong font is loading. Somehow the combination of ../ and _ in the finename param are screwing things up. This is not a file/font not found error. This is the font that loads font_13.ttf is actually loading font_14.ttf, or font_28.ttf is loading font_10.ttf. I can only guess the underscore is changing the meaning of the number or the number is being converted. Test script: --- Works: $box=imagettfbbox(100,0,fonts/font_10.ttf,some text); Doesn't work (wrong font loads): $box=imagettfbbox(100,0,../fonts/font_10.ttf,some text); Workaround 1: remove underscore from font names $box=imagettfbbox(100,0,../fonts/font10.ttf,some text); Workaround 2: move app that loads font to higher directory level (no ../ in path) $box=imagettfbbox(100,0,fonts/font_10.ttf,some text); -- Edit bug report at https://bugs.php.net/bug.php?id=64314edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64314r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64314r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64314r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=64314r=fixed Fixed in release: https://bugs.php.net/fix.php?id=64314r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=64314r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=64314r=needscript Try newer version: https://bugs.php.net/fix.php?id=64314r=oldversion Not developer issue:https://bugs.php.net/fix.php?id=64314r=support Expected behavior: https://bugs.php.net/fix.php?id=64314r=notwrong Not enough info: https://bugs.php.net/fix.php?id=64314r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=64314r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=64314r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64314r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=64314r=dst IIS Stability: https://bugs.php.net/fix.php?id=64314r=isapi Install GNU Sed:https://bugs.php.net/fix.php?id=64314r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=64314r=float No Zend Extensions: https://bugs.php.net/fix.php?id=64314r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=64314r=mysqlcfg
[PHP-BUG] Bug #64316 [NEW]: function date not returning correct value for short int
From: ff at darkpenguin dot com dot br Operating system: OpenSuse 12.1 PHP version: 5.3.22 Package: Date/time related Bug Type: Bug Bug description:function date not returning correct value for short int Description: --- From manual page: http://www.php.net/function.date#refsect1-function.date-description --- Function date is not formatting time correctly when used with date_default_timezone_set and small integers. Test script: --- print date('H:i:s',24); // this should and do print 00:00:24, but when I do this: date_default_timezone_set('America/Sao_Paulo'); print date('H:i:s',24); // this prints 21:00:24 Expected result: On the first print date I expect and get the result 00:00:24, on the second print I get 21:00:24 where I expected the same result before. -- Edit bug report at https://bugs.php.net/bug.php?id=64316edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64316r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64316r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64316r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=64316r=fixed Fixed in release: https://bugs.php.net/fix.php?id=64316r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=64316r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=64316r=needscript Try newer version: https://bugs.php.net/fix.php?id=64316r=oldversion Not developer issue:https://bugs.php.net/fix.php?id=64316r=support Expected behavior: https://bugs.php.net/fix.php?id=64316r=notwrong Not enough info: https://bugs.php.net/fix.php?id=64316r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=64316r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=64316r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64316r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=64316r=dst IIS Stability: https://bugs.php.net/fix.php?id=64316r=isapi Install GNU Sed:https://bugs.php.net/fix.php?id=64316r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=64316r=float No Zend Extensions: https://bugs.php.net/fix.php?id=64316r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=64316r=mysqlcfg
Bug #64316 [Opn-Nab]: function date not returning correct value for short int
Edit report at https://bugs.php.net/bug.php?id=64316edit=1 ID: 64316 Updated by: ras...@php.net Reported by:ff at darkpenguin dot com dot br Summary:function date not returning correct value for short int -Status: Open +Status: Not a bug Type: Bug Package:Date/time related Operating System: OpenSuse 12.1 PHP Version:5.3.22 Block user comment: N Private report: N New Comment: America/Sao_Paulo is not UTC so it couldn't possibly output 00:00:24 Previous Comments: [2013-02-27 21:34:04] ff at darkpenguin dot com dot br Description: --- From manual page: http://www.php.net/function.date#refsect1-function.date-description --- Function date is not formatting time correctly when used with date_default_timezone_set and small integers. Test script: --- print date('H:i:s',24); // this should and do print 00:00:24, but when I do this: date_default_timezone_set('America/Sao_Paulo'); print date('H:i:s',24); // this prints 21:00:24 Expected result: On the first print date I expect and get the result 00:00:24, on the second print I get 21:00:24 where I expected the same result before. -- Edit this bug report at https://bugs.php.net/bug.php?id=64316edit=1
[PHP-BUG] Req #64317 [NEW]: [PATCH] add ldap_modify_batch function
From: ondra dot hosek at gmail dot com Operating system: PHP version: Irrelevant Package: LDAP related Bug Type: Feature/Change Request Bug description:[PATCH] add ldap_modify_batch function Description: Hi, motivated by the impossibility of performing an Active Directory password change (not reset), which requires a simultaneous REMOVE and ADD operation on the unicodePwd attribute of a user, I have set out to write a function named ldap_modify_batch that would allow this. The test script demonstrates the API of this function. I'll admit that this API (especially the array-of-arrays-of-arrays part) is a bit weird and I'll gladly accept tips on how to streamline it. There is also a (more complete but also more contrived) example in the function body itself. Test script: --- ?php function adifyPw($pw) { $quoted = '' . $pw . ''; $utf16d = iconv(UTF-8, UTF-16LE, $quoted); return $utf16d; } $curPwd = adifyPw(Tr0ub4dor3); $newPwd = adifyPw(correct horse battery staple); $conn = ldap_connect(ldaps://dc.ad.example.com/); ldap_bind($conn, j...@ad.example.com, Tr0ub4dor3); $mods = array( array( attrib = unicodePwd, modtype = LDAP_MODIFY_BATCH_REMOVE, values = array($curPwd) ), array( attrib = unicodePwd, modtype = LDAP_MODIFY_BATCH_ADD, values = array($newPwd) ) ); ldap_modify_batch($conn, cn=John Smith,ou=Accounting,dc=ad,dc=example,dc=com, $mods); ldap_close($conn); ? -- Edit bug report at https://bugs.php.net/bug.php?id=64317edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64317r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64317r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64317r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=64317r=fixed Fixed in release: https://bugs.php.net/fix.php?id=64317r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=64317r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=64317r=needscript Try newer version: https://bugs.php.net/fix.php?id=64317r=oldversion Not developer issue:https://bugs.php.net/fix.php?id=64317r=support Expected behavior: https://bugs.php.net/fix.php?id=64317r=notwrong Not enough info: https://bugs.php.net/fix.php?id=64317r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=64317r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=64317r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64317r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=64317r=dst IIS Stability: https://bugs.php.net/fix.php?id=64317r=isapi Install GNU Sed:https://bugs.php.net/fix.php?id=64317r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=64317r=float No Zend Extensions: https://bugs.php.net/fix.php?id=64317r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=64317r=mysqlcfg
Bug #64312 [Opn]: set_error_handler always return handler if called inside an error_handler
Edit report at https://bugs.php.net/bug.php?id=64312edit=1 ID: 64312 Updated by: larue...@php.net Reported by:php at maisqi dot com Summary:set_error_handler always return handler if called inside an error_handler Status: Open Type: Bug Package:*General Issues Operating System: Win7 32 bits PHP Version:5.4.12 Block user comment: N Private report: N New Comment: before calling to user error handler, PHP will set empty to EG(uesr_error_handler) in case of recursivly call to error handler if there is some error in the error_handler function self. IMO this is a trivial bug, if we want to to fix this, maybe add a new EG(origin_user_error_handler)... Previous Comments: [2013-02-27 15:45:43] php at maisqi dot com Test script: http://maisqi.com/outros/bugs/php/64312 [2013-02-27 15:43:04] php at maisqi dot com Description: If you set an error handler when inside an error handling function, set_error_handler will always return NULL. Test script: --- pre ?php function first_handler () { echo first_handler\n; echo ' Set to second handler: strong', gettype (set_error_handler ('second_handler')), /strong\n; echo \n\n, '$y = $o', \n; $y = $o; } function second_handler () { echo second_handler\n; } set_error_handler ('first_handler'); echo '$x = $y', \n; $x = $y; echo ' Set to other handler: strong', gettype (set_error_handler (function(){})), /strong\n; Expected result: set_error_handler should return the name of the error handling function, which in this case would be the name of the running function. Actual result: -- It just returns null. -- Edit this bug report at https://bugs.php.net/bug.php?id=64312edit=1
Bug #64312 [Opn-Ana]: set_error_handler always return handler if called inside an error_handler
Edit report at https://bugs.php.net/bug.php?id=64312edit=1 ID: 64312 Updated by: larue...@php.net Reported by:php at maisqi dot com Summary:set_error_handler always return handler if called inside an error_handler -Status: Open +Status: Analyzed Type: Bug Package:*General Issues Operating System: Win7 32 bits PHP Version:5.4.12 Block user comment: N Private report: N Previous Comments: [2013-02-28 02:41:18] larue...@php.net before calling to user error handler, PHP will set empty to EG(uesr_error_handler) in case of recursivly call to error handler if there is some error in the error_handler function self. IMO this is a trivial bug, if we want to to fix this, maybe add a new EG(origin_user_error_handler)... [2013-02-27 15:45:43] php at maisqi dot com Test script: http://maisqi.com/outros/bugs/php/64312 [2013-02-27 15:43:04] php at maisqi dot com Description: If you set an error handler when inside an error handling function, set_error_handler will always return NULL. Test script: --- pre ?php function first_handler () { echo first_handler\n; echo ' Set to second handler: strong', gettype (set_error_handler ('second_handler')), /strong\n; echo \n\n, '$y = $o', \n; $y = $o; } function second_handler () { echo second_handler\n; } set_error_handler ('first_handler'); echo '$x = $y', \n; $x = $y; echo ' Set to other handler: strong', gettype (set_error_handler (function(){})), /strong\n; Expected result: set_error_handler should return the name of the error handling function, which in this case would be the name of the running function. Actual result: -- It just returns null. -- Edit this bug report at https://bugs.php.net/bug.php?id=64312edit=1