RE: [PHP3] A shl()/shr() function? From: Brian Schaffner (BSchaffner <email protected>)
Date: 09/30/98

those functions are deprecated - use the new bit-shift operators: <<
(left shift) and >> (right shift):

<?
        $x = 1; /* binary: 0000 0001 = 1 */
        $a = $x << 1; /* binary: 0000 0010 = 2 */
        $b = $x << 3; /* binary: 0000 1000 = 8 */
        $c = $x << 6; /* binary: 0100 0000 = 64 */

        echo "$x\n$a\n$b\n$c\n";
?>

-----Original Message-----
From: Rich Clingman [mailto:inlan <email protected>]
Sent: Wednesday, September 30, 1998 12:00 PM
To: php3
Subject: [PHP3] A shl()/shr() function?

I'm looking at encoding binary files for attachment; however, I need a
shift
function.
PHP2 has shl()/shr() (shift left/right), but PHP3 does not. I looked
through all of the PHP3 docs & source and find no equivalent function.
Anyone know of one or a work-around?

Rich Clingman
inlan <email protected>

--
PHP 3 Mailing List   http://www.php.net/
To unsubscribe send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest list:  php3-digest-subscribe <email protected>
For help: php3-help <email protected>  Archive:
http://www.php.net/mailsearch.php3

-- PHP 3 Mailing List http://www.php.net/ To unsubscribe send an empty message to php3-unsubscribe <email protected> To subscribe to the digest list: php3-digest-subscribe <email protected> For help: php3-help <email protected> Archive: http://www.php.net/mailsearch.php3