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 = '';$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 == 0){ $error = "No hay cambios que plasmar"; } var_dump($row); echo $queryIn." ".$control;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 45
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 45
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 = 44
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 44
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 44
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 44
Branch analysis from position: 44
Branch analysis from position: 44
Branch analysis from position: 23
Branch analysis from position: 45
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 49
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
Branch analysis from position: 45
filename:       /in/bq0qp
function name:  (null)
number of ops:  56
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+%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
   23     8      > FE_RESET_R                                       $11     !0, ->45
          9    > > FE_FETCH_R                                       ~12     $11, !3, ->45
         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, ->44
   25    24    >   ISSET_ISEMPTY_CV                                 ~18     !3
         25        BOOL_NOT                                         ~19     ~18
         26      > JMPZ                                                     ~19, ->44
   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, ->44
   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'
         41        CONCAT                                           ~26     ~25, !3
         42        ASSIGN_OP                                     8          !1, ~26
   28    43        PRE_INC                                                  !2
   23    44    > > JMP                                                      ->9
         45    >   FE_FREE                                                  $11
   33    46        IS_EQUAL                                                 !2, 0
         47      > JMPZ                                                     ~29, ->49
   34    48    >   ASSIGN                                                   !5, 'No+hay+cambios+que+plasmar'
   36    49    >   INIT_FCALL                                               'var_dump'
         50        SEND_VAR                                                 !0
         51        DO_ICALL                                                 
   37    52        CONCAT                                           ~32     !1, '+'
         53        CONCAT                                           ~33     ~32, !2
         54        ECHO                                                     ~33
         55      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.4 ms | 1400 KiB | 21 Q