3v4l.org

run code in 300+ PHP versions simultaneously
<?php function filter_host($host) { var_dump('hosts', $host); $t = ($host === 'localhost' || preg_match('/[^0-9a-z\.]/', $host)); var_dump('t', $t); $t ? false : $host; } $r = call_user_func('filter_host', 'test.hosts.simplecheck123'); var_dump('r', $r); var_dump('test', false ? 'false' : 'true');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KcRr6
function name:  (null)
number of ops:  17
compiled vars:  !0 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'filter_host'
          1        SEND_USER                                                'test.hosts.simplecheck123'
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
   11     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAL                                                 'r'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
   13     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAL                                                 'test'
         10      > JMPZ                                                     <false>, ->13
         11    >   QM_ASSIGN                                        ~4      'false'
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~4      'true'
         14    >   SEND_VAL                                                 ~4
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Function filter_host:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/KcRr6
function name:  filter_host
number of ops:  23
compiled vars:  !0 = $host, !1 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAL                                                 'hosts'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
    5     5        IS_IDENTICAL                                     ~3      !0, 'localhost'
          6      > JMPNZ_EX                                         ~3      ~3, ->12
          7    >   INIT_FCALL                                               'preg_match'
          8        SEND_VAL                                                 '%2F%5B%5E0-9a-z%5C.%5D%2F'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $4      
         11        BOOL                                             ~3      $4
         12    >   ASSIGN                                                   !1, ~3
    6    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAL                                                 't'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
    7    17      > JMPZ                                                     !1, ->20
         18    >   QM_ASSIGN                                        ~7      <false>
         19      > JMP                                                      ->21
         20    >   QM_ASSIGN                                        ~7      !0
         21    >   FREE                                                     ~7
    8    22      > RETURN                                                   null

End of function filter_host

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
129.85 ms | 1407 KiB | 18 Q