3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sql = array("inUserID" =>7250, "inCustID" =>15319, "btAll" => "'True'", "btPermPref" => "'True'", "inDisplay"=>0); function pram_alter($array, $key) { //echo implode(',', each($array)); reset($array); $pStr=null; $sqlStatment=null; $bound = count($array); $endSqlStatement = ";"; $count=0; while (list($key, $val) = each($array)) { if ($count < ($bound-1)){ $pStr=$pStr."$key = $val, "; } else { $pStr=$pStr."$key =$val;\" "; } $strproc='myProc'; $sqlStatment="exec " . $strproc . " " . $pStr; $count ++; } return $sqlStatment; } $temp=pram_alter($sql, 'pram_alter'); echo $temp; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PpfPX
function name:  (null)
number of ops:  8
compiled vars:  !0 = $sql, !1 = $temp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   29     1        INIT_FCALL                                               'pram_alter'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'pram_alter'
          4        DO_FCALL                                      0  $3      
          5        ASSIGN                                                   !1, $3
   30     6        ECHO                                                     !1
   31     7      > RETURN                                                   1

Function pram_alter:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 12
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 12
Branch analysis from position: 42
Branch analysis from position: 12
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 12
Branch analysis from position: 42
Branch analysis from position: 12
filename:       /in/PpfPX
function name:  pram_alter
number of ops:  44
compiled vars:  !0 = $array, !1 = $key, !2 = $pStr, !3 = $sqlStatment, !4 = $bound, !5 = $endSqlStatement, !6 = $count, !7 = $val, !8 = $strproc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        INIT_FCALL                                               'reset'
          3        SEND_REF                                                 !0
          4        DO_ICALL                                                 
    8     5        ASSIGN                                                   !2, null
    9     6        ASSIGN                                                   !3, null
   10     7        COUNT                                            ~12     !0
          8        ASSIGN                                                   !4, ~12
   11     9        ASSIGN                                                   !5, '%3B'
   12    10        ASSIGN                                                   !6, 0
   13    11      > JMP                                                      ->34
   15    12    >   SUB                                              ~16     !4, 1
         13        IS_SMALLER                                               !6, ~16
         14      > JMPZ                                                     ~17, ->22
   16    15    >   ROPE_INIT                                     4  ~19     !1
         16        ROPE_ADD                                      1  ~19     ~19, '+%3D+'
         17        ROPE_ADD                                      2  ~19     ~19, !7
         18        ROPE_END                                      3  ~18     ~19, '%2C+'
         19        CONCAT                                           ~21     !2, ~18
         20        ASSIGN                                                   !2, ~21
         21      > JMP                                                      ->28
   20    22    >   ROPE_INIT                                     4  ~24     !1
         23        ROPE_ADD                                      1  ~24     ~24, '+%3D'
         24        ROPE_ADD                                      2  ~24     ~24, !7
         25        ROPE_END                                      3  ~23     ~24, '%3B%22+'
         26        CONCAT                                           ~26     !2, ~23
         27        ASSIGN                                                   !2, ~26
   22    28    >   ASSIGN                                                   !8, 'myProc'
   23    29        CONCAT                                           ~29     'exec+', !8
         30        CONCAT                                           ~30     ~29, '+'
         31        CONCAT                                           ~31     ~30, !2
         32        ASSIGN                                                   !3, ~31
   24    33        PRE_INC                                                  !6
   13    34    >   INIT_FCALL_BY_NAME                                       'each'
         35        SEND_VAR_EX                                              !0
         36        DO_FCALL                                      0  $34     
         37        FETCH_LIST_R                                     $35     $34, 0
         38        ASSIGN                                                   !1, $35
         39        FETCH_LIST_R                                     $37     $34, 1
         40        ASSIGN                                                   !7, $37
         41      > JMPNZ                                                    $34, ->12
   26    42    > > RETURN                                                   !3
   27    43*     > RETURN                                                   null

End of function pram_alter

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
266.56 ms | 1402 KiB | 20 Q