3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function __construct(private readonly stdClass $std) {} public function someAction() { $this->std = $this->modify($this->std); } private function modify(stdClass $std) { $std->foo = 'test'; return $std; } } $a = new A(new stdClass); $a->someAction();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BpX2t
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'A'
          1        NEW                                              $2      'stdClass'
          2        DO_FCALL                                      0          
          3        SEND_VAR_NO_REF_EX                                       $2
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
   21     6        INIT_METHOD_CALL                                         !0, 'someAction'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

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

End of function __construct

Function someaction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BpX2t
function name:  someAction
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_METHOD_CALL                                         'modify'
          1        CHECK_FUNC_ARG                                           
          2        FETCH_OBJ_FUNC_ARG                               $1      'std'
          3        SEND_FUNC_ARG                                            $1
          4        DO_FCALL                                      0  $2      
          5        ASSIGN_OBJ                                               'std'
          6        OP_DATA                                                  $2
   11     7      > RETURN                                                   null

End of function someaction

Function modify:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BpX2t
function name:  modify
number of ops:  5
compiled vars:  !0 = $std
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   15     1        ASSIGN_OBJ                                               !0, 'foo'
          2        OP_DATA                                                  'test'
   16     3      > RETURN                                                   !0
   17     4*     > RETURN                                                   null

End of function modify

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.11 ms | 1003 KiB | 13 Q