Edit report at https://bugs.php.net/bug.php?id=46385&edit=1

 ID:                 46385
 Comment by:         mail at bodograumann dot de
 Reported by:        delilahblue at gmail dot com
 Summary:            sscanf does not work with %b
 Status:             Not a bug
 Type:               Bug
 Package:            Strings related
 Operating System:   Gentoo Linux
 PHP Version:        5.2.6
 Block user comment: N
 Private report:     N

 New Comment:

It seems that http://php.net/sscanf solves the documentation problem by saying

The interpreted format for str, which is described in the documentation for 
sprintf() with following differences:
    F, g, G and b are not supported.

So this bug can be closed. Although a new one might be opened as a feature 
request, if the "%b" is needed.


Previous Comments:
------------------------------------------------------------------------
[2012-08-28 03:37:04] datib...@php.net

This should be updated in the documentation, right now there's no mention about 
'%b'.

------------------------------------------------------------------------
[2008-10-26 11:09:34] j...@php.net

See bug #46267

------------------------------------------------------------------------
[2008-10-25 14:22:18] delilahblue at gmail dot com

Description:
------------
sscanf does not work with %b in the format string.
PHP 5.2.6-pl7-gentoo (cli) (built: Sep 27 2008 23:46:17)
Linux version 2.6.24-tuxonice-r9 (gcc version 4.1.2 (Gentoo 4.1.2)) #1 SMP 
PREEMPT Fri Oct 3 11:58:28 CEST 2008

USE-flags: apache2 bcmath berkdb bzip2 cli crypt ctype curl gd gdbm hash iconv 
ipv6 mysql mysqli ncurses nls pcre readline reflection session sockets spell 
spl ssl truetype unicode xml zlib

other people on freenode#php have the same issue
for example with php-5.2.4-2ubuntu5.3 on
Linux dev 2.6.24-19-386 #1 Wed Aug 20 21:59:50 UTC 2008 i686 GNU/Linux

Reproduce code:
---------------
echo sscanf("01010101", "%b");

Expected result:
----------------
It should output "85".

Actual result:
--------------
Warning: sscanf(): Bad scan conversion character "b" in php shell code on line 1
Call Stack:
 3740.1460     179568   1. {main}() php shell code:0
 3740.1460     179568   2. sscanf() php shell code:1


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=46385&edit=1

Reply via email to