3v4l.org

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

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

End of function __construct

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

End of function getfoo

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
187.35 ms | 1396 KiB | 15 Q