3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { /** * @var int */ private $bar; public function __construct(int $bar) { $this->bar = $bar; } public function getBar() { return $this->bar; } public function baz(int $boz) { return $boz . ':' . $this->getBar(); } public function __invoke(int $boz) { echo $this->baz($boz); echo "fooobar"; } } $foo2 = new Foo(1); $foo2(2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IO1JO
function name:  (null)
number of ops:  8
compiled vars:  !0 = $foo2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   NEW                                              $1      'Foo'
          1        SEND_VAL_EX                                              1
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   37     4        INIT_DYNAMIC_CALL                                        !0
          5        SEND_VAL_EX                                              2
          6        DO_FCALL                                      0          
          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/IO1JO
function name:  __construct
number of ops:  4
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        ASSIGN_OBJ                                               'bar'
          2        OP_DATA                                                  !0
   14     3      > RETURN                                                   null

End of function __construct

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

End of function getbar

Function baz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IO1JO
function name:  baz
number of ops:  7
compiled vars:  !0 = $boz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   25     1        CONCAT                                           ~1      !0, '%3A'
          2        INIT_METHOD_CALL                                         'getBar'
          3        DO_FCALL                                      0  $2      
          4        CONCAT                                           ~3      ~1, $2
          5      > RETURN                                                   ~3
   26     6*     > RETURN                                                   null

End of function baz

Function __invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IO1JO
function name:  __invoke
number of ops:  7
compiled vars:  !0 = $boz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   RECV                                             !0      
   31     1        INIT_METHOD_CALL                                         'baz'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $1      
          4        ECHO                                                     $1
   32     5        ECHO                                                     'fooobar'
   33     6      > RETURN                                                   null

End of function __invoke

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.44 ms | 1399 KiB | 13 Q