|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2015-12-12 06:21 UTC] anthonyryan1 at gmail dot com
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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 12:00:01 2025 UTC |
hmm, changing long2ip accept integer instead of string will break something in non strict_types like: long2ip(""); thus I will only fixed this in master