3v4l.org

run code in 300+ PHP versions simultaneously
<?php $the_mysql_result = array(); $the_mysql_result[0]['id'] = "1"; $the_mysql_result[0]['address']="www.example.com/page1"; $the_mysql_result[0]['title']="Page 1"; $the_mysql_result[0]['content']="The quick dog jumps over the lazy dog."; $the_mysql_result[0]['image']="image_1.jpg"; $the_mysql_result[1]['id'] = "2"; $the_mysql_result[1]['address']="www.example.com/page2"; $the_mysql_result[1]['title']="Page 2"; $the_mysql_result[1]['content']="The best thing about morning is breakfast."; $the_mysql_result[1]['image']="image_2.jpg"; $the_mysql_result[2]['id'] = "3"; $the_mysql_result[2]['address']="www.example.com/page3"; $the_mysql_result[2]['title']="Page 3"; $the_mysql_result[2]['content']="Hotdogs are great ballpark food."; $the_mysql_result[2]['image']="image_3.jpg"; $query="dog"; foreach($the_mysql_result as $results) { $content = $results['content']; $row_occurences = explode($query,$content); if(count($row_occurences)>1) { foreach($row_occurences as $an_occurence) { $content=$an_occurence.$query; echo '<li class="media"> <a class="pull-left" href="'.$results['address'].'"> <img class="media-object thumbnail" src="'.$results['image'].'" style="height:100px !important"> </a> <div class="media-body"> <h4 class="media-heading"><a href="'.$results['address'].'">'.$results['title'].'</a></h4> <p>...'.str_replace($query,'<strong>'.$query.'</strong>', substr($content,strpos($content,$query)-25,160)).'...</p> </div> </li>'; } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 48, Position 2 = 98
Branch analysis from position: 48
2 jumps found. (Code = 78) Position 1 = 49, Position 2 = 98
Branch analysis from position: 49
2 jumps found. (Code = 43) Position 1 = 59, Position 2 = 97
Branch analysis from position: 59
2 jumps found. (Code = 77) Position 1 = 60, Position 2 = 96
Branch analysis from position: 60
2 jumps found. (Code = 78) Position 1 = 61, Position 2 = 96
Branch analysis from position: 61
1 jumps found. (Code = 42) Position 1 = 60
Branch analysis from position: 60
Branch analysis from position: 96
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
Branch analysis from position: 96
Branch analysis from position: 97
Branch analysis from position: 98
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 98
filename:       /in/eFQ1i
function name:  (null)
number of ops:  100
compiled vars:  !0 = $the_mysql_result, !1 = $query, !2 = $results, !3 = $content, !4 = $row_occurences, !5 = $an_occurence
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    7     1        FETCH_DIM_W                                      $7      !0, 0
          2        ASSIGN_DIM                                               $7, 'id'
          3        OP_DATA                                                  '1'
    8     4        FETCH_DIM_W                                      $9      !0, 0
          5        ASSIGN_DIM                                               $9, 'address'
          6        OP_DATA                                                  'www.example.com%2Fpage1'
    9     7        FETCH_DIM_W                                      $11     !0, 0
          8        ASSIGN_DIM                                               $11, 'title'
          9        OP_DATA                                                  'Page+1'
   10    10        FETCH_DIM_W                                      $13     !0, 0
         11        ASSIGN_DIM                                               $13, 'content'
         12        OP_DATA                                                  'The+quick+dog+jumps+over+the+lazy+dog.'
   11    13        FETCH_DIM_W                                      $15     !0, 0
         14        ASSIGN_DIM                                               $15, 'image'
         15        OP_DATA                                                  'image_1.jpg'
   13    16        FETCH_DIM_W                                      $17     !0, 1
         17        ASSIGN_DIM                                               $17, 'id'
         18        OP_DATA                                                  '2'
   14    19        FETCH_DIM_W                                      $19     !0, 1
         20        ASSIGN_DIM                                               $19, 'address'
         21        OP_DATA                                                  'www.example.com%2Fpage2'
   15    22        FETCH_DIM_W                                      $21     !0, 1
         23        ASSIGN_DIM                                               $21, 'title'
         24        OP_DATA                                                  'Page+2'
   16    25        FETCH_DIM_W                                      $23     !0, 1
         26        ASSIGN_DIM                                               $23, 'content'
         27        OP_DATA                                                  'The+best+thing+about+morning+is+breakfast.'
   17    28        FETCH_DIM_W                                      $25     !0, 1
         29        ASSIGN_DIM                                               $25, 'image'
         30        OP_DATA                                                  'image_2.jpg'
   19    31        FETCH_DIM_W                                      $27     !0, 2
         32        ASSIGN_DIM                                               $27, 'id'
         33        OP_DATA                                                  '3'
   20    34        FETCH_DIM_W                                      $29     !0, 2
         35        ASSIGN_DIM                                               $29, 'address'
         36        OP_DATA                                                  'www.example.com%2Fpage3'
   21    37        FETCH_DIM_W                                      $31     !0, 2
         38        ASSIGN_DIM                                               $31, 'title'
         39        OP_DATA                                                  'Page+3'
   22    40        FETCH_DIM_W                                      $33     !0, 2
         41        ASSIGN_DIM                                               $33, 'content'
         42        OP_DATA                                                  'Hotdogs+are+great+ballpark+food.'
   23    43        FETCH_DIM_W                                      $35     !0, 2
         44        ASSIGN_DIM                                               $35, 'image'
         45        OP_DATA                                                  'image_3.jpg'
   26    46        ASSIGN                                                   !1, 'dog'
   28    47      > FE_RESET_R                                       $38     !0, ->98
         48    > > FE_FETCH_R                                               $38, !2, ->98
   30    49    >   FETCH_DIM_R                                      ~39     !2, 'content'
         50        ASSIGN                                                   !3, ~39
   31    51        INIT_FCALL                                               'explode'
         52        SEND_VAR                                                 !1
         53        SEND_VAR                                                 !3
         54        DO_ICALL                                         $41     
         55        ASSIGN                                                   !4, $41
   33    56        COUNT                                            ~43     !4
         57        IS_SMALLER                                               1, ~43
         58      > JMPZ                                                     ~44, ->97
   35    59    > > FE_RESET_R                                       $45     !4, ->96
         60    > > FE_FETCH_R                                               $45, !5, ->96
   37    61    >   CONCAT                                           ~46     !5, !1
         62        ASSIGN                                                   !3, ~46
   40    63        FETCH_DIM_R                                      ~48     !2, 'address'
         64        CONCAT                                           ~49     '%3Cli+class%3D%22media%22%3E%0A++++++++++++%3Ca+class%3D%22pull-left%22+href%3D%22', ~48
         65        CONCAT                                           ~50     ~49, '%22%3E%0A++++++++++++%3Cimg+class%3D%22media-object+thumbnail%22+src%3D%22'
   41    66        FETCH_DIM_R                                      ~51     !2, 'image'
         67        CONCAT                                           ~52     ~50, ~51
         68        CONCAT                                           ~53     ~52, '%22+style%3D%22height%3A100px+%21important%22%3E%0A++++++++++++%3C%2Fa%3E%0A++++++++++++%3Cdiv+class%3D%22media-body%22%3E%0A++++++++++++++%3Ch4+class%3D%22media-heading%22%3E%3Ca+href%3D%22'
   44    69        FETCH_DIM_R                                      ~54     !2, 'address'
         70        CONCAT                                           ~55     ~53, ~54
         71        CONCAT                                           ~56     ~55, '%22%3E'
         72        FETCH_DIM_R                                      ~57     !2, 'title'
         73        CONCAT                                           ~58     ~56, ~57
         74        CONCAT                                           ~59     ~58, '%3C%2Fa%3E%3C%2Fh4%3E%0A++++++++++++++%3Cp%3E...'
   45    75        INIT_FCALL                                               'str_replace'
         76        SEND_VAR                                                 !1
         77        CONCAT                                           ~60     '%3Cstrong%3E', !1
         78        CONCAT                                           ~61     ~60, '%3C%2Fstrong%3E'
         79        SEND_VAL                                                 ~61
         80        INIT_FCALL                                               'substr'
         81        SEND_VAR                                                 !3
         82        INIT_FCALL                                               'strpos'
         83        SEND_VAR                                                 !3
         84        SEND_VAR                                                 !1
         85        DO_ICALL                                         $62     
         86        SUB                                              ~63     $62, 25
         87        SEND_VAL                                                 ~63
         88        SEND_VAL                                                 160
         89        DO_ICALL                                         $64     
         90        SEND_VAR                                                 $64
         91        DO_ICALL                                         $65     
         92        CONCAT                                           ~66     ~59, $65
         93        CONCAT                                           ~67     ~66, '...%3C%2Fp%3E%0A++++++++++++%3C%2Fdiv%3E%0A+++++++++++%3C%2Fli%3E'
         94        ECHO                                                     ~67
   35    95      > JMP                                                      ->60
         96    >   FE_FREE                                                  $45
   28    97    > > JMP                                                      ->48
         98    >   FE_FREE                                                  $38
   50    99      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.33 ms | 1404 KiB | 21 Q