3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Clazz { private $data; public function __construct($data) { $this->data = $data; } public function getData() { return $this->data; } } $arr = new \ArrayObject(array(1,2)); $clazz = new Clazz($arr); var_dump($clazz->getData()); $arr->append(3); var_dump($clazz->getData());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EM229
function name:  (null)
number of ops:  22
compiled vars:  !0 = $arr, !1 = $clazz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $2      'ArrayObject'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   20     4        NEW                                              $5      'Clazz'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   22     8        INIT_FCALL                                               'var_dump'
          9        INIT_METHOD_CALL                                         !1, 'getData'
         10        DO_FCALL                                      0  $8      
         11        SEND_VAR                                                 $8
         12        DO_ICALL                                                 
   24    13        INIT_METHOD_CALL                                         !0, 'append'
         14        SEND_VAL_EX                                              3
         15        DO_FCALL                                      0          
   26    16        INIT_FCALL                                               'var_dump'
         17        INIT_METHOD_CALL                                         !1, 'getData'
         18        DO_FCALL                                      0  $11     
         19        SEND_VAR                                                 $11
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

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

End of function __construct

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

End of function getdata

End of class Clazz.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.52 ms | 1396 KiB | 15 Q