3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function __set($k,$v) { var_dump('here'); $this->$k = $v; } public function bar($v) { $this->__set('my', $v); } } class Cool extends Foo { protected $my = "nothing"; } $o = new Cool(); $o->bar("baz");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Uu673
function name:  (null)
number of ops:  7
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'Cool'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   25     3        INIT_METHOD_CALL                                         !0, 'bar'
          4        SEND_VAL_EX                                              'baz'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class Foo:
Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Uu673
function name:  __set
number of ops:  8
compiled vars:  !0 = $k, !1 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        INIT_FCALL                                               'var_dump'
          3        SEND_VAL                                                 'here'
          4        DO_ICALL                                                 
    9     5        ASSIGN_OBJ                                               !0
          6        OP_DATA                                                  !1
   10     7      > RETURN                                                   null

End of function __set

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Uu673
function name:  bar
number of ops:  6
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        INIT_METHOD_CALL                                         '__set'
          2        SEND_VAL_EX                                              'my'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
   15     5      > RETURN                                                   null

End of function bar

End of class Foo.

Class Cool:
Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Uu673
function name:  __set
number of ops:  8
compiled vars:  !0 = $k, !1 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        INIT_FCALL                                               'var_dump'
          3        SEND_VAL                                                 'here'
          4        DO_ICALL                                                 
    9     5        ASSIGN_OBJ                                               !0
          6        OP_DATA                                                  !1
   10     7      > RETURN                                                   null

End of function __set

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Uu673
function name:  bar
number of ops:  6
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        INIT_METHOD_CALL                                         '__set'
          2        SEND_VAL_EX                                              'my'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
   15     5      > RETURN                                                   null

End of function bar

End of class Cool.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.38 ms | 1400 KiB | 15 Q