3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ipsBetween($from, $to) { return ip2long($to) - ip2long($from); } echo ipsBetween("10.0.0.0", "10.0.0.50") . PHP_EOL; echo ipsBetween("10.0.0.0", "10.0.1.0") . PHP_EOL; echo ipsBetween("20.0.0.10", "20.0.1.0");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8NiWc
function name:  (null)
number of ops:  18
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'ipsbetween'
          1        SEND_VAL                                                 '10.0.0.0'
          2        SEND_VAL                                                 '10.0.0.50'
          3        DO_FCALL                                      0  $0      
          4        CONCAT                                           ~1      $0, '%0A'
          5        ECHO                                                     ~1
    9     6        INIT_FCALL                                               'ipsbetween'
          7        SEND_VAL                                                 '10.0.0.0'
          8        SEND_VAL                                                 '10.0.1.0'
          9        DO_FCALL                                      0  $2      
         10        CONCAT                                           ~3      $2, '%0A'
         11        ECHO                                                     ~3
   10    12        INIT_FCALL                                               'ipsbetween'
         13        SEND_VAL                                                 '20.0.0.10'
         14        SEND_VAL                                                 '20.0.1.0'
         15        DO_FCALL                                      0  $4      
         16        ECHO                                                     $4
         17      > RETURN                                                   1

Function ipsbetween:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8NiWc
function name:  ipsBetween
number of ops:  11
compiled vars:  !0 = $from, !1 = $to
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        INIT_FCALL                                               'ip2long'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $2      
          5        INIT_FCALL                                               'ip2long'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $3      
          8        SUB                                              ~4      $2, $3
          9      > RETURN                                                   ~4
    6    10*     > RETURN                                                   null

End of function ipsbetween

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.58 ms | 1399 KiB | 18 Q