3v4l.org

run code in 300+ PHP versions simultaneously
<?php $line = "9938275IBUPROFENIX 400 mg comp.x 10 00000594NNPhoenix 00000062220110810001001803827517791848330116001010NNN00"; $str = trim(trim(substr($line, 7, 44)) . ' ' . trim(substr($line, 51, 24))); $changes = array( 'E1' => 'B', 'A7' => 'º', 'A5' => 'Ñ', 'A4' => 'ñ', 'A3' => 'ú', 'A2' => 'ó', 'A1' => 'í', '82' => 'é', 'A0' => 'á', '9A' => 'U', ); foreach ($changes as $key => $value){ $str = $this->doFix($str, $key, $value); } $str = str_replace(',', ', ', $str); $str = str_replace('+', ' + ', $str); $str = str_replace('¥', 'Ñ', $str); $str = str_replace('š', 'U', $str); $str = ucfirst(trim($str)); $str = preg_replace('/\s+/', ' ', $str); $brand = trim(substr($line, 7, 44)); echo $str . '----'; echo $brand . '----';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 25, Position 2 = 35
Branch analysis from position: 25
2 jumps found. (Code = 78) Position 1 = 26, Position 2 = 35
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
filename:       /in/hs0OP
function name:  (null)
number of ops:  87
compiled vars:  !0 = $line, !1 = $str, !2 = $changes, !3 = $value, !4 = $key, !5 = $brand
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '9938275IBUPROFENIX+++++++++++++++++++++++++++++++++400+mg+comp.x+10++++++++00000594NNPhoenix+++++++++00000062220110810001001803827517791848330116001010NNN00'
    5     1        INIT_FCALL                                               'trim'
          2        INIT_FCALL                                               'trim'
          3        INIT_FCALL                                               'substr'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 7
          6        SEND_VAL                                                 44
          7        DO_ICALL                                         $7      
          8        SEND_VAR                                                 $7
          9        DO_ICALL                                         $8      
         10        CONCAT                                           ~9      $8, '+'
         11        INIT_FCALL                                               'trim'
         12        INIT_FCALL                                               'substr'
         13        SEND_VAR                                                 !0
         14        SEND_VAL                                                 51
         15        SEND_VAL                                                 24
         16        DO_ICALL                                         $10     
         17        SEND_VAR                                                 $10
         18        DO_ICALL                                         $11     
         19        CONCAT                                           ~12     ~9, $11
         20        SEND_VAL                                                 ~12
         21        DO_ICALL                                         $13     
         22        ASSIGN                                                   !1, $13
    6    23        ASSIGN                                                   !2, <array>
   19    24      > FE_RESET_R                                       $16     !2, ->35
         25    > > FE_FETCH_R                                       ~17     $16, !3, ->35
         26    >   ASSIGN                                                   !4, ~17
   20    27        FETCH_THIS                                       $19     
         28        INIT_METHOD_CALL                                         $19, 'doFix'
         29        SEND_VAR_EX                                              !1
         30        SEND_VAR_EX                                              !4
         31        SEND_VAR_EX                                              !3
         32        DO_FCALL                                      0  $20     
         33        ASSIGN                                                   !1, $20
   19    34      > JMP                                                      ->25
         35    >   FE_FREE                                                  $16
   23    36        INIT_FCALL                                               'str_replace'
         37        SEND_VAL                                                 '%2C'
         38        SEND_VAL                                                 '%2C+'
         39        SEND_VAR                                                 !1
         40        DO_ICALL                                         $22     
         41        ASSIGN                                                   !1, $22
   24    42        INIT_FCALL                                               'str_replace'
         43        SEND_VAL                                                 '%2B'
         44        SEND_VAL                                                 '+%2B+'
         45        SEND_VAR                                                 !1
         46        DO_ICALL                                         $24     
         47        ASSIGN                                                   !1, $24
   25    48        INIT_FCALL                                               'str_replace'
         49        SEND_VAL                                                 '%C2%A5'
         50        SEND_VAL                                                 '%C3%91'
         51        SEND_VAR                                                 !1
         52        DO_ICALL                                         $26     
         53        ASSIGN                                                   !1, $26
   26    54        INIT_FCALL                                               'str_replace'
         55        SEND_VAL                                                 '%C5%A1'
         56        SEND_VAL                                                 'U'
         57        SEND_VAR                                                 !1
         58        DO_ICALL                                         $28     
         59        ASSIGN                                                   !1, $28
   27    60        INIT_FCALL                                               'ucfirst'
         61        INIT_FCALL                                               'trim'
         62        SEND_VAR                                                 !1
         63        DO_ICALL                                         $30     
         64        SEND_VAR                                                 $30
         65        DO_ICALL                                         $31     
         66        ASSIGN                                                   !1, $31
   28    67        INIT_FCALL                                               'preg_replace'
         68        SEND_VAL                                                 '%2F%5Cs%2B%2F'
         69        SEND_VAL                                                 '+'
         70        SEND_VAR                                                 !1
         71        DO_ICALL                                         $33     
         72        ASSIGN                                                   !1, $33
   29    73        INIT_FCALL                                               'trim'
         74        INIT_FCALL                                               'substr'
         75        SEND_VAR                                                 !0
         76        SEND_VAL                                                 7
         77        SEND_VAL                                                 44
         78        DO_ICALL                                         $35     
         79        SEND_VAR                                                 $35
         80        DO_ICALL                                         $36     
         81        ASSIGN                                                   !5, $36
   31    82        CONCAT                                           ~38     !1, '----'
         83        ECHO                                                     ~38
   32    84        CONCAT                                           ~39     !5, '----'
         85        ECHO                                                     ~39
         86      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
185.79 ms | 1400 KiB | 23 Q