|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #50648 Format for binary numbers
Submitted: 2010-01-04 11:50 UTC Modified: 2011-07-27 00:16 UTC
From: robert_xp at gmx dot net Assigned: pajoye (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.4 OS:
Private report: No CVE-ID: None
 [2010-01-04 11:50 UTC] robert_xp at gmx dot net
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:

Reproduce code:

Expected result:

Actual result:


php-src-trunk-50648_p2.patch (last revision 2010-11-29 16:36 UTC by jonah dot harris at gmail dot com)
php-src-5.3-50648_p1.patch (last revision 2010-11-11 06:06 UTC by jonah dot harris at gmail dot com)
phpdoc-50648_p1.patch (last revision 2010-11-11 05:08 UTC by jonah dot harris at gmail dot com)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-11 07:15 UTC] 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-12-01 16:25 UTC]
-Package: Feature/Change Request +Package: Scripting Engine problem
 [2011-07-27 00:16 UTC]
-Status: Open +Status: Closed -PHP Version: 5.3.1 +PHP Version: 5.4 -Assigned To: +Assigned To: pajoye
 [2011-07-27 00:16 UTC]
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.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Jan 17 19:01:22 2021 UTC