3v4l.org

run code in 300+ PHP versions simultaneously
<?php $custom_fields = [ 'foo' => '17', 'bar' => '17', ]; $time_intervals = ['day', 'month', 'year', 'hour', 'minute', 'period']; $data = [ 'fooday' => '17', 'foomonth' => 'March', 'name' => 'Chris' ]; function array_string_multiply() { $arrays = func_get_args(); $keys = array_fill(array_sum(array_map("count", $tickets)), 0); var_dump($keys); // foreach ($keys as $key) { // $sums[$key] = array_reduce($arrays, function ($sum, $arr) use ($key) { return $sum . @$arr[$key]; }); //} // return $sums; } foreach (array_string_multiply(array_keys($custom_fields), $time_intervals) as $key) { var_dump($key); } foreach (array_keys($custom_fields) as $name) { foreach ($time_intervals as $interval_name) { // ; } } var_dump($data); // Result should be array that only contains $data['name'] = 'Chris'
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 16
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 27
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 27
Branch analysis from position: 22
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 25
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 25
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
Branch analysis from position: 16
filename:       /in/uKibd
function name:  (null)
number of ops:  32
compiled vars:  !0 = $custom_fields, !1 = $time_intervals, !2 = $data, !3 = $key, !4 = $name, !5 = $interval_name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, <array>
   10     2        ASSIGN                                                   !2, <array>
   29     3        INIT_FCALL                                               'array_string_multiply'
          4        INIT_FCALL                                               'array_keys'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $9      
          7        SEND_VAR                                                 $9
          8        SEND_VAR                                                 !1
          9        DO_FCALL                                      0  $10     
         10      > FE_RESET_R                                       $11     $10, ->16
         11    > > FE_FETCH_R                                               $11, !3, ->16
   30    12    >   INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !3
         14        DO_ICALL                                                 
   29    15      > JMP                                                      ->11
         16    >   FE_FREE                                                  $11
   33    17        INIT_FCALL                                               'array_keys'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $13     
         20      > FE_RESET_R                                       $14     $13, ->27
         21    > > FE_FETCH_R                                               $14, !4, ->27
   34    22    > > FE_RESET_R                                       $15     !1, ->25
         23    > > FE_FETCH_R                                               $15, !5, ->25
         24    > > JMP                                                      ->23
         25    >   FE_FREE                                                  $15
   33    26      > JMP                                                      ->21
         27    >   FE_FREE                                                  $14
   40    28        INIT_FCALL                                               'var_dump'
         29        SEND_VAR                                                 !2
         30        DO_ICALL                                                 
   42    31      > RETURN                                                   1

Function array_string_multiply:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uKibd
function name:  array_string_multiply
number of ops:  18
compiled vars:  !0 = $arrays, !1 = $keys, !2 = $tickets
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   FUNC_GET_ARGS                                    ~3      
          1        ASSIGN                                                   !0, ~3
   19     2        INIT_FCALL                                               'array_fill'
          3        INIT_FCALL                                               'array_sum'
          4        INIT_FCALL                                               'array_map'
          5        SEND_VAL                                                 'count'
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                         $6      
         10        SEND_VAR                                                 $6
         11        SEND_VAL                                                 0
         12        DO_ICALL                                         $7      
         13        ASSIGN                                                   !1, $7
   20    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
   25    17      > RETURN                                                   null

End of function array_string_multiply

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.02 ms | 1403 KiB | 24 Q