3v4l.org

run code in 500+ PHP versions simultaneously
<?php $a = [ 0 => [ "product_id" => 219, "product_description" => "<table style=\"color:; text-align: left;\"> <tr> <td> Processor: </td> <td> Intel Core 2 Duo - E8400 </td> </tr> <tr> <td> Clock speed: </td> <td> 3.0 GHz </td> </tr> <tr> <td> Memory: </td> <td> 4 GB </td> </tr> <tr> <td> Hard disk: </td> <td> 250 GB </td> </tr> <tr> <td> Video-adapter: </td> <td> VGA, Display </td> </tr> <tr> <td> Netwerk card: </td> <td> 1000 Mbps LAN </td> </tr> <tr> <td> Optical drive: </td> <td> DVD-Rewriter </td> </tr> <tr> <td> Operating system: </td> <td> Windows 7 or 10 Pro </td> </tr> <tr> <td> Warranty: </td> <td> 1 year </td> </tr> </table>"] ]; $arr = array_pop($a); $str = $arr["product_description"]; $stripped = strip_tags( $str, "<td>" ); $replaced = str_replace( "</td>", "", $stripped ); $arr = explode( "<td>", $replaced ); array_shift( $arr ); $arrKeyVal=[]; for( $i=0, $max = count( $arr ); $i < $max; $i+=2 ) { $key = trim( $arr[$i],"\r\t\n :" ); $arrKeyVal[strtolower( $key )] = trim( $arr[$i+1] ); } print_r( $arrKeyVal );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 28
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 28
Branch analysis from position: 42
Branch analysis from position: 28
filename:       /in/vlWaP
function name:  (null)
number of ops:  46
compiled vars:  !0 = $a, !1 = $arr, !2 = $str, !3 = $stripped, !4 = $replaced, !5 = $arrKeyVal, !6 = $i, !7 = $max, !8 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   80     1        INIT_FCALL                                                   'array_pop'
          2        SEND_REF                                                     !0
          3        DO_ICALL                                             $10     
          4        ASSIGN                                                       !1, $10
   82     5        FETCH_DIM_R                                          ~12     !1, 'product_description'
          6        ASSIGN                                                       !2, ~12
   85     7        INIT_FCALL                                                   'strip_tags'
          8        SEND_VAR                                                     !2
          9        SEND_VAL                                                     '%3Ctd%3E'
         10        DO_ICALL                                             $14     
         11        ASSIGN                                                       !3, $14
   86    12        FRAMELESS_ICALL_3                str_replace         ~16     '%3C%2Ftd%3E', ''
         13        OP_DATA                                                      !3
         14        ASSIGN                                                       !4, ~16
   87    15        INIT_FCALL                                                   'explode'
         16        SEND_VAL                                                     '%3Ctd%3E'
         17        SEND_VAR                                                     !4
         18        DO_ICALL                                             $18     
         19        ASSIGN                                                       !1, $18
   88    20        INIT_FCALL                                                   'array_shift'
         21        SEND_REF                                                     !1
         22        DO_ICALL                                                     
   90    23        ASSIGN                                                       !5, <array>
   92    24        ASSIGN                                                       !6, 0
         25        COUNT                                                ~23     !1
         26        ASSIGN                                                       !7, ~23
         27      > JMP                                                          ->40
   93    28    >   FETCH_DIM_R                                          ~25     !1, !6
         29        FRAMELESS_ICALL_2                trim                ~26     ~25, '%0D%09%0A+%3A'
         30        ASSIGN                                                       !8, ~26
   94    31        INIT_FCALL                                                   'strtolower'
         32        SEND_VAR                                                     !8
         33        DO_ICALL                                             $28     
         34        ADD                                                  ~30     !6, 1
         35        FETCH_DIM_R                                          ~31     !1, ~30
         36        FRAMELESS_ICALL_1                trim                ~32     ~31
         37        ASSIGN_DIM                                                   !5, $28
         38        OP_DATA                                                      ~32
   92    39        ASSIGN_OP                                         1          !6, 2
         40    >   IS_SMALLER                                                   !6, !7
         41      > JMPNZ                                                        ~34, ->28
   96    42    >   INIT_FCALL                                                   'print_r'
         43        SEND_VAR                                                     !5
         44        DO_ICALL                                                     
         45      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
166.47 ms | 2191 KiB | 19 Q