3v4l.org

run code in 300+ PHP versions simultaneously
<?php $itineraries_params = array_map(function ($weekday) { return [ (object) [ 'weekday' => $weekday, 'arrival_time' => '09:00:00', 'from_address_id' => 1, 'to_address_id' => 2 ], (object) [ 'weekday' => $weekday, 'arrival_time' => '17:00:00', 'from_address_id' => 2, 'to_address_id' => 1 ] ]; }, range(1, 5) ); var_dump($itineraries_params); // vrs Ruby // // itineraries_params = (1..5).flat_map do |weekday| // [{ // weekday: weekday, // arrival_time: '09:00:00', // from_address_id: user.home_address.id, // to_address_id: user.work_address.id // }, { // weekday: weekday, // arrival_time: '17:00:00', // from_address_id: user.work_address.id, // to_address_id: user.home_address.id // }] // end
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/elnfp
function name:  (null)
number of ops:  14
compiled vars:  !0 = $itineraries_params
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'array_map'
          1        DECLARE_LAMBDA_FUNCTION                          ~1      [0]
   18     2        SEND_VAL                                                 ~1
   19     3        INIT_FCALL                                               'range'
          4        SEND_VAL                                                 1
          5        SEND_VAL                                                 5
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
    3     8        DO_ICALL                                         $3      
          9        ASSIGN                                                   !0, $3
   22    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
   38    13      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/elnfp
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $weekday
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    6     1        INIT_ARRAY                                       ~1      !0, 'weekday'
    7     2        ADD_ARRAY_ELEMENT                                ~1      '09%3A00%3A00', 'arrival_time'
    8     3        ADD_ARRAY_ELEMENT                                ~1      1, 'from_address_id'
    9     4        ADD_ARRAY_ELEMENT                                ~1      2, 'to_address_id'
          5        CAST                                          8  ~2      ~1
          6        INIT_ARRAY                                       ~3      ~2
   12     7        INIT_ARRAY                                       ~4      !0, 'weekday'
   13     8        ADD_ARRAY_ELEMENT                                ~4      '17%3A00%3A00', 'arrival_time'
   14     9        ADD_ARRAY_ELEMENT                                ~4      2, 'from_address_id'
   15    10        ADD_ARRAY_ELEMENT                                ~4      1, 'to_address_id'
         11        CAST                                          8  ~5      ~4
         12        ADD_ARRAY_ELEMENT                                ~3      ~5
         13      > RETURN                                                   ~3
   18    14*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.61 ms | 1429 KiB | 16 Q