3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @param array{id: string, name: string} $user * @return array{id: string, name: string} */ function takesUserData(array $user): array { $user['extra_data'] = new stdClass(); return $user; } $foo = ['id' => 'DP42', 'name' => 'Douglas Adams']; echo implode('', takesUserData($foo));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PoVil
function name:  (null)
number of ops:  10
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, <array>
   13     1        INIT_FCALL                                               'implode'
          2        SEND_VAL                                                 ''
          3        INIT_FCALL                                               'takesuserdata'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                         $3      
          8        ECHO                                                     $3
          9      > RETURN                                                   1

Function takesuserdata:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PoVil
function name:  takesUserData
number of ops:  9
compiled vars:  !0 = $user
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        NEW                                              $2      'stdClass'
          2        DO_FCALL                                      0          
          3        ASSIGN_DIM                                               !0, 'extra_data'
          4        OP_DATA                                                  $2
    9     5        VERIFY_RETURN_TYPE                                       !0
          6      > RETURN                                                   !0
   10     7*       VERIFY_RETURN_TYPE                                       
          8*     > RETURN                                                   null

End of function takesuserdata

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.55 ms | 1438 KiB | 15 Q