3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { private $bar; private $baz; public function setBar($value) { $foo = new static; $foo->baz = $this->baz; $foo->bar = $value; return $foo; } public function setBaz($value) { $foo = new static; $foo->bar = $this->bar; $foo->baz = $value; return $foo; } } $f = new Foo(); $g = $f->setBar('123'); $h = $g->setBaz('456'); var_dump($f, $g, $h);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tLMpT
function name:  (null)
number of ops:  17
compiled vars:  !0 = $f, !1 = $g, !2 = $h
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $3      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   20     3        INIT_METHOD_CALL                                         !0, 'setBar'
          4        SEND_VAL_EX                                              '123'
          5        DO_FCALL                                      0  $6      
          6        ASSIGN                                                   !1, $6
   21     7        INIT_METHOD_CALL                                         !1, 'setBaz'
          8        SEND_VAL_EX                                              '456'
          9        DO_FCALL                                      0  $8      
         10        ASSIGN                                                   !2, $8
   23    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !0
         13        SEND_VAR                                                 !1
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

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

End of function setbar

Function setbaz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tLMpT
function name:  setBaz
number of ops:  11
compiled vars:  !0 = $value, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        NEW                          static              $2      
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $2
   13     4        FETCH_OBJ_R                                      ~6      'bar'
          5        ASSIGN_OBJ                                               !1, 'bar'
          6        OP_DATA                                                  ~6
   14     7        ASSIGN_OBJ                                               !1, 'baz'
          8        OP_DATA                                                  !0
   15     9      > RETURN                                                   !1
   16    10*     > RETURN                                                   null

End of function setbaz

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.53 ms | 1400 KiB | 15 Q