3v4l.org

run code in 300+ PHP versions simultaneously
<?php $levar = true; function setsome($action) { if ($action == "toggle") { $GLOBALS['levar'] = false; } else if ($action == "get") { return $GLOBALS['levar']; } } echo setsome('get'); setsome('toggle'); echo setsome('get'); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tiift
function name:  (null)
number of ops:  13
compiled vars:  !0 = $levar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <true>
   11     1        INIT_FCALL                                               'setsome'
          2        SEND_VAL                                                 'get'
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
   12     5        INIT_FCALL                                               'setsome'
          6        SEND_VAL                                                 'toggle'
          7        DO_FCALL                                      0          
   13     8        INIT_FCALL                                               'setsome'
          9        SEND_VAL                                                 'get'
         10        DO_FCALL                                      0  $4      
         11        ECHO                                                     $4
   14    12      > RETURN                                                   1

Function setsome:
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 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/tiift
function name:  setsome
number of ops:  13
compiled vars:  !0 = $action
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        IS_EQUAL                                                 !0, 'toggle'
          2      > JMPZ                                                     ~1, ->7
    5     3    >   FETCH_W                      global              $2      'GLOBALS'
          4        ASSIGN_DIM                                               $2, 'levar'
          5        OP_DATA                                                  <false>
          6      > JMP                                                      ->12
    6     7    >   IS_EQUAL                                                 !0, 'get'
          8      > JMPZ                                                     ~4, ->12
    7     9    >   FETCH_R                      global              ~5      'GLOBALS'
         10        FETCH_DIM_R                                      ~6      ~5, 'levar'
         11      > RETURN                                                   ~6
    9    12    > > RETURN                                                   null

End of function setsome

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.04 ms | 1399 KiB | 16 Q