3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function _static($m,$n, $v = null) { static $vars = array(); switch($m) { case 'g': return $vars[$n]; break; case 's': $vars[$n]=$v; break; case 'i': isset($vars[$n]); break; case 'u': unset($vars[$n]); break; } } function _static_g($n) { $self = __CLASS__; return $self::_static('g',$n); } function _static_s($n,$v) { $self = __CLASS__; return $self::_static('s',$n,$v); } function _static_i($n) { $self = __CLASS__; return $self::_static('i',$n); } function _static_u($n) { $self = __CLASS__; return $self::_static('u',$n); } } A::_static_s('q', 5); echo A::_static_g('q');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/274Wb
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   46     0  E >   INIT_STATIC_METHOD_CALL                                  'A', '_static_s'
          1        SEND_VAL                                                 'q'
          2        SEND_VAL                                                 5
          3        DO_FCALL                                      0          
   47     4        INIT_STATIC_METHOD_CALL                                  'A', '_static_g'
          5        SEND_VAL                                                 'q'
          6        DO_FCALL                                      0  $1      
          7        ECHO                                                     $1
          8      > RETURN                                                   1

Class A:
Function _static:
Finding entry points
Branch analysis from position: 0
6 jumps found. (Code = 188) Position 1 = 14, Position 2 = 17, Position 3 = 20, Position 4 = 23, Position 5 = 25, Position 6 = 5
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 25
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 17
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 20
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 23
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 23
Branch analysis from position: 20
Branch analysis from position: 17
Branch analysis from position: 14
filename:       /in/274Wb
function name:  _static
number of ops:  26
compiled vars:  !0 = $m, !1 = $n, !2 = $v, !3 = $vars
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      null
    7     3        BIND_STATIC                                              !3
    8     4      > SWITCH_STRING                                            !0, [ 'g':->14, 's':->17, 'i':->20, 'u':->23, ], ->25
   10     5    >   IS_EQUAL                                                 !0, 'g'
          6      > JMPNZ                                                    ~4, ->14
   13     7    >   IS_EQUAL                                                 !0, 's'
          8      > JMPNZ                                                    ~4, ->17
   16     9    >   IS_EQUAL                                                 !0, 'i'
         10      > JMPNZ                                                    ~4, ->20
   19    11    >   IS_EQUAL                                                 !0, 'u'
         12      > JMPNZ                                                    ~4, ->23
         13    > > JMP                                                      ->25
   11    14    >   FETCH_DIM_R                                      ~5      !3, !1
         15      > RETURN                                                   ~5
   12    16*       JMP                                                      ->25
   14    17    >   ASSIGN_DIM                                               !3, !1
         18        OP_DATA                                                  !2
   15    19      > JMP                                                      ->25
   17    20    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~7      !3, !1
         21        FREE                                                     ~7
   18    22      > JMP                                                      ->25
   20    23    >   UNSET_DIM                                                !3, !1
   21    24      > JMP                                                      ->25
   23    25    > > RETURN                                                   null

End of function _static

Function _static_g:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/274Wb
function name:  _static_g
number of ops:  9
compiled vars:  !0 = $n, !1 = $self
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
   26     1        ASSIGN                                                   !1, 'A'
   27     2        FETCH_CLASS                                   0  $3      !1
          3        INIT_STATIC_METHOD_CALL                                  $3, '_static'
          4        SEND_VAL_EX                                              'g'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0  $4      
          7      > RETURN                                                   $4
   28     8*     > RETURN                                                   null

End of function _static_g

Function _static_s:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/274Wb
function name:  _static_s
number of ops:  11
compiled vars:  !0 = $n, !1 = $v, !2 = $self
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   31     2        ASSIGN                                                   !2, 'A'
   32     3        FETCH_CLASS                                   0  $4      !2
          4        INIT_STATIC_METHOD_CALL                                  $4, '_static'
          5        SEND_VAL_EX                                              's'
          6        SEND_VAR_EX                                              !0
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0  $5      
          9      > RETURN                                                   $5
   33    10*     > RETURN                                                   null

End of function _static_s

Function _static_i:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/274Wb
function name:  _static_i
number of ops:  9
compiled vars:  !0 = $n, !1 = $self
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   RECV                                             !0      
   36     1        ASSIGN                                                   !1, 'A'
   37     2        FETCH_CLASS                                   0  $3      !1
          3        INIT_STATIC_METHOD_CALL                                  $3, '_static'
          4        SEND_VAL_EX                                              'i'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0  $4      
          7      > RETURN                                                   $4
   38     8*     > RETURN                                                   null

End of function _static_i

Function _static_u:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/274Wb
function name:  _static_u
number of ops:  9
compiled vars:  !0 = $n, !1 = $self
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   RECV                                             !0      
   41     1        ASSIGN                                                   !1, 'A'
   42     2        FETCH_CLASS                                   0  $3      !1
          3        INIT_STATIC_METHOD_CALL                                  $3, '_static'
          4        SEND_VAL_EX                                              'u'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0  $4      
          7      > RETURN                                                   $4
   43     8*     > RETURN                                                   null

End of function _static_u

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.65 ms | 1403 KiB | 13 Q