3v4l.org

run code in 300+ PHP versions simultaneously
<?php $levar = true; function setsome($action) { $_GLOBAL['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/kcii9
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 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/kcii9
function name:  setsome
number of ops:  11
compiled vars:  !0 = $action, !1 = $_GLOBAL, !2 = $levar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        FETCH_DIM_R                                      ~3      !1, 'levar'
          2        FREE                                                     ~3
    5     3        IS_EQUAL                                                 !0, 'toggle'
          4      > JMPZ                                                     ~4, ->7
    6     5    >   ASSIGN                                                   !2, <false>
          6      > JMP                                                      ->10
    7     7    >   IS_EQUAL                                                 !0, 'get'
          8      > JMPZ                                                     ~6, ->10
    8     9    > > RETURN                                                   !2
   10    10    > > RETURN                                                   null

End of function setsome

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.89 ms | 1399 KiB | 16 Q