3v4l.org

run code in 300+ PHP versions simultaneously
<?php function checkdnsrr2($hostName, $recType = '') { if(!empty($hostName)) { if( $recType == '' ) $recType = "MX"; exec("nslookup -type=$recType $hostName", $result); // check each line to find the one that starts with the host // name. If it exists then the function succeeded. foreach ($result as $line) { if(eregi("^$hostName",$line)) { return true; } } // otherwise there was no mail handler for the domain return false; } return false; } if (checkdnsrr('gmail.com')) { echo 'yes'; } else { echo 'no'; } if (checkdnsrr2('gmail.com')) { echo 'yes'; } else { echo 'no'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
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
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
Branch analysis from position: 13
filename:       /in/AZrQd
function name:  (null)
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'checkdnsrr'
          1        SEND_VAL                                                 'gmail.com'
          2        DO_ICALL                                         $0      
          3      > JMPZ                                                     $0, ->6
   20     4    >   ECHO                                                     'yes'
          5      > JMP                                                      ->7
   23     6    >   ECHO                                                     'no'
   25     7    >   INIT_FCALL                                               'checkdnsrr2'
          8        SEND_VAL                                                 'gmail.com'
          9        DO_FCALL                                      0  $1      
         10      > JMPZ                                                     $1, ->13
   26    11    >   ECHO                                                     'yes'
         12      > JMP                                                      ->14
   29    13    >   ECHO                                                     'no'
   30    14    > > RETURN                                                   1

Function checkdnsrr2:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 30
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 28
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 28
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
Branch analysis from position: 8
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AZrQd
function name:  checkdnsrr2
number of ops:  32
compiled vars:  !0 = $hostName, !1 = $recType, !2 = $result, !3 = $line
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      ''
    4     2        ISSET_ISEMPTY_CV                                 ~4      !0
          3        BOOL_NOT                                         ~5      ~4
          4      > JMPZ                                                     ~5, ->30
    5     5    >   IS_EQUAL                                                 !1, ''
          6      > JMPZ                                                     ~6, ->8
          7    >   ASSIGN                                                   !1, 'MX'
    6     8    >   INIT_FCALL                                               'exec'
          9        ROPE_INIT                                     4  ~9      'nslookup+-type%3D'
         10        ROPE_ADD                                      1  ~9      ~9, !1
         11        ROPE_ADD                                      2  ~9      ~9, '+'
         12        ROPE_END                                      3  ~8      ~9, !0
         13        SEND_VAL                                                 ~8
         14        SEND_REF                                                 !2
         15        DO_ICALL                                                 
    9    16      > FE_RESET_R                                       $12     !2, ->28
         17    > > FE_FETCH_R                                               $12, !3, ->28
   10    18    >   INIT_FCALL_BY_NAME                                       'eregi'
         19        NOP                                                      
         20        FAST_CONCAT                                      ~13     '%5E', !0
         21        SEND_VAL_EX                                              ~13
         22        SEND_VAR_EX                                              !3
         23        DO_FCALL                                      0  $14     
         24      > JMPZ                                                     $14, ->27
   11    25    >   FE_FREE                                                  $12
         26      > RETURN                                                   <true>
    9    27    > > JMP                                                      ->17
         28    >   FE_FREE                                                  $12
   15    29      > RETURN                                                   <false>
   17    30    > > RETURN                                                   <false>
   18    31*     > RETURN                                                   null

End of function checkdnsrr2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.72 ms | 1403 KiB | 18 Q