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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.92 ms | 1404 KiB | 21 Q