3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected string $dbname; public function __construct(array $appdata) { $this->dbname = 'mydb_' . $appdata['id']; } public function debug(): string { return $this->dbname; } } $appdata = [ 'id' => $_ENV['USER'], ]; $foo = new Foo($appdata); var_dump($foo->debug());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6VNEX
function name:  (null)
number of ops:  14
compiled vars:  !0 = $appdata, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   FETCH_R                      global              ~2      '_ENV'
          1        FETCH_DIM_R                                      ~3      ~2, 'USER'
          2        INIT_ARRAY                                       ~4      ~3, 'id'
   18     3        ASSIGN                                                   !0, ~4
   21     4        NEW                                              $6      'Foo'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
   22     8        INIT_FCALL                                               'var_dump'
          9        INIT_METHOD_CALL                                         !1, 'debug'
         10        DO_FCALL                                      0  $9      
         11        SEND_VAR                                                 $9
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

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

End of function __construct

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

End of function debug

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.39 ms | 998 KiB | 14 Q