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": "idio", "up_persona_email": "", "up_persona_freg": "", "up_persona_id": "", "up_persona_nombre": ""}'; $row = json_decode($row, true); $queryIn = '';$control = 0; foreach($row as $k => $value){ if(strstr($k,'-maxwidth') === false && strstr($k,'itemSelected') === false){ if(!empty($value)){ if(strstr($k,'up_') !== false){ $queryIn .= ' '.substr($k, 3, strlen($k)).'=\''.$value.'\''; $control++; if($control<1){ $queryIn .= ','; } } } } } if($control == 0){ $error = "No hay cambios que plasmar"; }else if($control<1){ $queryIn = substr($queryIn, 0, strlen($queryIn)-1); } var_dump($row); echo $queryIn." ".$control;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 49
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 49
Branch analysis from position: 10
2 jumps found. (Code = 46) Position 1 = 17, Position 2 = 23
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 48
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 48
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 48
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 48
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 48
Branch analysis from position: 48
Branch analysis from position: 48
Branch analysis from position: 48
Branch analysis from position: 23
Branch analysis from position: 49
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 54
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 64
Branch analysis from position: 64
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 54
2 jumps found. (Code = 43) Position 1 = 56, Position 2 = 64
Branch analysis from position: 56
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 64
Branch analysis from position: 49
filename:       /in/AirJ9
function name:  (null)
number of ops:  71
compiled vars:  !0 = $row, !1 = $queryIn, !2 = $control, !3 = $value, !4 = $k, !5 = $error
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+%22idio%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
   23     8      > FE_RESET_R                                       $11     !0, ->49
          9    > > FE_FETCH_R                                       ~12     $11, !3, ->49
         10    >   ASSIGN                                                   !4, ~12
   24    11        INIT_FCALL                                               'strstr'
         12        SEND_VAR                                                 !4
         13        SEND_VAL                                                 '-maxwidth'
         14        DO_ICALL                                         $14     
         15        TYPE_CHECK                                    4  ~15     $14
         16      > JMPZ_EX                                          ~15     ~15, ->23
         17    >   INIT_FCALL                                               'strstr'
         18        SEND_VAR                                                 !4
         19        SEND_VAL                                                 'itemSelected'
         20        DO_ICALL                                         $16     
         21        TYPE_CHECK                                    4  ~17     $16
         22        BOOL                                             ~15     ~17
         23    > > JMPZ                                                     ~15, ->48
   25    24    >   ISSET_ISEMPTY_CV                                 ~18     !3
         25        BOOL_NOT                                         ~19     ~18
         26      > JMPZ                                                     ~19, ->48
   26    27    >   INIT_FCALL                                               'strstr'
         28        SEND_VAR                                                 !4
         29        SEND_VAL                                                 'up_'
         30        DO_ICALL                                         $20     
         31        TYPE_CHECK                                  1018          $20
         32      > JMPZ                                                     ~21, ->48
   27    33    >   INIT_FCALL                                               'substr'
         34        SEND_VAR                                                 !4
         35        SEND_VAL                                                 3
         36        STRLEN                                           ~22     !4
         37        SEND_VAL                                                 ~22
         38        DO_ICALL                                         $23     
         39        CONCAT                                           ~24     '+', $23
         40        CONCAT                                           ~25     ~24, '%3D%27'
         41        CONCAT                                           ~26     ~25, !3
         42        CONCAT                                           ~27     ~26, '%27'
         43        ASSIGN_OP                                     8          !1, ~27
   28    44        PRE_INC                                                  !2
   29    45        IS_SMALLER                                               !2, 1
         46      > JMPZ                                                     ~30, ->48
   30    47    >   ASSIGN_OP                                     8          !1, '%2C'
   23    48    > > JMP                                                      ->9
         49    >   FE_FREE                                                  $11
   37    50        IS_EQUAL                                                 !2, 0
         51      > JMPZ                                                     ~32, ->54
   38    52    >   ASSIGN                                                   !5, 'No+hay+cambios+que+plasmar'
         53      > JMP                                                      ->64
   40    54    >   IS_SMALLER                                               !2, 1
         55      > JMPZ                                                     ~34, ->64
   41    56    >   INIT_FCALL                                               'substr'
         57        SEND_VAR                                                 !1
         58        SEND_VAL                                                 0
         59        STRLEN                                           ~35     !1
         60        SUB                                              ~36     ~35, 1
         61        SEND_VAL                                                 ~36
         62        DO_ICALL                                         $37     
         63        ASSIGN                                                   !1, $37
   43    64    >   INIT_FCALL                                               'var_dump'
         65        SEND_VAR                                                 !0
         66        DO_ICALL                                                 
   44    67        CONCAT                                           ~40     !1, '+'
         68        CONCAT                                           ~41     ~40, !2
         69        ECHO                                                     ~41
         70      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.52 ms | 1404 KiB | 21 Q