3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public static function myStaticFunction() { echo "I'm declared static! Calling me statically works great.\n"; } public function myNonStaticFunction() { echo "I'm not static, if you try to call me statically you'll get a deprecated warning\n"; } } foo::myStaticFunction(); foo::myNonStaticFunction();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lXYsf
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_STATIC_METHOD_CALL                                  'foo', 'myStaticFunction'
          1        DO_FCALL                                      0          
   14     2        INIT_STATIC_METHOD_CALL                                  'foo', 'myNonStaticFunction'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Class foo:
Function mystaticfunction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lXYsf
function name:  myStaticFunction
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'I%27m+declared+static%21+Calling+me+statically+works+great.%0A'
    6     1      > RETURN                                                   null

End of function mystaticfunction

Function mynonstaticfunction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lXYsf
function name:  myNonStaticFunction
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     'I%27m+not+static%2C+if+you+try+to+call+me+statically+you%27ll+get+a+deprecated+warning%0A'
   10     1      > RETURN                                                   null

End of function mynonstaticfunction

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.87 ms | 1393 KiB | 13 Q