Create binary_int_cast.php
Create binary_int_cast.php

Takes a string representation of a binary number and casts in to an (int), but returns a binary integer instead of being treated as (int) would treat the string. For example, if $x = '0b1011', (int)$x ---> 0 but binary_int_cast($x) ---> 1011.
phdave2005/PHP-Useful-String-Functions