3v4l.org

run code in 300+ PHP versions simultaneously
<?php $levar = true; function setsome($action) { $levar = $GLOBALS['levar']; if ($action == "toggle") { $levar = false; } else if ($action == "get") { return $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/1O7Ut
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>
   12     1        INIT_FCALL                                               'setsome'
          2        SEND_VAL                                                 'get'
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
   13     5        INIT_FCALL                                               'setsome'
          6        SEND_VAL                                                 'toggle'
          7        DO_FCALL                                      0          
   14     8        INIT_FCALL                                               'setsome'
          9        SEND_VAL                                                 'get'
         10        DO_FCALL                                      0  $4      
         11        ECHO                                                     $4
   15    12      > RETURN                                                   1

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

End of function setsome

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.34 ms | 1399 KiB | 16 Q