3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ip = '127.0.0.1'; function test($ip) { if (false !== strpos($ip, '/')) { list($address, $netmask) = explode('/', $ip, 2); if ($netmask < 1 || $netmask > 32) { return false; } } else { $address = $ip; $netmask = 32; } return [$address, $netmask]; } var_dump(test('127.0.0.1')); var_dump(test('10.0.0.3/29'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hDjoJ
function name:  (null)
number of ops:  14
compiled vars:  !0 = $ip
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '127.0.0.1'
   19     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'test'
          3        SEND_VAL                                                 '127.0.0.1'
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
   20     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'test'
          9        SEND_VAL                                                 '10.0.0.3%2F29'
         10        DO_FCALL                                      0  $4      
         11        SEND_VAR                                                 $4
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 24
Branch analysis from position: 7
2 jumps found. (Code = 47) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 23
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hDjoJ
function name:  test
number of ops:  30
compiled vars:  !0 = $ip, !1 = $address, !2 = $netmask
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'strpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '%2F'
          4        DO_ICALL                                         $3      
          5        TYPE_CHECK                                  1018          $3
          6      > JMPZ                                                     ~4, ->24
    6     7    >   INIT_FCALL                                               'explode'
          8        SEND_VAL                                                 '%2F'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 2
         11        DO_ICALL                                         $5      
         12        FETCH_LIST_R                                     $6      $5, 0
         13        ASSIGN                                                   !1, $6
         14        FETCH_LIST_R                                     $8      $5, 1
         15        ASSIGN                                                   !2, $8
         16        FREE                                                     $5
    8    17        IS_SMALLER                                       ~10     !2, 1
         18      > JMPNZ_EX                                         ~10     ~10, ->21
         19    >   IS_SMALLER                                       ~11     32, !2
         20        BOOL                                             ~10     ~11
         21    > > JMPZ                                                     ~10, ->23
    9    22    > > RETURN                                                   <false>
         23    > > JMP                                                      ->26
   12    24    >   ASSIGN                                                   !1, !0
   13    25        ASSIGN                                                   !2, 32
   16    26    >   INIT_ARRAY                                       ~14     !1
         27        ADD_ARRAY_ELEMENT                                ~14     !2
         28      > RETURN                                                   ~14
   17    29*     > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.15 ms | 1402 KiB | 21 Q