3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ConfigApp { const dbhost = "localhost"; const dbname = "secretdbname"; const dbuser = "secretdbsuer"; const dbpass = "secretdbpass"; const var1 = "something"; const var2 = "nothingToDoWithDB"; const var3 = "something else else"; } class Dbh extends ConfigApp{ public function __construct() { $this->connect(); } protected function connect() { echo self::dbhost.PHP_EOL; echo self::dbname.PHP_EOL; echo self::dbuser.PHP_EOL; echo self::dbpass.PHP_EOL; } } $dbh = new Dbh();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XjCeU
function name:  (null)
number of ops:  4
compiled vars:  !0 = $dbh
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   NEW                                              $1      'Dbh'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
          3      > RETURN                                                   1

Class ConfigApp: [no user functions]
Class Dbh:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XjCeU
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_METHOD_CALL                                         'connect'
          1        DO_FCALL                                      0          
   18     2      > RETURN                                                   null

End of function __construct

Function connect:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XjCeU
function name:  connect
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   FETCH_CLASS_CONSTANT                             ~0      'dbhost'
          1        CONCAT                                           ~1      ~0, '%0A'
          2        ECHO                                                     ~1
   22     3        FETCH_CLASS_CONSTANT                             ~2      'dbname'
          4        CONCAT                                           ~3      ~2, '%0A'
          5        ECHO                                                     ~3
   23     6        FETCH_CLASS_CONSTANT                             ~4      'dbuser'
          7        CONCAT                                           ~5      ~4, '%0A'
          8        ECHO                                                     ~5
   24     9        FETCH_CLASS_CONSTANT                             ~6      'dbpass'
         10        CONCAT                                           ~7      ~6, '%0A'
         11        ECHO                                                     ~7
   25    12      > RETURN                                                   null

End of function connect

End of class Dbh.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.24 ms | 1398 KiB | 13 Q