3v4l.org

run code in 500+ PHP versions simultaneously
<?php class P { protected static $v = 1; public function output() { echo "P: " . self::$v . "\n"; } } class C extends P { public function test(P $i) { return $i->v; } } class C2 extends P { protected static $v = 2; public function output() { echo "C2: " . self::$v . "\n"; parent::output(); } } $c = new C; $c2 = new C2; $c2->output();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0SRWb
function name:  (null)
number of ops:  9
compiled vars:  !0 = $c, !1 = $c2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   25     0  E >   NEW                                                  $2      'C'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
   26     3        NEW                                                  $5      'C2'
          4        DO_FCALL                                          0          
          5        ASSIGN                                                       !1, $5
   28     6        INIT_METHOD_CALL                                             !1, 'output'
          7        DO_FCALL                                          0          
          8      > RETURN                                                       1

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

End of function output

End of class P.

Class C:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0SRWb
function name:  test
number of ops:  4
compiled vars:  !0 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   RECV                                                 !0      
   12     1        FETCH_OBJ_R                                          ~1      !0, 'v'
          2      > RETURN                                                       ~1
   13     3*     > RETURN                                                       null

End of function test

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

End of function output

End of class C.

Class C2:
Function output:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0SRWb
function name:  output
number of ops:  7
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   FETCH_STATIC_PROP_R              unknown             ~0      'v'
          1        CONCAT                                               ~1      'C2%3A+', ~0
          2        CONCAT                                               ~2      ~1, '%0A'
          3        ECHO                                                         ~2
   21     4        INIT_STATIC_METHOD_CALL                                      'output'
          5        DO_FCALL                                          0          
   22     6      > RETURN                                                       null

End of function output

End of class C2.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
153.93 ms | 1212 KiB | 13 Q