3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = array ( 0 => array ( 'id' => '19', 'Title_EN' => 'Australian Transaction Reports and Analysis Center (AUSTRAC)', 'Link_EN' => 'http://www.austrac.gov.au', 'Title_SP' => NULL, 'Link_SP' => 'http://www.austrac.gov.au', 'ShowOnHomepage' => NULL, 'Date' => NULL, ), 1 => array ( 'id' => '5', 'Title_EN' => 'Bank for International Settlements (BIS)', 'Link_EN' => 'http://www.bis.org', 'Title_SP' => 'Bank for International Settlements (BIS)', 'Link_SP' => 'http://www.bis.org', 'ShowOnHomepage' => NULL, 'Date' => NULL, ), 2 => array ( 'id' => '7', 'Title_EN' => 'Banking Control Commission of Lebanon', 'Link_EN' => 'http://www.bccl.gov.lb', 'Title_SP' => 'Banking Control Commission of Lebanon', 'Link_SP' => 'http://www.bccl.gov.lb', 'ShowOnHomepage' => NULL, 'Date' => NULL, ), 3 => array ( 'id' => '6', 'Title_EN' => 'Banque de France', 'Link_EN' => 'http://www.banque-france.fr', 'Title_SP' => 'Banque de France', 'Link_SP' => 'http://www.banque-france.fr', 'ShowOnHomepage' => NULL, 'Date' => NULL, ), 4 => array ( 'id' => '4', 'Title_EN' => 'Banque du Liban (BDL)', 'Link_EN' => 'http://www.bdl.gov.lb', 'Title_SP' => 'Banque du Liban (BDL) (arabic)', 'Link_SP' => 'http://www.bdl.gov.lb', 'ShowOnHomepage' => NULL, 'Date' => NULL, ), 5 => array ( 'id' => '18', 'Title_EN' => 'Cellule de Traitement des Informations Financières (CTIF)', 'Link_EN' => 'http://www.ctif-cfi.be', 'Title_SP' => NULL, 'Link_SP' => 'http://www.ctif-cfi.be', 'ShowOnHomepage' => NULL, 'Date' => NULL, ), 6 => array ( 'id' => '12', 'Title_EN' => 'Financial Action Task Force on Money Laundering (FATF)', 'Link_EN' => 'http://www.fatf-gafi.org', 'Title_SP' => NULL, 'Link_SP' => 'http://www.fatf-gafi.org', 'ShowOnHomepage' => NULL, 'Date' => NULL, ), 7 => array ( 'id' => '8', 'Title_EN' => 'Financial Crimes Enforcement Network (FinCEN)', 'Link_EN' => 'http://www.fincen.gov', 'Title_SP' => NULL, 'Link_SP' => 'http://www.fincen.gov', 'ShowOnHomepage' => NULL, 'Date' => NULL, ), ); $icon1 = '<i class="fa-angle-left fa"></i>'; $icon2 = '<i class="fa-angle-right fa"></i>'; $count = 0; $lang = 'EN'; $HTML = ''; $totalcount = count($result); foreach ($result as $row) { $Title = $row['Title_'.$lang]; $Link = $row['Link_'.$lang]; if($count++ % 2 == 0) { $HTML .= '<div>'; $HTML .= ' <span class="side1"><a href="'.addhttp($Link).'" target="_blank">'.$icon1.' '.$Title.'</a></span> '; if($totalcount % 2 == 0 && $totalcount==$count) {$HTML .= '</div>';} } else { $HTML .= ' <span class="side2"><a href="'.addhttp($Link).'" target="_blank">'.$Title.' '.$icon2.'</a></span> '; $HTML .= '</div>'; } } echo $HTML; function addhttp($url) { if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { $url = "http://" . $url; } return $url; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 51
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 51
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 39
Branch analysis from position: 20
2 jumps found. (Code = 46) Position 1 = 34, Position 2 = 36
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 38
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 38
Branch analysis from position: 36
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 51
filename:       /in/RXu4S
function name:  (null)
number of ops:  54
compiled vars:  !0 = $result, !1 = $icon1, !2 = $icon2, !3 = $count, !4 = $lang, !5 = $HTML, !6 = $totalcount, !7 = $row, !8 = $Title, !9 = $Link
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    6     1        ASSIGN                                                   !1, '%3Ci+class%3D%22fa-angle-left+fa%22%3E%3C%2Fi%3E'
    7     2        ASSIGN                                                   !2, '%3Ci+class%3D%22fa-angle-right+fa%22%3E%3C%2Fi%3E'
    9     3        ASSIGN                                                   !3, 0
   10     4        ASSIGN                                                   !4, 'EN'
   11     5        ASSIGN                                                   !5, ''
   12     6        COUNT                                            ~16     !0
          7        ASSIGN                                                   !6, ~16
   13     8      > FE_RESET_R                                       $18     !0, ->51
          9    > > FE_FETCH_R                                               $18, !7, ->51
   14    10    >   CONCAT                                           ~19     'Title_', !4
         11        FETCH_DIM_R                                      ~20     !7, ~19
         12        ASSIGN                                                   !8, ~20
   15    13        CONCAT                                           ~22     'Link_', !4
         14        FETCH_DIM_R                                      ~23     !7, ~22
         15        ASSIGN                                                   !9, ~23
   16    16        POST_INC                                         ~25     !3
         17        MOD                                              ~26     ~25, 2
         18        IS_EQUAL                                                 ~26, 0
         19      > JMPZ                                                     ~27, ->39
   18    20    >   ASSIGN_OP                                     8          !5, '%3Cdiv%3E'
   19    21        INIT_FCALL_BY_NAME                                       'addhttp'
         22        SEND_VAR_EX                                              !9
         23        DO_FCALL                                      0  $29     
         24        CONCAT                                           ~30     '+%3Cspan+class%3D%22side1%22%3E%3Ca+href%3D%22', $29
         25        CONCAT                                           ~31     ~30, '%22+target%3D%22_blank%22%3E'
         26        CONCAT                                           ~32     ~31, !1
         27        CONCAT                                           ~33     ~32, '+'
         28        CONCAT                                           ~34     ~33, !8
         29        CONCAT                                           ~35     ~34, '%3C%2Fa%3E%3C%2Fspan%3E+'
         30        ASSIGN_OP                                     8          !5, ~35
   20    31        MOD                                              ~37     !6, 2
         32        IS_EQUAL                                         ~38     ~37, 0
         33      > JMPZ_EX                                          ~38     ~38, ->36
         34    >   IS_EQUAL                                         ~39     !6, !3
         35        BOOL                                             ~38     ~39
         36    > > JMPZ                                                     ~38, ->38
         37    >   ASSIGN_OP                                     8          !5, '%3C%2Fdiv%3E'
         38    > > JMP                                                      ->50
   24    39    >   INIT_FCALL_BY_NAME                                       'addhttp'
         40        SEND_VAR_EX                                              !9
         41        DO_FCALL                                      0  $41     
         42        CONCAT                                           ~42     '+%3Cspan+class%3D%22side2%22%3E%3Ca+href%3D%22', $41
         43        CONCAT                                           ~43     ~42, '%22+target%3D%22_blank%22%3E'
         44        CONCAT                                           ~44     ~43, !8
         45        CONCAT                                           ~45     ~44, '+'
         46        CONCAT                                           ~46     ~45, !2
         47        CONCAT                                           ~47     ~46, '%3C%2Fa%3E%3C%2Fspan%3E+'
         48        ASSIGN_OP                                     8          !5, ~47
   25    49        ASSIGN_OP                                     8          !5, '%3C%2Fdiv%3E'
   13    50    > > JMP                                                      ->9
         51    >   FE_FREE                                                  $18
   30    52        ECHO                                                     !5
   38    53      > RETURN                                                   1

Function addhttp:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/RXu4S
function name:  addhttp
number of ops:  11
compiled vars:  !0 = $url
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   RECV                                             !0      
   34     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%7E%5E%28%3F%3Af%7Cht%29tps%3F%3A%2F%2F%7Ei'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5        BOOL_NOT                                         ~2      $1
          6      > JMPZ                                                     ~2, ->9
   35     7    >   CONCAT                                           ~3      'http%3A%2F%2F', !0
          8        ASSIGN                                                   !0, ~3
   37     9    > > RETURN                                                   !0
   38    10*     > RETURN                                                   null

End of function addhttp

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.01 ms | 1400 KiB | 15 Q