3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface iCrud { public function create($data); public function read(); public function update($data); public function delete(); } class User implements iCrud { private $_userId = NULL; private $_username = NULL; function __construct($data) { $this->_userId = uniqid(); $this->_username = $data['username']; } function create($data) { self::__construct($data); } function read() { return array('userId' => $this->_userId, 'username' => $this->_username); } function update($data) { $this->_username = $data['username']; } public function delete() { $this->_username = NULL; $this->_userId = NULL; } } // assignment $u = new User(['username' => 'potato']); $u->create(['username' => 'notPotato']); var_dump($u);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r7bMC
function name:  (null)
number of ops:  12
compiled vars:  !0 = $u
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                            'user'
   41     1        NEW                                              $1      'User'
          2        SEND_VAL_EX                                              <array>
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   42     5        INIT_METHOD_CALL                                         !0, 'create'
          6        SEND_VAL_EX                                              <array>
          7        DO_FCALL                                      0          
   44     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Class iCrud:
Function create:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r7bMC
function name:  create
number of ops:  2
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function create

Function read:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r7bMC
function name:  read
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   null

End of function read

Function update:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r7bMC
function name:  update
number of ops:  2
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function update

Function delete:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r7bMC
function name:  delete
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   null

End of function delete

End of class iCrud.

Class User:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r7bMC
function name:  __construct
number of ops:  9
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        INIT_FCALL                                               'uniqid'
          2        DO_ICALL                                         $2      
          3        ASSIGN_OBJ                                               '_userId'
          4        OP_DATA                                                  $2
   17     5        FETCH_DIM_R                                      ~4      !0, 'username'
          6        ASSIGN_OBJ                                               '_username'
          7        OP_DATA                                                  ~4
   18     8      > RETURN                                                   null

End of function __construct

Function create:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r7bMC
function name:  create
number of ops:  5
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   21     1        INIT_STATIC_METHOD_CALL                                  
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
   22     4      > RETURN                                                   null

End of function create

Function read:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r7bMC
function name:  read
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   FETCH_OBJ_R                                      ~0      '_userId'
          1        INIT_ARRAY                                       ~1      ~0, 'userId'
          2        FETCH_OBJ_R                                      ~2      '_username'
          3        ADD_ARRAY_ELEMENT                                ~1      ~2, 'username'
          4      > RETURN                                                   ~1
   26     5*     > RETURN                                                   null

End of function read

Function update:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r7bMC
function name:  update
number of ops:  5
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   RECV                                             !0      
   29     1        FETCH_DIM_R                                      ~2      !0, 'username'
          2        ASSIGN_OBJ                                               '_username'
          3        OP_DATA                                                  ~2
   30     4      > RETURN                                                   null

End of function update

Function delete:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r7bMC
function name:  delete
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   ASSIGN_OBJ                                               '_username'
          1        OP_DATA                                                  null
   34     2        ASSIGN_OBJ                                               '_userId'
          3        OP_DATA                                                  null
   35     4      > RETURN                                                   null

End of function delete

End of class User.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.45 ms | 1400 KiB | 17 Q