3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { private $bar; private $baz; function __construct($foo) { var_dump($foo); $this->bar = $foo; var_dump($this->bar); } public function bar($baz = null) { if(isset($this->bar['foo'][$baz])){ $this->baz = array ('foo' => $this->bar['foo'][$baz]); } } } $class = new foo("kekeke"); $class->bar(1); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/T8VRq
function name:  (null)
number of ops:  8
compiled vars:  !0 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'foo'
          1        SEND_VAL_EX                                              'kekeke'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   22     4        INIT_METHOD_CALL                                         !0, 'bar'
          5        SEND_VAL_EX                                              1
          6        DO_FCALL                                      0          
   24     7      > RETURN                                                   1

Class foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/T8VRq
function name:  __construct
number of ops:  11
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    9     4        ASSIGN_OBJ                                               'bar'
          5        OP_DATA                                                  !0
   10     6        INIT_FCALL                                               'var_dump'
          7        FETCH_OBJ_R                                      ~3      'bar'
          8        SEND_VAL                                                 ~3
          9        DO_ICALL                                                 
   11    10      > RETURN                                                   null

End of function __construct

Function bar:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/T8VRq
function name:  bar
number of ops:  12
compiled vars:  !0 = $baz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV_INIT                                        !0      null
   14     1        FETCH_OBJ_IS                                     ~1      'bar'
          2        FETCH_DIM_IS                                     ~2      ~1, 'foo'
          3        ISSET_ISEMPTY_DIM_OBJ                         0          ~2, !0
          4      > JMPZ                                                     ~3, ->11
   15     5    >   FETCH_OBJ_R                                      ~5      'bar'
          6        FETCH_DIM_R                                      ~6      ~5, 'foo'
          7        FETCH_DIM_R                                      ~7      ~6, !0
          8        INIT_ARRAY                                       ~8      ~7, 'foo'
          9        ASSIGN_OBJ                                               'baz'
         10        OP_DATA                                                  ~8
   17    11    > > RETURN                                                   null

End of function bar

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.33 ms | 1396 KiB | 15 Q