note 83615 added to function.ip2long

From: Date: Wed, 04 Jun 2008 15:50:43 +0000
Subject: note 83615 added to function.ip2long
Groups: php.notes 
Request: Send a blank email to php-notes+get-140122@lists.php.net to get a copy of this message
The code examples explain why printing needs a casting, but beware that also calculations are performed with signed integers. In my case, the result of (ip2long('130.89.0.1') >> 24) was supposed to be 130, but the actual result was -126 ---- Server IP: 83.137.20.135 Probable Submitter: 2001:610:1908:8000:202:b3ff:fe11:9175 ---- Manual Page -- http://www.php.net/manual/en/function.ip2long.php Edit -- https://master.php.net/note/edit/83615 Del: integrated -- https://master.php.net/note/delete/83615/integrated Del: useless -- https://master.php.net/note/delete/83615/useless Del: bad code -- https://master.php.net/note/delete/83615/bad+code Del: spam -- https://master.php.net/note/delete/83615/spam Del: non-english -- https://master.php.net/note/delete/83615/non-english Del: in docs -- https://master.php.net/note/delete/83615/in+docs Del: other reasons-- https://master.php.net/note/delete/83615 Reject -- https://master.php.net/note/reject/83615 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#140122) next »