3v4l.org

run code in 300+ PHP versions simultaneously
<?php class UserData{ public $user; public $userid; public function __construct($username, $userid){ $this->user = $username; $this->userid = $userid; } public function display(){ echo "Username is {$this->user} and user id is{$this->userid}"; } } class Admin extends UserData{ public $level; public function display(){ echo "Username is {$this->user} and user id is{$this->userid} and user level is ($this->level)"; } } $user = "mamun"; $id = "25"; $ur = new UserData($user, $id); echo "<br/>"; $ur->display(); echo "<br/>"; $ad = new Admin($user,$id); $ad->level ="Administrator"; $ad->display(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/usSN7
function name:  (null)
number of ops:  21
compiled vars:  !0 = $user, !1 = $id, !2 = $ur, !3 = $ad
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   ASSIGN                                                   !0, 'mamun'
   27     1        ASSIGN                                                   !1, '25'
   28     2        NEW                                              $6      'UserData'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !2, $6
   29     7        ECHO                                                     '%3Cbr%2F%3E'
   30     8        INIT_METHOD_CALL                                         !2, 'display'
          9        DO_FCALL                                      0          
   31    10        ECHO                                                     '%3Cbr%2F%3E'
   33    11        NEW                                              $10     'Admin'
         12        SEND_VAR_EX                                              !0
         13        SEND_VAR_EX                                              !1
         14        DO_FCALL                                      0          
         15        ASSIGN                                                   !3, $10
   34    16        ASSIGN_OBJ                                               !3, 'level'
         17        OP_DATA                                                  'Administrator'
   35    18        INIT_METHOD_CALL                                         !3, 'display'
         19        DO_FCALL                                      0          
   41    20      > RETURN                                                   1

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

End of function __construct

Function display:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/usSN7
function name:  display
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ROPE_INIT                                     4  ~3      'Username+is+'
          1        FETCH_OBJ_R                                      ~0      'user'
          2        ROPE_ADD                                      1  ~3      ~3, ~0
          3        ROPE_ADD                                      2  ~3      ~3, '+and+user+id+is'
          4        FETCH_OBJ_R                                      ~1      'userid'
          5        ROPE_END                                      3  ~2      ~3, ~1
          6        ECHO                                                     ~2
   15     7      > RETURN                                                   null

End of function display

End of class UserData.

Class Admin:
Function display:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/usSN7
function name:  display
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   ROPE_INIT                                     7  ~4      'Username+is+'
          1        FETCH_OBJ_R                                      ~0      'user'
          2        ROPE_ADD                                      1  ~4      ~4, ~0
          3        ROPE_ADD                                      2  ~4      ~4, '+and+user+id+is'
          4        FETCH_OBJ_R                                      ~1      'userid'
          5        ROPE_ADD                                      3  ~4      ~4, ~1
          6        ROPE_ADD                                      4  ~4      ~4, '+and+user+level+is+%28'
          7        FETCH_OBJ_R                                      ~2      'level'
          8        ROPE_ADD                                      5  ~4      ~4, ~2
          9        ROPE_END                                      6  ~3      ~4, '%29'
         10        ECHO                                                     ~3
   23    11      > RETURN                                                   null

End of function display

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

End of function __construct

End of class Admin.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.89 ms | 1403 KiB | 13 Q