3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @link http://stackoverflow.com/a/24059368/367456 */ class c1 { public static function f1() { return "hello"; } public static $a = 10; public function f2() { echo $this->f1(); // prints "hello" echo $this->a; // Strict Standards: Accessing static property c1::$a as non static echo $this::$a; // prints "10" (PHP <= 5.2.17: Parse error) } } $obj1 = new c1; $obj1->f2();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cBXET
function name:  (null)
number of ops:  6
compiled vars:  !0 = $obj1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'c1'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   23     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/cBXET
function name:  f1
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E > > RETURN                                                   'hello'
   10     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/cBXET
function name:  f2
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_METHOD_CALL                                         'f1'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
   17     3        FETCH_OBJ_R                                      ~1      'a'
          4        ECHO                                                     ~1
   18     5        FETCH_THIS                                       ~2      
          6        FETCH_CLASS                                   0  $3      ~2
          7        FETCH_STATIC_PROP_R          unknown             ~4      'a'
          8        ECHO                                                     ~4
   19     9      > RETURN                                                   null

End of function f2

End of class c1.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.63 ms | 1385 KiB | 13 Q