Bug #71100 [NEW]: long2ip() doesn't accept integers in strict mode

From: Date: Sat, 12 Dec 2015 06:21:52 +0000
Subject: Bug #71100 [NEW]: long2ip() doesn't accept integers in strict mode
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-197825@lists.php.net to get a copy of this message
From: anthonyryan1 at gmail dot com Operating system: Linux PHP version: 7.0.0 Package: *Network Functions Bug Type: Bug Bug description:long2ip() doesn't accept integers in strict mode Description: ------------ long2ip()'s expected input type does not match up with the output type of ip2long(), in strict mode passing an integer causes a TypeError to be thrown. Test script: --------------- <?php declare(strict_types=1); var_dump(long2ip(ip2long('127.0.0.1'))); Expected result: ---------------- long2ip()'s expected input type to be an integer in strict mode. Actual result: -------------- PHP Fatal error: Uncaught TypeError: long2ip() expects parameter 1 to be string, integer given in test-script.php:4 Stack trace: #0 test-script.php(4): long2ip(2130706433) #1 {main} thrown in test-script.php on line 4 -- Edit bug report at https://bugs.php.net/bug.php?id=71100&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71100&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71100&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71100&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=71100&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=71100&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=71100&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=71100&r=needscript Try newer version: https://bugs.php.net/fix.php?id=71100&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=71100&r=support Expected behavior: https://bugs.php.net/fix.php?id=71100&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=71100&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=71100&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=71100&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71100&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=71100&r=dst IIS Stability: https://bugs.php.net/fix.php?id=71100&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=71100&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=71100&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=71100&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=71100&r=mysqlcfg

« previous php.bugs (#197825) next »