3v4l.org

run code in 300+ PHP versions simultaneously
<?php class c1 { public static function f1() { return "hello"; } public static $a = 10; public function f2() { echo $this->f1(); //prints "hello" echo $this->a; //ERROR:Undefined property: c1::$a in C:\wamp\www\class_in_php\example5.php on line 14 } } $obj1 = new c1; $obj1->f2();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sHZWZ
function name:  (null)
number of ops:  6
compiled vars:  !0 = $obj1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'c1'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3        INIT_METHOD_CALL                                         !0, 'f2'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class c1:
Function f1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sHZWZ
function name:  f1
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   'hello'
    8     1*     > RETURN                                                   null

End of function f1

Function f2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sHZWZ
function name:  f2
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_METHOD_CALL                                         'f1'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
   15     3        FETCH_OBJ_R                                      ~1      'a'
          4        ECHO                                                     ~1
   16     5      > RETURN                                                   null

End of function f2

End of class c1.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.12 ms | 1394 KiB | 13 Q