3v4l.org

run code in 300+ 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 = 48
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 31
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 31
Branch analysis from position: 50
Branch analysis from position: 31
filename:       /in/vlWaP
function name:  (null)
number of ops:  54
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        INIT_FCALL                                               'str_replace'
         13        SEND_VAL                                                 '%3C%2Ftd%3E'
         14        SEND_VAL                                                 ''
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                         $16     
         17        ASSIGN                                                   !4, $16
   87    18        INIT_FCALL                                               'explode'
         19        SEND_VAL                                                 '%3Ctd%3E'
         20        SEND_VAR                                                 !4
         21        DO_ICALL                                         $18     
         22        ASSIGN                                                   !1, $18
   88    23        INIT_FCALL                                               'array_shift'
         24        SEND_REF                                                 !1
         25        DO_ICALL                                                 
   90    26        ASSIGN                                                   !5, <array>
   92    27        ASSIGN                                                   !6, 0
         28        COUNT                                            ~23     !1
         29        ASSIGN                                                   !7, ~23
         30      > JMP                                                      ->48
   93    31    >   INIT_FCALL                                               'trim'
         32        FETCH_DIM_R                                      ~25     !1, !6
         33        SEND_VAL                                                 ~25
         34        SEND_VAL                                                 '%0D%09%0A+%3A'
         35        DO_ICALL                                         $26     
         36        ASSIGN                                                   !8, $26
   94    37        INIT_FCALL                                               'strtolower'
         38        SEND_VAR                                                 !8
         39        DO_ICALL                                         $28     
         40        INIT_FCALL                                               'trim'
         41        ADD                                              ~30     !6, 1
         42        FETCH_DIM_R                                      ~31     !1, ~30
         43        SEND_VAL                                                 ~31
         44        DO_ICALL                                         $32     
         45        ASSIGN_DIM                                               !5, $28
         46        OP_DATA                                                  $32
   92    47        ASSIGN_OP                                     1          !6, 2
         48    >   IS_SMALLER                                               !6, !7
         49      > JMPNZ                                                    ~34, ->31
   96    50    >   INIT_FCALL                                               'print_r'
         51        SEND_VAR                                                 !5
         52        DO_ICALL                                                 
         53      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.2 ms | 1015 KiB | 21 Q