3v4l.org

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

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3EYgl
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_THIS                                       ~0      
          1      > RETURN                                                   ~0
   10     2*     > RETURN                                                   null

End of function __construct

Function setbar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3EYgl
function name:  setBar
number of ops:  6
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        ASSIGN_OBJ                                               'bar'
          2        OP_DATA                                                  !0
   13     3        FETCH_THIS                                       ~2      
          4      > RETURN                                                   ~2
   14     5*     > 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/3EYgl
function name:  setBaz
number of ops:  6
compiled vars:  !0 = $baz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        ASSIGN_OBJ                                               'baz'
          2        OP_DATA                                                  !0
   17     3        FETCH_THIS                                       ~2      
          4      > RETURN                                                   ~2
   18     5*     > RETURN                                                   null

End of function setbaz

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.77 ms | 1396 KiB | 15 Q