3v4l.org

run code in 300+ PHP versions simultaneously
<?php function comment_retrieve($amount = 0, $username = null, $file = null) { if ($file) { if ($amount > 0) { $querystring_file = ' AND `c_username` = ' . $username; } else { $querystring_file = ' WHERE `c_username` = ' . $username; } } else { $querystring_file = ''; } if ($username) { $querystring_username = ' WHERE `c_username` = ' . $username; } else { $querystring_username = ''; } if ($amount > 0) { $querystring_amount = ' LIMIT ' . $amount; } else { $querystring_amount = ''; } // query $querystring = "SELECT * FROM file_comments" . $querystring_username . $querystring_amount; return $querystring; } echo comment_retrieve(7,bob,HJFG);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6L94V
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   INIT_FCALL                                               'comment_retrieve'
          1        SEND_VAL                                                 7
          2        FETCH_CONSTANT                                   ~0      'bob'
          3        SEND_VAL                                                 ~0
          4        FETCH_CONSTANT                                   ~1      'HJFG'
          5        SEND_VAL                                                 ~1
          6        DO_FCALL                                      0  $2      
          7        ECHO                                                     $2
          8      > RETURN                                                   1

Function comment_retrieve:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 23
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 23
Branch analysis from position: 20
Branch analysis from position: 23
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
Branch analysis from position: 17
filename:       /in/6L94V
function name:  comment_retrieve
number of ops:  29
compiled vars:  !0 = $amount, !1 = $username, !2 = $file, !3 = $querystring_file, !4 = $querystring_username, !5 = $querystring_amount, !6 = $querystring
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                        !0      0
          1        RECV_INIT                                        !1      null
          2        RECV_INIT                                        !2      null
    5     3      > JMPZ                                                     !2, ->12
    6     4    >   IS_SMALLER                                               0, !0
          5      > JMPZ                                                     ~7, ->9
    7     6    >   CONCAT                                           ~8      '+AND+%60c_username%60+%3D+', !1
          7        ASSIGN                                                   !3, ~8
          8      > JMP                                                      ->11
    9     9    >   CONCAT                                           ~10     '+WHERE+%60c_username%60+%3D+', !1
         10        ASSIGN                                                   !3, ~10
         11    > > JMP                                                      ->13
   12    12    >   ASSIGN                                                   !3, ''
   15    13    > > JMPZ                                                     !1, ->17
   16    14    >   CONCAT                                           ~13     '+WHERE+%60c_username%60+%3D+', !1
         15        ASSIGN                                                   !4, ~13
         16      > JMP                                                      ->18
   18    17    >   ASSIGN                                                   !4, ''
   21    18    >   IS_SMALLER                                               0, !0
         19      > JMPZ                                                     ~16, ->23
   22    20    >   CONCAT                                           ~17     '+LIMIT+', !0
         21        ASSIGN                                                   !5, ~17
         22      > JMP                                                      ->24
   24    23    >   ASSIGN                                                   !5, ''
   28    24    >   CONCAT                                           ~20     'SELECT+%2A+FROM+file_comments', !4
         25        CONCAT                                           ~21     ~20, !5
         26        ASSIGN                                                   !6, ~21
   30    27      > RETURN                                                   !6
   32    28*     > RETURN                                                   null

End of function comment_retrieve

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.2 ms | 1394 KiB | 14 Q