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[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[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."; $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>'; $total++; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 39, Position 2 = 87
Branch analysis from position: 39
2 jumps found. (Code = 78) Position 1 = 40, Position 2 = 87
Branch analysis from position: 40
2 jumps found. (Code = 77) Position 1 = 48, Position 2 = 85
Branch analysis from position: 48
2 jumps found. (Code = 78) Position 1 = 49, Position 2 = 85
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
Branch analysis from position: 85
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
Branch analysis from position: 85
Branch analysis from position: 87
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 87
filename:       /in/tXhOv
function name:  (null)
number of ops:  89
compiled vars:  !0 = $the_mysql_result, !1 = $query, !2 = $results, !3 = $content, !4 = $row_occurences, !5 = $an_occurence, !6 = $total
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    7     1        FETCH_DIM_W                                      $8      !0, 0
          2        ASSIGN_DIM                                               $8, 'id'
          3        OP_DATA                                                  '1'
    8     4        FETCH_DIM_W                                      $10     !0, 0
          5        ASSIGN_DIM                                               $10, 'address'
          6        OP_DATA                                                  'www.example.com%2Fpage1'
    9     7        FETCH_DIM_W                                      $12     !0, 0
          8        ASSIGN_DIM                                               $12, 'title'
          9        OP_DATA                                                  'Page+1'
   10    10        FETCH_DIM_W                                      $14     !0, 0
         11        ASSIGN_DIM                                               $14, 'content'
         12        OP_DATA                                                  'The+quick+dog+jumps+over+the+lazy+dog.'
   12    13        FETCH_DIM_W                                      $16     !0, 1
         14        ASSIGN_DIM                                               $16, 'id'
         15        OP_DATA                                                  '2'
   13    16        FETCH_DIM_W                                      $18     !0, 1
         17        ASSIGN_DIM                                               $18, 'address'
         18        OP_DATA                                                  'www.example.com%2Fpage2'
   14    19        FETCH_DIM_W                                      $20     !0, 1
         20        ASSIGN_DIM                                               $20, 'title'
         21        OP_DATA                                                  'Page+2'
   15    22        FETCH_DIM_W                                      $22     !0, 1
         23        ASSIGN_DIM                                               $22, 'content'
         24        OP_DATA                                                  'The+best+thing+about+morning+is+breakfast.'
   17    25        FETCH_DIM_W                                      $24     !0, 2
         26        ASSIGN_DIM                                               $24, 'id'
         27        OP_DATA                                                  '3'
   18    28        FETCH_DIM_W                                      $26     !0, 2
         29        ASSIGN_DIM                                               $26, 'address'
         30        OP_DATA                                                  'www.example.com%2Fpage3'
   19    31        FETCH_DIM_W                                      $28     !0, 2
         32        ASSIGN_DIM                                               $28, 'title'
         33        OP_DATA                                                  'Page+3'
   20    34        FETCH_DIM_W                                      $30     !0, 2
         35        ASSIGN_DIM                                               $30, 'content'
         36        OP_DATA                                                  'Hotdogs+are+great+ballpark+food.'
   23    37        ASSIGN                                                   !1, 'dog'
   25    38      > FE_RESET_R                                       $33     !0, ->87
         39    > > FE_FETCH_R                                               $33, !2, ->87
   27    40    >   FETCH_DIM_R                                      ~34     !2, 'content'
         41        ASSIGN                                                   !3, ~34
   28    42        INIT_FCALL                                               'explode'
         43        SEND_VAR                                                 !1
         44        SEND_VAR                                                 !3
         45        DO_ICALL                                         $36     
         46        ASSIGN                                                   !4, $36
   30    47      > FE_RESET_R                                       $38     !4, ->85
         48    > > FE_FETCH_R                                               $38, !5, ->85
   32    49    >   CONCAT                                           ~39     !5, !1
         50        ASSIGN                                                   !3, ~39
   35    51        FETCH_DIM_R                                      ~41     !2, 'address'
         52        CONCAT                                           ~42     '%3Cli+class%3D%22media%22%3E%0A++++++++++++%3Ca+class%3D%22pull-left%22+href%3D%22', ~41
         53        CONCAT                                           ~43     ~42, '%22%3E%0A++++++++++++%3Cimg+class%3D%22media-object+thumbnail%22+src%3D%22'
   36    54        FETCH_DIM_R                                      ~44     !2, 'image'
         55        CONCAT                                           ~45     ~43, ~44
         56        CONCAT                                           ~46     ~45, '%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'
   39    57        FETCH_DIM_R                                      ~47     !2, 'address'
         58        CONCAT                                           ~48     ~46, ~47
         59        CONCAT                                           ~49     ~48, '%22%3E'
         60        FETCH_DIM_R                                      ~50     !2, 'title'
         61        CONCAT                                           ~51     ~49, ~50
         62        CONCAT                                           ~52     ~51, '%3C%2Fa%3E%3C%2Fh4%3E%0A++++++++++++++%3Cp%3E...'
   40    63        INIT_FCALL                                               'str_replace'
         64        SEND_VAR                                                 !1
         65        CONCAT                                           ~53     '%3Cstrong%3E', !1
         66        CONCAT                                           ~54     ~53, '%3C%2Fstrong%3E'
         67        SEND_VAL                                                 ~54
         68        INIT_FCALL                                               'substr'
         69        SEND_VAR                                                 !3
         70        INIT_FCALL                                               'strpos'
         71        SEND_VAR                                                 !3
         72        SEND_VAR                                                 !1
         73        DO_ICALL                                         $55     
         74        SUB                                              ~56     $55, 25
         75        SEND_VAL                                                 ~56
         76        SEND_VAL                                                 160
         77        DO_ICALL                                         $57     
         78        SEND_VAR                                                 $57
         79        DO_ICALL                                         $58     
         80        CONCAT                                           ~59     ~52, $58
         81        CONCAT                                           ~60     ~59, '...%3C%2Fp%3E%0A++++++++++++%3C%2Fdiv%3E%0A+++++++++++%3C%2Fli%3E'
         82        ECHO                                                     ~60
   43    83        PRE_INC                                                  !6
   30    84      > JMP                                                      ->48
         85    >   FE_FREE                                                  $38
   25    86      > JMP                                                      ->39
         87    >   FE_FREE                                                  $33
   45    88      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.12 ms | 1404 KiB | 21 Q