3v4l.org

run code in 300+ PHP versions simultaneously
<?php class testStatic { var $myvar = 'blah'; function give() { if ( isset($this) && (is_null($this)) ) { die('instance method cannot be called statically'); } return self::$myvar; } } echo testStatic::give();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bHtnI
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_STATIC_METHOD_CALL                                  'testStatic', 'give'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
          3      > RETURN                                                   1

Class testStatic:
Function give:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 2, Position 2 = 5
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/bHtnI
function name:  give
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ISSET_ISEMPTY_THIS                               ~0      
          1      > JMPZ_EX                                          ~0      ~0, ->5
          2    >   FETCH_THIS                                       ~1      
          3        TYPE_CHECK                                    2  ~2      ~1
          4        BOOL                                             ~0      ~2
          5    > > JMPZ                                                     ~0, ->7
   10     6    > > EXIT                                                     'instance+method+cannot+be+called+statically'
   12     7    >   FETCH_STATIC_PROP_R          unknown             ~3      'myvar'
          8      > RETURN                                                   ~3
   13     9*     > RETURN                                                   null

End of function give

End of class testStatic.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.91 ms | 1394 KiB | 13 Q