3v4l.org

run code in 300+ PHP versions simultaneously
<?php function p($val) { var_dump($val); } $varip = '127.0.0.1'; p(ip2long($varip)); //display int(2130706433) $varip2long = ip2long($varip); p(long2ip($varip2long)); //string(9) "127.0.0.1" $longIpFromDb = "2130706433"; p($longIpFromDb); //display string(10) "2130706433" p(long2ip($longIpFromDb)); //display string(7) "0.0.0.0" p(long2ip((int)$longIpFromDb)); //display string(7) "0.0.0.0" $longIpFromDb = ["2130706433"]; p($longIpFromDb); //display string(10) "2130706433" p(long2ip($longIpFromDb)); //display string(7) "0.0.0.0" p(long2ip((int)$longIpFromDb)); //display string(7) "0. ?>
Output for git.master, git.master_jit, rfc.property-hooks
int(2130706433) string(9) "127.0.0.1" string(10) "2130706433" string(9) "127.0.0.1" string(9) "127.0.0.1" array(1) { [0]=> string(10) "2130706433" } Fatal error: Uncaught TypeError: long2ip(): Argument #1 ($ip) must be of type int, array given in /in/X7GQm:17 Stack trace: #0 /in/X7GQm(17): long2ip(Array) #1 {main} thrown in /in/X7GQm on line 17
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
155.31 ms | 406 KiB | 5 Q