3v4l.org

run code in 300+ PHP versions simultaneously
<?php function assignValuesFromText( $sIn, $dVat = null ){ $aRet = array(); $aPieces = explode( '@@', $sIn ); while ( list( $sKey, $sVal ) = each( $aPieces ) ) { if ( $sVal ) { $aName = explode( '__', $sVal ); if ( isset( $aName[0] ) && isset( $aName[1] ) ) { //$aRet[] = $this->_fillExplodeArray( $aName, $dVat ); } } } return $aRet; } $string = "Schwarz__@@Weiß__@@Schön!P!10__@@Cool!P!50%__@@"; echo print_r(assignValuesFromText($string),true);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SLG2f
function name:  (null)
number of ops:  10
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ASSIGN                                                   !0, 'Schwarz__%40%40Wei%C3%9F__%40%40Sch%C3%B6n%21P%2110__%40%40Cool%21P%2150%25__%40%40'
   18     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'assignvaluesfromtext'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        SEND_VAL                                                 <true>
          7        DO_ICALL                                         $3      
          8        ECHO                                                     $3
          9      > RETURN                                                   1

Function assignvaluesfromtext:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 9
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 20
Branch analysis from position: 10
2 jumps found. (Code = 46) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 20
Branch analysis from position: 20
Branch analysis from position: 20
Branch analysis from position: 19
Branch analysis from position: 20
filename:       /in/SLG2f
function name:  assignValuesFromText
number of ops:  30
compiled vars:  !0 = $sIn, !1 = $dVat, !2 = $aRet, !3 = $aPieces, !4 = $sVal, !5 = $aName, !6 = $sKey
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
    3     2        ASSIGN                                                   !2, <array>
    4     3        INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '%40%40'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $8      
          7        ASSIGN                                                   !3, $8
    5     8      > JMP                                                      ->20
    6     9    > > JMPZ                                                     !4, ->20
    7    10    >   INIT_FCALL                                               'explode'
         11        SEND_VAL                                                 '__'
         12        SEND_VAR                                                 !4
         13        DO_ICALL                                         $10     
         14        ASSIGN                                                   !5, $10
    8    15        ISSET_ISEMPTY_DIM_OBJ                         0  ~12     !5, 0
         16      > JMPZ_EX                                          ~12     ~12, ->19
         17    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~13     !5, 1
         18        BOOL                                             ~12     ~13
         19    > > JMPZ                                                     ~12, ->20
    5    20    >   INIT_FCALL_BY_NAME                                       'each'
         21        SEND_VAR_EX                                              !3
         22        DO_FCALL                                      0  $14     
         23        FETCH_LIST_R                                     $15     $14, 0
         24        ASSIGN                                                   !6, $15
         25        FETCH_LIST_R                                     $17     $14, 1
         26        ASSIGN                                                   !4, $17
         27      > JMPNZ                                                    $14, ->9
   13    28    > > RETURN                                                   !2
   14    29*     > RETURN                                                   null

End of function assignvaluesfromtext

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146 ms | 1403 KiB | 18 Q