3v4l.org

run code in 300+ PHP versions simultaneously
<?php function return_me_data_pls() { $params_to_return = array( 'count' => range(1,10), 'sum' => array_sum(range(1,10)) ); return $params_to_return; } // Manually $returned = return_me_data_pls(); $count = $returned['count']; $sum = $returned['sum']; var_dump($count, $sum); unset($returned, $count, $sum); // Automatically extract(return_me_data_pls()); var_dump($count, $sum); unset($count, $sum); // Listing list($count, $sum) = array_values(return_me_data_pls()); var_dump($count, $sum); unset($count, $sum);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/76b5J
function name:  (null)
number of ops:  42
compiled vars:  !0 = $returned, !1 = $count, !2 = $sum
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'return_me_data_pls'
          1        DO_FCALL                                      0  $3      
          2        ASSIGN                                                   !0, $3
   15     3        FETCH_DIM_R                                      ~5      !0, 'count'
          4        ASSIGN                                                   !1, ~5
   16     5        FETCH_DIM_R                                      ~7      !0, 'sum'
          6        ASSIGN                                                   !2, ~7
   18     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                                 
   19    11        UNSET_CV                                                 !0
         12        UNSET_CV                                                 !1
         13        UNSET_CV                                                 !2
   22    14        INIT_FCALL                                               'extract'
         15        INIT_FCALL                                               'return_me_data_pls'
         16        DO_FCALL                                      0  $10     
         17        SEND_VAL                                                 $10
         18        DO_ICALL                                                 
   24    19        INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !1
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                                 
   25    23        UNSET_CV                                                 !1
         24        UNSET_CV                                                 !2
   28    25        INIT_FCALL                                               'array_values'
         26        INIT_FCALL                                               'return_me_data_pls'
         27        DO_FCALL                                      0  $13     
         28        SEND_VAR                                                 $13
         29        DO_ICALL                                         $14     
         30        FETCH_LIST_R                                     $15     $14, 0
         31        ASSIGN                                                   !1, $15
         32        FETCH_LIST_R                                     $17     $14, 1
         33        ASSIGN                                                   !2, $17
         34        FREE                                                     $14
   30    35        INIT_FCALL                                               'var_dump'
         36        SEND_VAR                                                 !1
         37        SEND_VAR                                                 !2
         38        DO_ICALL                                                 
   31    39        UNSET_CV                                                 !1
         40        UNSET_CV                                                 !2
         41      > RETURN                                                   1

Function return_me_data_pls:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/76b5J
function name:  return_me_data_pls
number of ops:  16
compiled vars:  !0 = $params_to_return
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 10
          3        DO_ICALL                                         $1      
          4        INIT_ARRAY                                       ~2      $1, 'count'
    6     5        INIT_FCALL                                               'array_sum'
          6        INIT_FCALL                                               'range'
          7        SEND_VAL                                                 1
          8        SEND_VAL                                                 10
          9        DO_ICALL                                         $3      
         10        SEND_VAR                                                 $3
         11        DO_ICALL                                         $4      
         12        ADD_ARRAY_ELEMENT                                ~2      $4, 'sum'
    4    13        ASSIGN                                                   !0, ~2
    9    14      > RETURN                                                   !0
   10    15*     > RETURN                                                   null

End of function return_me_data_pls

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
184.17 ms | 1403 KiB | 26 Q