3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Everything you enter here will be executed by our servers. Try it! function get_in_sql($getdata){ if(is_array($getdata)) { $string = ""; if (count($getdata) == 1) { $string = $getdata[0]; } else { foreach ($getdata as $value) { if ($value === end($getdata)) { $string .= $value; } else { $string .= $value . ","; } } } return $string; } return $getdata; } $array = array('0'=>1); echo get_in_sql($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C3Zeo
function name:  (null)
number of ops:  6
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   ASSIGN                                                   !0, <array>
   26     1        INIT_FCALL                                               'get_in_sql'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
          5      > RETURN                                                   1

Function get_in_sql:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 24
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 22
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 22
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C3Zeo
function name:  get_in_sql
number of ops:  26
compiled vars:  !0 = $getdata, !1 = $string, !2 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        TYPE_CHECK                                  128          !0
          2      > JMPZ                                                     ~3, ->24
    5     3    >   ASSIGN                                                   !1, ''
    6     4        COUNT                                            ~5      !0
          5        IS_EQUAL                                                 ~5, 1
          6      > JMPZ                                                     ~6, ->10
    7     7    >   FETCH_DIM_R                                      ~7      !0, 0
          8        ASSIGN                                                   !1, ~7
          9      > JMP                                                      ->23
    9    10    > > FE_RESET_R                                       $9      !0, ->22
         11    > > FE_FETCH_R                                               $9, !2, ->22
   10    12    >   INIT_FCALL                                               'end'
         13        SEND_REF                                                 !0
         14        DO_ICALL                                         $10     
         15        IS_IDENTICAL                                             !2, $10
         16      > JMPZ                                                     ~11, ->19
   11    17    >   ASSIGN_OP                                     8          !1, !2
         18      > JMP                                                      ->21
   13    19    >   CONCAT                                           ~13     !2, '%2C'
         20        ASSIGN_OP                                     8          !1, ~13
    9    21    > > JMP                                                      ->11
         22    >   FE_FREE                                                  $9
   18    23    > > RETURN                                                   !1
   21    24    > > RETURN                                                   !0
   22    25*     > RETURN                                                   null

End of function get_in_sql

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.25 ms | 1403 KiB | 16 Q