3v4l.org

run code in 300+ PHP versions simultaneously
<?php // getmxrr() support for Windows by HM2K <php [spat] hm2k.org> function win_getmxrr($hostname, &$mxhosts, &$mxweight=false) { if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') return; if (!is_array ($mxhosts) ) $mxhosts = array(); if (empty($hostname)) return; $exec='nslookup -type=MX '.escapeshellarg($hostname); @exec($exec, $output); if (empty($output)) return; $i=-1; foreach ($output as $line) { $i++; if (preg_match("/^$hostname\tMX preference = ([0-9]+), mail exchanger = (.+)$/i", $line, $parts)) { $mxweight[$i] = trim($parts[1]); $mxhosts[$i] = trim($parts[2]); } if (preg_match('/responsible mail addr = (.+)$/i', $line, $parts)) { $mxweight[$i] = $i; $mxhosts[$i] = trim($parts[1]); } } return ($i!=-1); } // Define if (!function_exists('getmxrr')) { function getmxrr($hostname, &$mxhosts, &$mxweight=false) { return win_getmxrr($hostname, $mxhosts, $mxweight); } } /* example */ $domain='php.net'; echo "<pre>"; getmxrr($domain,$mxhosts,$mxweight); print_r($mxhosts); print_r($mxweight);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/ZU1uf
function name:  (null)
number of ops:  20
compiled vars:  !0 = $domain, !1 = $mxhosts, !2 = $mxweight
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   INIT_FCALL                                               'function_exists'
          1        SEND_VAL                                                 'getmxrr'
          2        DO_ICALL                                         $3      
          3        BOOL_NOT                                         ~4      $3
          4      > JMPZ                                                     ~4, ->6
   27     5    >   DECLARE_FUNCTION                                         'getmxrr'
   34     6    >   ASSIGN                                                   !0, 'php.net'
   35     7        ECHO                                                     '%3Cpre%3E'
   36     8        INIT_FCALL                                               'getmxrr'
          9        SEND_VAR                                                 !0
         10        SEND_REF                                                 !1
         11        SEND_REF                                                 !2
         12        DO_ICALL                                                 
   37    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                                 
   38    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Function win_getmxrr:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 21
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 35
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
2 jumps found. (Code = 77) Position 1 = 37, Position 2 = 75
Branch analysis from position: 37
2 jumps found. (Code = 78) Position 1 = 38, Position 2 = 75
Branch analysis from position: 38
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 60
Branch analysis from position: 48
2 jumps found. (Code = 43) Position 1 = 66, Position 2 = 74
Branch analysis from position: 66
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Branch analysis from position: 74
Branch analysis from position: 60
Branch analysis from position: 75
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 75
Branch analysis from position: 18
filename:       /in/ZU1uf
function name:  win_getmxrr
number of ops:  79
compiled vars:  !0 = $hostname, !1 = $mxhosts, !2 = $mxweight, !3 = $exec, !4 = $output, !5 = $i, !6 = $line, !7 = $parts
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      <false>
    4     3        INIT_FCALL                                               'strtoupper'
          4        INIT_FCALL                                               'substr'
          5        SEND_VAL                                                 'Linux'
          6        SEND_VAL                                                 0
          7        SEND_VAL                                                 3
          8        DO_ICALL                                         $8      
          9        SEND_VAR                                                 $8
         10        DO_ICALL                                         $9      
         11        IS_NOT_EQUAL                                             $9, 'WIN'
         12      > JMPZ                                                     ~10, ->14
         13    > > RETURN                                                   null
    5    14    >   TYPE_CHECK                                  128  ~11     !1
         15        BOOL_NOT                                         ~12     ~11
         16      > JMPZ                                                     ~12, ->18
         17    >   ASSIGN                                                   !1, <array>
    6    18    >   ISSET_ISEMPTY_CV                                         !0
         19      > JMPZ                                                     ~14, ->21
         20    > > RETURN                                                   null
    7    21    >   INIT_FCALL                                               'escapeshellarg'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $15     
         24        CONCAT                                           ~16     'nslookup+-type%3DMX+', $15
         25        ASSIGN                                                   !3, ~16
    8    26        BEGIN_SILENCE                                    ~18     
         27        INIT_FCALL                                               'exec'
         28        SEND_VAR                                                 !3
         29        SEND_REF                                                 !4
         30        DO_ICALL                                                 
         31        END_SILENCE                                              ~18
    9    32        ISSET_ISEMPTY_CV                                         !4
         33      > JMPZ                                                     ~20, ->35
         34    > > RETURN                                                   null
   10    35    >   ASSIGN                                                   !5, -1
   11    36      > FE_RESET_R                                       $22     !4, ->75
         37    > > FE_FETCH_R                                               $22, !6, ->75
   12    38    >   PRE_INC                                                  !5
   13    39        INIT_FCALL                                               'preg_match'
         40        ROPE_INIT                                     3  ~25     '%2F%5E'
         41        ROPE_ADD                                      1  ~25     ~25, !0
         42        ROPE_END                                      2  ~24     ~25, '%09MX+preference+%3D+%28%5B0-9%5D%2B%29%2C+mail+exchanger+%3D+%28.%2B%29%24%2Fi'
         43        SEND_VAL                                                 ~24
         44        SEND_VAR                                                 !6
         45        SEND_REF                                                 !7
         46        DO_ICALL                                         $27     
         47      > JMPZ                                                     $27, ->60
   14    48    >   INIT_FCALL                                               'trim'
         49        FETCH_DIM_R                                      ~29     !7, 1
         50        SEND_VAL                                                 ~29
         51        DO_ICALL                                         $30     
         52        ASSIGN_DIM                                               !2, !5
         53        OP_DATA                                                  $30
   15    54        INIT_FCALL                                               'trim'
         55        FETCH_DIM_R                                      ~32     !7, 2
         56        SEND_VAL                                                 ~32
         57        DO_ICALL                                         $33     
         58        ASSIGN_DIM                                               !1, !5
         59        OP_DATA                                                  $33
   17    60    >   INIT_FCALL                                               'preg_match'
         61        SEND_VAL                                                 '%2Fresponsible+mail+addr+%3D+%28.%2B%29%24%2Fi'
         62        SEND_VAR                                                 !6
         63        SEND_REF                                                 !7
         64        DO_ICALL                                         $34     
         65      > JMPZ                                                     $34, ->74
   18    66    >   ASSIGN_DIM                                               !2, !5
         67        OP_DATA                                                  !5
   19    68        INIT_FCALL                                               'trim'
         69        FETCH_DIM_R                                      ~37     !7, 1
         70        SEND_VAL                                                 ~37
         71        DO_ICALL                                         $38     
         72        ASSIGN_DIM                                               !1, !5
         73        OP_DATA                                                  $38
   11    74    > > JMP                                                      ->37
         75    >   FE_FREE                                                  $22
   22    76        IS_NOT_EQUAL                                     ~39     !5, -1
         77      > RETURN                                                   ~39
   23    78*     > RETURN                                                   null

End of function win_getmxrr

Function %00getmxrr%2Fin%2FZU1uf%3A27%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZU1uf
function name:  getmxrr
number of ops:  10
compiled vars:  !0 = $hostname, !1 = $mxhosts, !2 = $mxweight
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      <false>
   28     3        INIT_FCALL                                               'win_getmxrr'
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !1
          6        SEND_REF                                                 !2
          7        DO_FCALL                                      0  $3      
          8      > RETURN                                                   $3
   29     9*     > RETURN                                                   null

End of function %00getmxrr%2Fin%2FZU1uf%3A27%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.72 ms | 1407 KiB | 32 Q