3v4l.org

run code in 500+ PHP versions simultaneously
<?php $where = array(); $_GET['CodigoUtente'] = 'sany'; $_GET['Nome'] = 'dddd'; if(isset($_GET['CodigoUtente'])){ $where[] = "CodigoUtente = '".$_GET['CodigoUtente']."'"; } if(isset($_GET['Nome'])){ $where[] = "Nome = '".$_GET['Nome']."'"; } $sql = "SELECT CodigoUtente, Nome, DataNasc, Sexo, Estadocivil, Nacionalidade, Responsavel, Parentesco, Contato FROM centrodb.PsicUtentes"; if(!empty($where)){ $final_where = count($where) > 1 ? implode(' OR ', $where) : end($where); $sql = "$sql WHERE ". $final_where; } echo $sql;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 25
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 44
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 35
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
Branch analysis from position: 25
Branch analysis from position: 16
filename:       /in/phZGW
function name:  (null)
number of ops:  46
compiled vars:  !0 = $where, !1 = $sql, !2 = $final_where
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        FETCH_W                          global              $4      '_GET'
          2        ASSIGN_DIM                                                   $4, 'CodigoUtente'
          3        OP_DATA                                                      'sany'
    5     4        FETCH_W                          global              $6      '_GET'
          5        ASSIGN_DIM                                                   $6, 'Nome'
          6        OP_DATA                                                      'dddd'
    7     7        FETCH_IS                                             ~8      '_GET'
          8        ISSET_ISEMPTY_DIM_OBJ                             0          ~8, 'CodigoUtente'
          9      > JMPZ                                                         ~9, ->16
    8    10    >   FETCH_R                          global              ~11     '_GET'
         11        FETCH_DIM_R                                          ~12     ~11, 'CodigoUtente'
         12        CONCAT                                               ~13     'CodigoUtente+%3D+%27', ~12
         13        CONCAT                                               ~14     ~13, '%27'
         14        ASSIGN_DIM                                                   !0
         15        OP_DATA                                                      ~14
   11    16    >   FETCH_IS                                             ~15     '_GET'
         17        ISSET_ISEMPTY_DIM_OBJ                             0          ~15, 'Nome'
         18      > JMPZ                                                         ~16, ->25
   12    19    >   FETCH_R                          global              ~18     '_GET'
         20        FETCH_DIM_R                                          ~19     ~18, 'Nome'
         21        CONCAT                                               ~20     'Nome+%3D+%27', ~19
         22        CONCAT                                               ~21     ~20, '%27'
         23        ASSIGN_DIM                                                   !0
         24        OP_DATA                                                      ~21
   16    25    >   ASSIGN                                                       !1, 'SELECT+CodigoUtente%2C+Nome%2C+DataNasc%2C+Sexo%2C+Estadocivil%2C+Nacionalidade%2C+Responsavel%2C+Parentesco%2C+Contato+FROM+centrodb.PsicUtentes'
   18    26        ISSET_ISEMPTY_CV                                     ~23     !0
         27        BOOL_NOT                                             ~24     ~23
         28      > JMPZ                                                         ~24, ->44
   19    29    >   COUNT                                                ~25     !0
         30        IS_SMALLER                                                   1, ~25
         31      > JMPZ                                                         ~26, ->35
         32    >   FRAMELESS_ICALL_2                implode             ~27     '+OR+', !0
         33        QM_ASSIGN                                            ~28     ~27
         34      > JMP                                                          ->39
         35    >   INIT_FCALL                                                   'end'
         36        SEND_REF                                                     !0
         37        DO_ICALL                                             $29     
         38        QM_ASSIGN                                            ~28     $29
         39    >   ASSIGN                                                       !2, ~28
   20    40        NOP                                                          
         41        FAST_CONCAT                                          ~31     !1, '+WHERE+'
         42        CONCAT                                               ~32     ~31, !2
         43        ASSIGN                                                       !1, ~32
   23    44    >   ECHO                                                         !1
   24    45      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
156.53 ms | 2019 KiB | 14 Q