3v4l.org

run code in 300+ 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 = 47
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 38
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
Branch analysis from position: 25
Branch analysis from position: 16
filename:       /in/phZGW
function name:  (null)
number of ops:  49
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, ->47
   19    29    >   COUNT                                            ~25     !0
         30        IS_SMALLER                                               1, ~25
         31      > JMPZ                                                     ~26, ->38
         32    >   INIT_FCALL                                               'implode'
         33        SEND_VAL                                                 '+OR+'
         34        SEND_VAR                                                 !0
         35        DO_ICALL                                         $27     
         36        QM_ASSIGN                                        ~28     $27
         37      > JMP                                                      ->42
         38    >   INIT_FCALL                                               'end'
         39        SEND_REF                                                 !0
         40        DO_ICALL                                         $29     
         41        QM_ASSIGN                                        ~28     $29
         42    >   ASSIGN                                                   !2, ~28
   20    43        NOP                                                      
         44        FAST_CONCAT                                      ~31     !1, '+WHERE+'
         45        CONCAT                                           ~32     ~31, !2
         46        ASSIGN                                                   !1, ~32
   23    47    >   ECHO                                                     !1
   24    48      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.99 ms | 1008 KiB | 15 Q