3v4l.org

run code in 300+ PHP versions simultaneously
<?php $row = '{ "persona_apellido": "hey", "persona_apellido-maxwidth": 48, "persona_curso": "info", "persona_curso-maxwidth": 32, "persona_email": "dude@dude.com", "persona_email-maxwidth": 128, "persona_freg": "2013-08-15 17:03:58", "persona_freg-maxwidth": 152, "persona_id": "3", "persona_id-maxwidth": 8, "persona_nombre": "dude", "persona_nombre-maxwidth": 64, "up_persona_apellido": "", "up_persona_curso": "", "up_persona_email": "", "up_persona_freg": "", "up_persona_id": "", "up_persona_nombre": ""}'; $row = json_decode($row, true); $queryIn = '';$ladoA = 0;$ladoB = 0; foreach($row as $k => $value){ if(strstr($k,'-maxwidth') === false && strstr($k,'itemSelected') === false){ if(!empty($value) && strstr($k,'up_') !== false){ $queryIn .= ' '.substr($k, 3, strlen($k)).'='.$value; $ladoA++; }else{ $queryIn .= ' '.$k.'='.$value; $ladoB++; } } } var_dump($row); echo $queryIn." ".$ladoA." ".$ladoB;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 53
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 53
Branch analysis from position: 11
2 jumps found. (Code = 46) Position 1 = 18, Position 2 = 24
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 52
Branch analysis from position: 25
2 jumps found. (Code = 46) Position 1 = 28, Position 2 = 34
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 47
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 34
Branch analysis from position: 52
Branch analysis from position: 24
Branch analysis from position: 53
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 53
filename:       /in/Jg5lu
function name:  (null)
number of ops:  63
compiled vars:  !0 = $row, !1 = $queryIn, !2 = $ladoA, !3 = $ladoB, !4 = $value, !5 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%7B%0A++++%09%22persona_apellido%22%3A+%22hey%22%2C%0A++++++++%22persona_apellido-maxwidth%22%3A+48%2C%0A+++++++%09%22persona_curso%22%3A+%22info%22%2C%0A++++++++%22persona_curso-maxwidth%22%3A+32%2C%0A++++++++%22persona_email%22%3A+%22dude%40dude.com%22%2C%0A++++++++%22persona_email-maxwidth%22%3A+128%2C%0A++++++++%22persona_freg%22%3A+%222013-08-15+17%3A03%3A58%22%2C%0A++++++++%22persona_freg-maxwidth%22%3A+152%2C%0A++++++++%22persona_id%22%3A+%223%22%2C%0A++++++++%22persona_id-maxwidth%22%3A+8%2C%0A++++++++%22persona_nombre%22%3A+%22dude%22%2C%0A++++++++%22persona_nombre-maxwidth%22%3A+64%2C%0A++++++++%22up_persona_apellido%22%3A+%22%22%2C%0A++++++++%22up_persona_curso%22%3A+%22%22%2C%0A++++++++%22up_persona_email%22%3A+%22%22%2C%0A++++++++%22up_persona_freg%22%3A+%22%22%2C%0A++++++++%22up_persona_id%22%3A+%22%22%2C%0A++++++++%22up_persona_nombre%22%3A+%22%22%7D'
   21     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $7      
          5        ASSIGN                                                   !0, $7
   22     6        ASSIGN                                                   !1, ''
          7        ASSIGN                                                   !2, 0
          8        ASSIGN                                                   !3, 0
   23     9      > FE_RESET_R                                       $12     !0, ->53
         10    > > FE_FETCH_R                                       ~13     $12, !4, ->53
         11    >   ASSIGN                                                   !5, ~13
   24    12        INIT_FCALL                                               'strstr'
         13        SEND_VAR                                                 !5
         14        SEND_VAL                                                 '-maxwidth'
         15        DO_ICALL                                         $15     
         16        TYPE_CHECK                                    4  ~16     $15
         17      > JMPZ_EX                                          ~16     ~16, ->24
         18    >   INIT_FCALL                                               'strstr'
         19        SEND_VAR                                                 !5
         20        SEND_VAL                                                 'itemSelected'
         21        DO_ICALL                                         $17     
         22        TYPE_CHECK                                    4  ~18     $17
         23        BOOL                                             ~16     ~18
         24    > > JMPZ                                                     ~16, ->52
   25    25    >   ISSET_ISEMPTY_CV                                 ~19     !4
         26        BOOL_NOT                                         ~20     ~19
         27      > JMPZ_EX                                          ~20     ~20, ->34
         28    >   INIT_FCALL                                               'strstr'
         29        SEND_VAR                                                 !5
         30        SEND_VAL                                                 'up_'
         31        DO_ICALL                                         $21     
         32        TYPE_CHECK                                  1018  ~22     $21
         33        BOOL                                             ~20     ~22
         34    > > JMPZ                                                     ~20, ->47
   26    35    >   INIT_FCALL                                               'substr'
         36        SEND_VAR                                                 !5
         37        SEND_VAL                                                 3
         38        STRLEN                                           ~23     !5
         39        SEND_VAL                                                 ~23
         40        DO_ICALL                                         $24     
         41        CONCAT                                           ~25     '+', $24
         42        CONCAT                                           ~26     ~25, '%3D'
         43        CONCAT                                           ~27     ~26, !4
         44        ASSIGN_OP                                     8          !1, ~27
   27    45        PRE_INC                                                  !2
         46      > JMP                                                      ->52
   29    47    >   CONCAT                                           ~30     '+', !5
         48        CONCAT                                           ~31     ~30, '%3D'
         49        CONCAT                                           ~32     ~31, !4
         50        ASSIGN_OP                                     8          !1, ~32
   30    51        PRE_INC                                                  !3
   23    52    > > JMP                                                      ->10
         53    >   FE_FREE                                                  $12
   34    54        INIT_FCALL                                               'var_dump'
         55        SEND_VAR                                                 !0
         56        DO_ICALL                                                 
   35    57        CONCAT                                           ~36     !1, '+'
         58        CONCAT                                           ~37     ~36, !2
         59        CONCAT                                           ~38     ~37, '+'
         60        CONCAT                                           ~39     ~38, !3
         61        ECHO                                                     ~39
         62      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.75 ms | 1392 KiB | 21 Q