3v4l.org

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

Function comment_retrieve:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 19
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 25
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 25
Branch analysis from position: 22
Branch analysis from position: 25
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 19
Branch analysis from position: 15
Branch analysis from position: 19
filename:       /in/Dd1HI
function name:  comment_retrieve
number of ops:  32
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
-------------------------------------------------------------------------------------
    2     0  E >   RECV_INIT                                        !0      0
          1        RECV_INIT                                        !1      null
          2        RECV_INIT                                        !2      null
    4     3      > JMPZ                                                     !2, ->13
    5     4    > > JMPZ                                                     !1, ->9
    6     5    >   CONCAT                                           ~7      '+AND+fc_forfile%3D%27', !2
          6        CONCAT                                           ~8      ~7, '%27'
          7        ASSIGN                                                   !3, ~8
          8      > JMP                                                      ->12
    8     9    >   CONCAT                                           ~10     '+WHERE+fc_forfile%3D%27', !2
         10        CONCAT                                           ~11     ~10, '%27'
         11        ASSIGN                                                   !3, ~11
         12    > > JMP                                                      ->14
   11    13    >   ASSIGN                                                   !3, ''
   14    14    > > JMPZ                                                     !1, ->19
   15    15    >   CONCAT                                           ~14     '+WHERE+fc_byuser%3D%27', !1
         16        CONCAT                                           ~15     ~14, '%27'
         17        ASSIGN                                                   !4, ~15
         18      > JMP                                                      ->20
   17    19    >   ASSIGN                                                   !4, ''
   20    20    >   IS_SMALLER                                               0, !0
         21      > JMPZ                                                     ~18, ->25
   21    22    >   CONCAT                                           ~19     '+LIMIT+', !0
         23        ASSIGN                                                   !5, ~19
         24      > JMP                                                      ->26
   23    25    >   ASSIGN                                                   !5, ''
   27    26    >   CONCAT                                           ~22     'SELECT+%2A+FROM+file_comments', !4
         27        CONCAT                                           ~23     ~22, !3
         28        CONCAT                                           ~24     ~23, !5
         29        ASSIGN                                                   !6, ~24
   28    30      > RETURN                                                   !6
   29    31*     > RETURN                                                   null

End of function comment_retrieve

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.52 ms | 1402 KiB | 14 Q