Bug #71287 [Com]: Error message contains hexadecimal instead of decimal number

From: Date: Wed, 13 Jan 2016 12:20:14 +0000
Subject: Bug #71287 [Com]: Error message contains hexadecimal instead of decimal number
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-198622@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71287&edit=1 ID: 71287 Comment by: remi@php.net Reported by: php dot bug dot stream_write at frankkleine dot de Summary: Error message contains hexadecimal instead of decimal number Status: Closed Type: Bug Package: Streams related PHP Version: 7.0.1 Block user comment: N Private report: N New Comment: I can reproduce with 7.0.2, but cannot with 7.0.3-dev. Previous Comments: ------------------------------------------------------------------------ [2016-01-06 00:42:41] laruence@php.net Automatic comment on behalf of laruence@gmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=695e8b79aff3108327d0189dba0abf05f58be847 Log: Fixed bug #71287 (Error message contains hexadecimal instead of decimal number) ------------------------------------------------------------------------ [2016-01-06 00:42:02] laruence@php.net Automatic comment on behalf of laruence@gmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=695e8b79aff3108327d0189dba0abf05f58be847 Log: Fixed bug #71287 (Error message contains hexadecimal instead of decimal number) ------------------------------------------------------------------------ [2016-01-05 15:43:12] php dot bug dot stream_write at frankkleine dot de Description: ------------ When a user defined stream wrapper implements the stream_write($data) method and this returns a number which is lower then the expected amounts of bytes passed as $data an error message is generated which informs about the problem that not all data was written. Starting with PHP 7, one of the integer values (the one returned from the stream wrapper method) in this warning is printed in hexadecimal representation, while the total amount is in decimal representation. In PHP 5 both numbers were in decimal representation. Test script: --------------- <?php class Stream { public function stream_open($path, $mode, $options, $opened_path) { return true; } public function stream_write($data) { return strlen($data) - 2; } } stream_wrapper_register('test', Stream::class); file_put_contents('test://file.txt', 'foobarbaz'); ?> Expected result: ---------------- Warning: file_put_contents(): Only 7 of 9 bytes written, possibly out of free disk space in - on line 14 Actual result: -------------- Warning: file_put_contents(): Only 0x7l of 9 bytes written, possibly out of free disk space in - on line 14 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=71287&edit=1

« previous php.bugs (#198622) next »