3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(0); class a { function __static($n, $v = null) { if(!isset($$n)) { eval("static $n;"); } if(!is_null($v)) { $$n = $v; } else return $$n; } var $a = 4; function b() { echo __static('a'); } } a::__static('a'); a::__static('a', 5); a::b();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/earkj
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 0
          2        DO_ICALL                                                 
   25     3        INIT_STATIC_METHOD_CALL                                  'a', '__static'
          4        SEND_VAL                                                 'a'
          5        DO_FCALL                                      0          
   26     6        INIT_STATIC_METHOD_CALL                                  'a', '__static'
          7        SEND_VAL                                                 'a'
          8        SEND_VAL                                                 5
          9        DO_FCALL                                      0          
   27    10        INIT_STATIC_METHOD_CALL                                  'a', 'b'
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Class a:
Function __static:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/earkj
function name:  __static
number of ops:  18
compiled vars:  !0 = $n, !1 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
    9     2        ISSET_ISEMPTY_VAR                             4  ~2      !0
          3        BOOL_NOT                                         ~3      ~2
          4      > JMPZ                                                     ~3, ->9
   11     5    >   ROPE_INIT                                     3  ~5      'static+'
          6        ROPE_ADD                                      1  ~5      ~5, !0
          7        ROPE_END                                      2  ~4      ~5, '%3B'
          8        INCLUDE_OR_EVAL                                          ~4, EVAL
   13     9    >   TYPE_CHECK                                    2  ~8      !1
         10        BOOL_NOT                                         ~9      ~8
         11      > JMPZ                                                     ~9, ->15
   15    12    >   FETCH_W                      local               $10     !0
         13        ASSIGN                                                   $10, !1
         14      > JMP                                                      ->17
   17    15    >   FETCH_R                      local               ~12     !0
         16      > RETURN                                                   ~12
   18    17    > > RETURN                                                   null

End of function __static

Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/earkj
function name:  b
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL_BY_NAME                                       '__static'
          1        SEND_VAL_EX                                              'a'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   22     4      > RETURN                                                   null

End of function b

End of class a.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.71 ms | 1400 KiB | 15 Q