3v4l.org

run code in 300+ PHP versions simultaneously
<?php function mysqli_real_escape_string($a) { return addslashes($a); } function callStoredProc( $storedProc ) { $args = func_get_args(); $storedProc = array_shift( $args ); array_walk( $args, function( &$item, $key ) { $item = "'" . addslashes( $arg ) . "'"; }); $procCall = sprintf( 'call %s( %s )', $storedProc, implode( ',', $args ) ); var_dump( $procCall ); } callStoredProc( 'something', 1, 'a', 'b\'' );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z9XQX
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'callstoredproc'
          1        SEND_VAL                                                 'something'
          2        SEND_VAL                                                 1
          3        SEND_VAL                                                 'a'
          4        SEND_VAL                                                 'b%27'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function mysqli_real_escape_string:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z9XQX
function name:  mysqli_real_escape_string
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'addslashes'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
          5*     > RETURN                                                   null

End of function mysqli_real_escape_string

Function callstoredproc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z9XQX
function name:  callStoredProc
number of ops:  26
compiled vars:  !0 = $storedProc, !1 = $args, !2 = $procCall
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        FUNC_GET_ARGS                                    ~3      
          2        ASSIGN                                                   !1, ~3
    8     3        INIT_FCALL                                               'array_shift'
          4        SEND_REF                                                 !1
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !0, $5
    9     7        INIT_FCALL                                               'array_walk'
          8        SEND_REF                                                 !1
          9        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FZ9XQX%3A9%240'
   11    10        SEND_VAL                                                 ~7
         11        DO_ICALL                                                 
   13    12        INIT_FCALL                                               'sprintf'
         13        SEND_VAL                                                 'call+%25s%28+%25s+%29'
         14        SEND_VAR                                                 !0
         15        INIT_FCALL                                               'implode'
         16        SEND_VAL                                                 '%2C'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $9      
         19        SEND_VAR                                                 $9
         20        DO_ICALL                                         $10     
         21        ASSIGN                                                   !2, $10
   14    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                                 
   15    25      > RETURN                                                   null

End of function callstoredproc

Function %00%7Bclosure%7D%2Fin%2FZ9XQX%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z9XQX
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $item, !1 = $key, !2 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        INIT_FCALL                                               'addslashes'
          3        SEND_VAR                                                 !2
          4        DO_ICALL                                         $3      
          5        CONCAT                                           ~4      '%27', $3
          6        CONCAT                                           ~5      ~4, '%27'
          7        ASSIGN                                                   !0, ~5
   11     8      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FZ9XQX%3A9%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.84 ms | 1407 KiB | 26 Q