3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $someVar; private $anotherVar; public function setSomeVar($val) { $this->someVar = $val; } public function getSomeVar() { return $this->someVar; } public function setAnotherVar($val) { $this->anotherVar = $val; } public function getAnotherVar() { return $this->anotherVar; } } $foo = new Foo(); $foo->setSomeVar(12); $foo->setAnotherVar("Hello World"); $fooAsArray = (array) $foo; var_dump($fooAsArray); foreach($fooAsArray as $x) { var_dump($x); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 20
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/0MMXM
function name:  (null)
number of ops:  22
compiled vars:  !0 = $foo, !1 = $fooAsArray, !2 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   NEW                                              $3      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   30     3        INIT_METHOD_CALL                                         !0, 'setSomeVar'
          4        SEND_VAL_EX                                              12
          5        DO_FCALL                                      0          
   31     6        INIT_METHOD_CALL                                         !0, 'setAnotherVar'
          7        SEND_VAL_EX                                              'Hello+World'
          8        DO_FCALL                                      0          
   33     9        CAST                                          7  ~8      !0
         10        ASSIGN                                                   !1, ~8
   34    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
   36    14      > FE_RESET_R                                       $11     !1, ->20
         15    > > FE_FETCH_R                                               $11, !2, ->20
   38    16    >   INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
   36    19      > JMP                                                      ->15
         20    >   FE_FREE                                                  $11
   39    21      > RETURN                                                   1

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

End of function setsomevar

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

End of function getsomevar

Function setanothervar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0MMXM
function name:  setAnotherVar
number of ops:  4
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   20     1        ASSIGN_OBJ                                               'anotherVar'
          2        OP_DATA                                                  !0
   21     3      > RETURN                                                   null

End of function setanothervar

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

End of function getanothervar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.53 ms | 1010 KiB | 14 Q