<?php

echo "Bits in an int: ".(count_bits(PHP_INT_MAX) + 1);
die;

// Counts how many bits are needed to represent $value
function count_bits($value) {
    for($count = 0; $value != 0; $value >>= 1) {
        ++$count;
    }
    return $count;
}
