3v4l.org

run code in 300+ PHP versions simultaneously
<?php class User { /** * DEPRECATED */ static function getByUserID($id) { return call_user_func_array(array(get_called_class(), 'getByID'),array($id)); } static function getByID($id) { $u = new User; $u->uid = $id; return $u; } } $u = User::getByUserID(1337); print_r($u);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IqmEu
function name:  (null)
number of ops:  8
compiled vars:  !0 = $u
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_STATIC_METHOD_CALL                                  'User', 'getByUserID'
          1        SEND_VAL                                                 1337
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
   16     4        INIT_FCALL                                               'print_r'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Class User:
Function getbyuserid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IqmEu
function name:  getByUserID
number of ops:  11
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        GET_CALLED_CLASS                                 ~1      
          2        INIT_ARRAY                                       ~2      ~1
          3        ADD_ARRAY_ELEMENT                                ~2      'getByID'
          4        INIT_USER_CALL                                0          'call_user_func_array', ~2
          5        INIT_ARRAY                                       ~3      !0
          6        SEND_ARRAY                                               ~3
          7        CHECK_UNDEF_ARGS                                         
          8        DO_FCALL                                      0  $4      
          9      > RETURN                                                   $4
    8    10*     > 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/IqmEu
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.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.94 ms | 1396 KiB | 15 Q