3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $bar; public function setBar( $value ) { $this->bar = $value; return $this; } public function getBar() { return $this->bar; } } $updates = array( 'series' => new Foo(), 'episode' => new Foo(), ); $updates['series']->setBar( 'foo_bar1' ); $updates['episode']->setBar( 'foo_bar2' ); var_dump( $updates );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8p74Y
function name:  (null)
number of ops:  19
compiled vars:  !0 = $updates
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        INIT_ARRAY                                       ~3      $1, 'series'
   22     3        NEW                                              $4      'Foo'
          4        DO_FCALL                                      0          
          5        ADD_ARRAY_ELEMENT                                ~3      $4, 'episode'
   20     6        ASSIGN                                                   !0, ~3
   25     7        FETCH_DIM_R                                      ~7      !0, 'series'
          8        INIT_METHOD_CALL                                         ~7, 'setBar'
          9        SEND_VAL_EX                                              'foo_bar1'
         10        DO_FCALL                                      0          
   26    11        FETCH_DIM_R                                      ~9      !0, 'episode'
         12        INIT_METHOD_CALL                                         ~9, 'setBar'
         13        SEND_VAL_EX                                              'foo_bar2'
         14        DO_FCALL                                      0          
   29    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

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

End of function setbar

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

End of function getbar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.86 ms | 1396 KiB | 15 Q