3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $_name = ''; public function set( $name ) { $this->_name = $name; } public function get() { return $this->_name; } } function moo( Foo $obj ) { $copy = clone $obj; $copy->set( __FUNCTION__ ); return true; } $object = new Foo(); $object->set( 'first' ); moo( $object ); echo $object->get();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aINMI
function name:  (null)
number of ops:  13
compiled vars:  !0 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   23     3        INIT_METHOD_CALL                                         !0, 'set'
          4        SEND_VAL_EX                                              'first'
          5        DO_FCALL                                      0          
   24     6        INIT_FCALL                                               'moo'
          7        SEND_VAR                                                 !0
          8        DO_FCALL                                      0          
   25     9        INIT_METHOD_CALL                                         !0, 'get'
         10        DO_FCALL                                      0  $6      
         11        ECHO                                                     $6
         12      > RETURN                                                   1

Function moo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aINMI
function name:  moo
number of ops:  8
compiled vars:  !0 = $obj, !1 = $copy
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   17     1        CLONE                                            ~2      !0
          2        ASSIGN                                                   !1, ~2
   18     3        INIT_METHOD_CALL                                         !1, 'set'
          4        SEND_VAL_EX                                              'moo'
          5        DO_FCALL                                      0          
   19     6      > RETURN                                                   <true>
   20     7*     > RETURN                                                   null

End of function moo

Class Foo:
Function set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aINMI
function name:  set
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ASSIGN_OBJ                                               '_name'
          2        OP_DATA                                                  !0
    8     3      > RETURN                                                   null

End of function set

Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aINMI
function name:  get
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_OBJ_R                                      ~0      '_name'
          1      > RETURN                                                   ~0
   12     2*     > RETURN                                                   null

End of function get

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.51 ms | 1399 KiB | 14 Q