3v4l.org

run code in 500+ PHP versions simultaneously
<?php //skipped retrieving from the database, and doing // $urls = array_column($rows, 'urls'); $urls = [ 'http://www2.trafficadbar.com/__a4w4', 'http://trafficadbar.com/__a4w4', 'http://www.trafficadbar.com/__a4w4', 'http://4acesmailer.com/credit_click.php?userid=2472&openkey=gbyp2vcm', 'http://4acesmailer.com/credit_click.php?userid=2714&openkey=gbyp2vcm', 'http://4acesmailer.com/credit_click.php?userid=2723&openkey=gbyp2vcm', 'http://4acesmailer.com/credit_click.php?userid=3245&openkey=gbyp2vcm', 'http://4acesmailer.com/credit_click.php?userid=3259&openkey=gbyp2vcm', ]; $results = []; foreach($urls as $url){ //eg: www2.trafficadbar.com $host = parse_url($url,PHP_URL_HOST); $matches = []; //find top level domain or skip to next URL if(!preg_match('/[^\.]*\.[^\.]+$/',$host,$matches)) continue; //eg: trafficadbar.com $domain = $matches[0]; //increment the count for this domain in results if(!isset($results[$domain])) $results[$domain]=0; $results[$domain]++; } print_r($results);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 28
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 28
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 25
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/fXsa2
function name:  (null)
number of ops:  33
compiled vars:  !0 = $urls, !1 = $results, !2 = $url, !3 = $host, !4 = $matches, !5 = $domain
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                       !0, <array>
   15     1        ASSIGN                                                       !1, <array>
   16     2      > FE_RESET_R                                           $8      !0, ->28
          3    > > FE_FETCH_R                                                   $8, !2, ->28
   18     4    >   INIT_FCALL                                                   'parse_url'
          5        SEND_VAR                                                     !2
          6        SEND_VAL                                                     1
          7        DO_ICALL                                             $9      
          8        ASSIGN                                                       !3, $9
   19     9        ASSIGN                                                       !4, <array>
   22    10        INIT_FCALL                                                   'preg_match'
         11        SEND_VAL                                                     '%2F%5B%5E%5C.%5D%2A%5C.%5B%5E%5C.%5D%2B%24%2F'
         12        SEND_VAR                                                     !3
         13        SEND_REF                                                     !4
         14        DO_ICALL                                             $12     
         15        BOOL_NOT                                             ~13     $12
         16      > JMPZ                                                         ~13, ->18
         17    > > JMP                                                          ->3
   25    18    >   FETCH_DIM_R                                          ~14     !4, 0
         19        ASSIGN                                                       !5, ~14
   28    20        ISSET_ISEMPTY_DIM_OBJ                             0  ~16     !1, !5
         21        BOOL_NOT                                             ~17     ~16
         22      > JMPZ                                                         ~17, ->25
         23    >   ASSIGN_DIM                                                   !1, !5
         24        OP_DATA                                                      0
   29    25    >   FETCH_DIM_RW                                         $19     !1, !5
         26        PRE_INC                                                      $19
   16    27      > JMP                                                          ->3
         28    >   FE_FREE                                                      $8
   31    29        INIT_FCALL                                                   'print_r'
         30        SEND_VAR                                                     !1
         31        DO_ICALL                                                     
         32      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.33 ms | 2556 KiB | 16 Q