3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getHostIp($host) { $ip = gethostbyname($host); if ($ip == $host) { return false; } return $ip; } $host = 'homeserver.djekl.co.uk'; var_dump(getHostIp($host)); print PHP_EOL; print gethostbyname($host);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XiaDD
function name:  (null)
number of ops:  13
compiled vars:  !0 = $host
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, 'homeserver.djekl.co.uk'
   14     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'gethostip'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
   15     7        ECHO                                                     '%0A'
   16     8        INIT_FCALL                                               'gethostbyname'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $4      
         11        ECHO                                                     $4
         12      > RETURN                                                   1

Function gethostip:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XiaDD
function name:  getHostIp
number of ops:  10
compiled vars:  !0 = $host, !1 = $ip
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'gethostbyname'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !1, $2
    6     5        IS_EQUAL                                                 !1, !0
          6      > JMPZ                                                     ~4, ->8
    7     7    > > RETURN                                                   <false>
   10     8    > > RETURN                                                   !1
   11     9*     > RETURN                                                   null

End of function gethostip

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.02 ms | 1398 KiB | 18 Q