3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getTopNews($number = 5,$reset =false) { static $cache = false; //cache reset if ($reset) $cache = false; //cache get if ($cache){ echo 'cache '; return $cache; } else { echo 'query '; /*$res = db_query("SELECT id,header,content FROM `news` ORDER BY id DESC LIMIT %d",(int)$number); while($row = db_fetch_array($res)){ $out[] = $row; } */ $out ='db'; //cache set $cache = $out; } return $out; } getTopNews(); echo '<hr>'; getTopNews();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YLmlB
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   INIT_FCALL                                               'gettopnews'
          1        DO_FCALL                                      0          
   35     2        ECHO                                                     '%3Chr%3E'
   36     3        INIT_FCALL                                               'gettopnews'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function gettopnews:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
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 = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/YLmlB
function name:  getTopNews
number of ops:  14
compiled vars:  !0 = $number, !1 = $reset, !2 = $cache, !3 = $out
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      5
          1        RECV_INIT                                        !1      <false>
    6     2        BIND_STATIC                                              !2
    9     3      > JMPZ                                                     !1, ->5
   10     4    >   ASSIGN                                                   !2, <false>
   13     5    > > JMPZ                                                     !2, ->9
   14     6    >   ECHO                                                     'cache+'
   15     7      > RETURN                                                   !2
          8*       JMP                                                      ->12
   18     9    >   ECHO                                                     'query+'
   24    10        ASSIGN                                                   !3, 'db'
   26    11        ASSIGN                                                   !2, !3
   30    12      > RETURN                                                   !3
   31    13*     > RETURN                                                   null

End of function gettopnews

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.45 ms | 1389 KiB | 15 Q