3v4l.org

run code in 300+ PHP versions simultaneously
<?php function draw_card($initial = 0) { $GLOBALS['draw_card_total'] = ( isset($GLOBALS['draw_card_total']) ? $GLOBALS['draw_card_total']+1 : $initial ); return $GLOBALS['draw_card_total']; } // optionally set your start value echo draw_card(1); echo draw_card();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pinSi
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'draw_card'
          1        SEND_VAL                                                 1
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   11     4        INIT_FCALL                                               'draw_card'
          5        DO_FCALL                                      0  $1      
          6        ECHO                                                     $1
          7      > RETURN                                                   1

Function draw_card:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pinSi
function name:  draw_card
number of ops:  13
compiled vars:  !0 = $initial
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV_INIT                                        !0      0
    4     1        ISSET_ISEMPTY_VAR                             2          'draw_card_total'
          2      > JMPZ                                                     ~2, ->7
          3    >   FETCH_R                      global              ~3      'draw_card_total'
          4        ADD                                              ~4      ~3, 1
          5        QM_ASSIGN                                        ~5      ~4
          6      > JMP                                                      ->8
          7    >   QM_ASSIGN                                        ~5      !0
    3     8    >   FETCH_W                      global              $1      'draw_card_total'
          9        ASSIGN                                                   $1, ~5
    6    10        FETCH_R                      global              ~7      'draw_card_total'
         11      > RETURN                                                   ~7
    7    12*     > RETURN                                                   null

End of function draw_card

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.23 ms | 1003 KiB | 15 Q