Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Binary

Binary has several distinct usages:

  • Binary integers: a way to represent numbers with 0 and 1
  • Binary operators: operators that use 2 arguments
  • Binary search: a search technique over a sorted array
  • Binary executable: the compiled version of PHP, not as source code

Generally, binary refers to the binary integers.

<?php

    // 12 in binary 
    $binary = 0b1100;
    
    // > is a binary operator: it takes 2 arguments
    var_dump($binary > 13);

?>

Documentation