3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { private $bar; public function setBar($val) { $this->Bar = $val; // beware of capital 'B': silently defines a new prop "Bar" } } $o = new foo(); $o->setBar('a'); var_dump( $o);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d6MnA
function name:  (null)
number of ops:  10
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   14     3        INIT_METHOD_CALL                                         !0, 'setBar'
          4        SEND_VAL_EX                                              'a'
          5        DO_FCALL                                      0          
   15     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

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

End of function setbar

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.22 ms | 1394 KiB | 15 Q