3v4l.org

run code in 300+ PHP versions simultaneously
<?php class derp_User { /** * DEPRECATED */ static function getByUserID($id) { return self::getByID($id); } static function getByID($id) { $u = new User; $u->uid = $id; return $u; } } class User extends derp_User {} class myOwnUser extends User { static function getByID($id) { $u = new myOwnUser; $u->uid = $id; return $u; } } $u = myOwnUser::getByUserID(1337); print_r($u); echo "\nSHOULD BE\n"; print_r(myOWnUser::getByID(1337));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rlT18
function name:  (null)
number of ops:  15
compiled vars:  !0 = $u
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_STATIC_METHOD_CALL                                  'myOwnUser', 'getByUserID'
          1        SEND_VAL                                                 1337
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
   26     4        INIT_FCALL                                               'print_r'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
   27     7        ECHO                                                     '%0ASHOULD+BE%0A'
   28     8        INIT_FCALL                                               'print_r'
          9        INIT_STATIC_METHOD_CALL                                  'myOWnUser', 'getByID'
         10        SEND_VAL                                                 1337
         11        DO_FCALL                                      0  $4      
         12        SEND_VAR                                                 $4
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class derp_User:
Function getbyuserid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rlT18
function name:  getByUserID
number of ops:  6
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_STATIC_METHOD_CALL                                  'getByID'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $1      
          4      > RETURN                                                   $1
    8     5*     > RETURN                                                   null

End of function getbyuserid

Function getbyid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rlT18
function name:  getByID
number of ops:  8
compiled vars:  !0 = $id, !1 = $u
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        NEW                                              $2      'User'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $2
   11     4        ASSIGN_OBJ                                               !1, 'uid'
          5        OP_DATA                                                  !0
   12     6      > RETURN                                                   !1
   13     7*     > RETURN                                                   null

End of function getbyid

End of class derp_User.

Class User:
Function getbyuserid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rlT18
function name:  getByUserID
number of ops:  6
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_STATIC_METHOD_CALL                                  'getByID'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $1      
          4      > RETURN                                                   $1
    8     5*     > RETURN                                                   null

End of function getbyuserid

Function getbyid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rlT18
function name:  getByID
number of ops:  8
compiled vars:  !0 = $id, !1 = $u
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        NEW                                              $2      'User'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $2
   11     4        ASSIGN_OBJ                                               !1, 'uid'
          5        OP_DATA                                                  !0
   12     6      > RETURN                                                   !1
   13     7*     > RETURN                                                   null

End of function getbyid

End of class User.

Class myOwnUser:
Function getbyid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rlT18
function name:  getByID
number of ops:  8
compiled vars:  !0 = $id, !1 = $u
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   19     1        NEW                                              $2      'myOwnUser'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $2
   20     4        ASSIGN_OBJ                                               !1, 'uid'
          5        OP_DATA                                                  !0
   21     6      > RETURN                                                   !1
   22     7*     > RETURN                                                   null

End of function getbyid

Function getbyuserid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rlT18
function name:  getByUserID
number of ops:  6
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_STATIC_METHOD_CALL                                  'getByID'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $1      
          4      > RETURN                                                   $1
    8     5*     > RETURN                                                   null

End of function getbyuserid

End of class myOwnUser.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.2 ms | 1392 KiB | 15 Q