0

Hello,
I am hoping someone can help me understand a piece of code i found. Since php is not my primary language, and what i googled returned vague results, i am unsure exactly how a number or integer value can be used directly as a boolean in a while operation.

function testfunction( $testparam )
{
        if( $testparam > 0x3F3F3FFF )
        {
        $testparam &= 0x3F3F3FFF;
        }

        do
        {
         $testparam >>= 6;

        }while($testparam);
}

Basically i need to be able to understand the logic of the while loop here, does it check it testparam is > 0 and evaluate that as true or false? or how does it come to its boolean value from a value that is previously recognised as an integer? Any help would be good thanks :)

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by pritaeas
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.