This function is for converting binary data into a hexadecimal string representation. This function is not for converting strings representing binary digits into hexadecimal. If you want that functionality, you can simply do this:
<?php
$binary = "11111001";
$hex = dechex(bindec($binary));
echo $hex;
?>
This would output "f9". Just remember that there is a very big difference between binary data and a string representation of binary.