3v4l.org

run code in 300+ PHP versions simultaneously
<?php function setsome($action) { $levar = true; 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/VOe7K
function name:  (null)
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'setsome'
          1        SEND_VAL                                                 'get'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   12     4        INIT_FCALL                                               'setsome'
          5        SEND_VAL                                                 'toggle'
          6        DO_FCALL                                      0          
   13     7        INIT_FCALL                                               'setsome'
          8        SEND_VAL                                                 'get'
          9        DO_FCALL                                      0  $2      
         10        ECHO                                                     $2
   14    11      > RETURN                                                   1

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

End of function setsome

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.01 ms | 1398 KiB | 16 Q