3v4l.org

run code in 300+ PHP versions simultaneously
<?php class T { private $a = array(); public function add($item) { $this->a[] = $item; } public function print() { echo join(', ', $this->a) . "\n"; } } $a = new T(); $a->add(1); $b = clone $a; $b->add(2); $a->print(); $b->print();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kcats
function name:  (null)
number of ops:  16
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $2      'T'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    5     3        INIT_METHOD_CALL                                         !0, 'add'
          4        SEND_VAL_EX                                              1
          5        DO_FCALL                                      0          
    6     6        CLONE                                            ~6      !0
          7        ASSIGN                                                   !1, ~6
    7     8        INIT_METHOD_CALL                                         !1, 'add'
          9        SEND_VAL_EX                                              2
         10        DO_FCALL                                      0          
    9    11        INIT_METHOD_CALL                                         !0, 'print'
         12        DO_FCALL                                      0          
   10    13        INIT_METHOD_CALL                                         !1, 'print'
         14        DO_FCALL                                      0          
         15      > RETURN                                                   1

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

End of function add

Function print:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kcats
function name:  print
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   INIT_FCALL                                               'join'
          1        SEND_VAL                                                 '%2C+'
          2        FETCH_OBJ_R                                      ~0      'a'
          3        SEND_VAL                                                 ~0
          4        DO_ICALL                                         $1      
          5        CONCAT                                           ~2      $1, '%0A'
          6        ECHO                                                     ~2
          7      > RETURN                                                   null

End of function print

End of class T.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.46 ms | 1396 KiB | 15 Q