3v4l.org

run code in 300+ PHP versions simultaneously
<?php class testStatic { var $myvar = 'blah'; function give() { if (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/Wisdk
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     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 = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Wisdk
function name:  give
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_THIS                                       ~0      
          1        TYPE_CHECK                                    2          ~0
          2      > JMPZ                                                     ~1, ->4
    9     3    > > EXIT                                                     'instance+method+cannot+be+called+statically'
   11     4    >   FETCH_STATIC_PROP_R          unknown             ~2      'myvar'
          5      > RETURN                                                   ~2
   12     6*     > RETURN                                                   null

End of function give

End of class testStatic.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.73 ms | 1393 KiB | 13 Q