3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static $x; public static function SetValue() { Foo::$x = 10; } public static function ShowValue() { echo Foo::$x."\n"; } } Foo::SetValue(); Foo::ShowValue(); // O mejor aun class Bar { public static $x; public static function SetValue() { self::$x = 10; } public static function ShowValue() { echo self::$x."\n"; } } Bar::SetValue(); Bar::ShowValue();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7lFqr
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_STATIC_METHOD_CALL                                  'Foo', 'SetValue'
          1        DO_FCALL                                      0          
   19     2        INIT_STATIC_METHOD_CALL                                  'Foo', 'ShowValue'
          3        DO_FCALL                                      0          
   40     4        INIT_STATIC_METHOD_CALL                                  'Bar', 'SetValue'
          5        DO_FCALL                                      0          
   41     6        INIT_STATIC_METHOD_CALL                                  'Bar', 'ShowValue'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Class Foo:
Function setvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7lFqr
function name:  SetValue
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN_STATIC_PROP                                       'x', 'Foo'
          1        OP_DATA                                                  10
   10     2      > RETURN                                                   null

End of function setvalue

Function showvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7lFqr
function name:  ShowValue
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'x'
          1        CONCAT                                           ~1      ~0, '%0A'
          2        ECHO                                                     ~1
   15     3      > RETURN                                                   null

End of function showvalue

End of class Foo.

Class Bar:
Function setvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7lFqr
function name:  SetValue
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   ASSIGN_STATIC_PROP                                       'x'
          1        OP_DATA                                                  10
   32     2      > RETURN                                                   null

End of function setvalue

Function showvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7lFqr
function name:  ShowValue
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'x'
          1        CONCAT                                           ~1      ~0, '%0A'
          2        ECHO                                                     ~1
   37     3      > RETURN                                                   null

End of function showvalue

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.93 ms | 942 KiB | 14 Q