3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr=array("ip","icmp","ggp","tcp", "egp","pup","udp","hmp","xns-idp", "rdp","rvd" ); //Reads the names of protocols into an array.. for($i=0;$i<11;$i++) { $proname=$arr[$i]; echo $proname .":", getprotobyname ($proname)."<br />\n"; }
Output for 4.3.0 - 7.1.0
ip:<br /> icmp:1<br /> ggp:3<br /> tcp:6<br /> egp:8<br /> pup:12<br /> udp:17<br /> hmp:20<br /> xns-idp:22<br /> rdp:27<br /> rvd:66<br />