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); 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 = 95
Branch analysis from position: 48
2 jumps found. (Code = 78) Position 1 = 49, Position 2 = 95
Branch analysis from position: 49
2 jumps found. (Code = 77) Position 1 = 57, Position 2 = 93
Branch analysis from position: 57
2 jumps found. (Code = 78) Position 1 = 58, Position 2 = 93
Branch analysis from position: 58
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
Branch analysis from position: 93
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
Branch analysis from position: 93
Branch analysis from position: 95
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 95
filename:       /in/E0D6b
function name:  (null)
number of ops:  97
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, ->95
         48    > > FE_FETCH_R                                               $38, !2, ->95
   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      > FE_RESET_R                                       $43     !4, ->93
         57    > > FE_FETCH_R                                               $43, !5, ->93
   35    58    >   CONCAT                                           ~44     !5, !1
         59        ASSIGN                                                   !3, ~44
   38    60        FETCH_DIM_R                                      ~46     !2, 'address'
         61        CONCAT                                           ~47     '%3Cli+class%3D%22media%22%3E%0A++++++++++++%3Ca+class%3D%22pull-left%22+href%3D%22', ~46
         62        CONCAT                                           ~48     ~47, '%22%3E%0A++++++++++++%3Cimg+class%3D%22media-object+thumbnail%22+src%3D%22'
   39    63        FETCH_DIM_R                                      ~49     !2, 'image'
         64        CONCAT                                           ~50     ~48, ~49
         65        CONCAT                                           ~51     ~50, '%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'
   42    66        FETCH_DIM_R                                      ~52     !2, 'address'
         67        CONCAT                                           ~53     ~51, ~52
         68        CONCAT                                           ~54     ~53, '%22%3E'
         69        FETCH_DIM_R                                      ~55     !2, 'title'
         70        CONCAT                                           ~56     ~54, ~55
         71        CONCAT                                           ~57     ~56, '%3C%2Fa%3E%3C%2Fh4%3E%0A++++++++++++++%3Cp%3E...'
   43    72        INIT_FCALL                                               'str_replace'
         73        SEND_VAR                                                 !1
         74        CONCAT                                           ~58     '%3Cstrong%3E', !1
         75        CONCAT                                           ~59     ~58, '%3C%2Fstrong%3E'
         76        SEND_VAL                                                 ~59
         77        INIT_FCALL                                               'substr'
         78        SEND_VAR                                                 !3
         79        INIT_FCALL                                               'strpos'
         80        SEND_VAR                                                 !3
         81        SEND_VAR                                                 !1
         82        DO_ICALL                                         $60     
         83        SUB                                              ~61     $60, 25
         84        SEND_VAL                                                 ~61
         85        SEND_VAL                                                 160
         86        DO_ICALL                                         $62     
         87        SEND_VAR                                                 $62
         88        DO_ICALL                                         $63     
         89        CONCAT                                           ~64     ~57, $63
         90        CONCAT                                           ~65     ~64, '...%3C%2Fp%3E%0A++++++++++++%3C%2Fdiv%3E%0A+++++++++++%3C%2Fli%3E'
         91        ECHO                                                     ~65
   33    92      > JMP                                                      ->57
         93    >   FE_FREE                                                  $43
   28    94      > JMP                                                      ->48
         95    >   FE_FREE                                                  $38
   47    96      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163 ms | 1404 KiB | 21 Q