3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $data; public function __construct() { $this->data = array( "Name" => "Fred", "Occupation" => "Flintstone Mason" ); } public function print_data() { foreach ($this->data as $k => $v) { echo "k=".$k." v=".$v."\n"; } } public function get_data() { return $this->data; } } $a = new A(); $a->print_data(); $ar = $a->get_data(); $ar['Age'] = 50; $a->print_data(); echo $ar['Age'];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c6L48
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a, !1 = $ar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   25     3        INIT_METHOD_CALL                                         !0, 'print_data'
          4        DO_FCALL                                      0          
   26     5        INIT_METHOD_CALL                                         !0, 'get_data'
          6        DO_FCALL                                      0  $6      
          7        ASSIGN                                                   !1, $6
   27     8        ASSIGN_DIM                                               !1, 'Age'
          9        OP_DATA                                                  50
   28    10        INIT_METHOD_CALL                                         !0, 'print_data'
         11        DO_FCALL                                      0          
   29    12        FETCH_DIM_R                                      ~10     !1, 'Age'
         13        ECHO                                                     ~10
         14      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c6L48
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN_OBJ                                               'data'
    8     1        OP_DATA                                                  <array>
   11     2      > RETURN                                                   null

End of function __construct

Function print_data:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 10
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/c6L48
function name:  print_data
number of ops:  12
compiled vars:  !0 = $v, !1 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_OBJ_R                                      ~2      'data'
          1      > FE_RESET_R                                       $3      ~2, ->10
          2    > > FE_FETCH_R                                       ~4      $3, !0, ->10
          3    >   ASSIGN                                                   !1, ~4
   15     4        CONCAT                                           ~6      'k%3D', !1
          5        CONCAT                                           ~7      ~6, '+v%3D'
          6        CONCAT                                           ~8      ~7, !0
          7        CONCAT                                           ~9      ~8, '%0A'
          8        ECHO                                                     ~9
   14     9      > JMP                                                      ->2
         10    >   FE_FREE                                                  $3
   17    11      > RETURN                                                   null

End of function print_data

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

End of function get_data

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.28 ms | 1399 KiB | 13 Q