3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected string $bar; protected string $baz; protected string $qux = 'initial qux'; public function fillValues() { $this->bar = 'bar'; $this->baz = 'baz'; $this->qux = 'qux'; } public function getBar() { return $this->bar; } public function getBaz() { return $this->baz; } public function getQux() { return $this->qux; } } $rc = new ReflectionClass(Foo::class); $foo = $rc->newInstanceWithoutConstructor(); $foo->fillValues(); echo $foo->getBar() . PHP_EOL; echo $foo->getBaz() . PHP_EOL; echo $foo->getQux() . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/U8t8M
function name:  (null)
number of ops:  22
compiled vars:  !0 = $rc, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   NEW                                              $2      'ReflectionClass'
          1        SEND_VAL_EX                                              'Foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   33     4        INIT_METHOD_CALL                                         !0, 'newInstanceWithoutConstructor'
          5        DO_FCALL                                      0  $5      
          6        ASSIGN                                                   !1, $5
   34     7        INIT_METHOD_CALL                                         !1, 'fillValues'
          8        DO_FCALL                                      0          
   35     9        INIT_METHOD_CALL                                         !1, 'getBar'
         10        DO_FCALL                                      0  $8      
         11        CONCAT                                           ~9      $8, '%0A'
         12        ECHO                                                     ~9
   36    13        INIT_METHOD_CALL                                         !1, 'getBaz'
         14        DO_FCALL                                      0  $10     
         15        CONCAT                                           ~11     $10, '%0A'
         16        ECHO                                                     ~11
   37    17        INIT_METHOD_CALL                                         !1, 'getQux'
         18        DO_FCALL                                      0  $12     
         19        CONCAT                                           ~13     $12, '%0A'
         20        ECHO                                                     ~13
   38    21      > RETURN                                                   1

Class Foo:
Function fillvalues:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/U8t8M
function name:  fillValues
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN_OBJ                                               'bar'
          1        OP_DATA                                                  'bar'
   12     2        ASSIGN_OBJ                                               'baz'
          3        OP_DATA                                                  'baz'
   13     4        ASSIGN_OBJ                                               'qux'
          5        OP_DATA                                                  'qux'
   14     6      > RETURN                                                   null

End of function fillvalues

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

End of function getbar

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

End of function getbaz

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

End of function getqux

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.04 ms | 1403 KiB | 13 Q