3v4l.org

run code in 300+ PHP versions simultaneously
(<?php $custom_fields = [ 'foo' => '17', ]; $time_intervals = ['day', 'month', 'year', 'hour', 'minute', 'period']; $data = [ 'fooday' => '17', 'foomonth' => 'March', 'name' => 'Chris' ]; foreach (array_keys($custom_fields) as $field) { var_dump(array_map(function ($interval) use ($field) { return $field . $interval; }, $time_intervals)); } 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 = 8, Position 2 = 19
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 19
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 19
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 30
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 30
Branch analysis from position: 25
2 jumps found. (Code = 77) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
2 jumps found. (Code = 78) Position 1 = 27, Position 2 = 28
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 28
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
Branch analysis from position: 19
filename:       /in/bB5Kg
function name:  (null)
number of ops:  35
compiled vars:  !0 = $custom_fields, !1 = $time_intervals, !2 = $data, !3 = $field, !4 = $name, !5 = $interval_name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%28'
    2     1        ASSIGN                                                   !0, <array>
    6     2        ASSIGN                                                   !1, <array>
    8     3        ASSIGN                                                   !2, <array>
   15     4        INIT_FCALL                                               'array_keys'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $9      
          7      > FE_RESET_R                                       $10     $9, ->19
          8    > > FE_FETCH_R                                               $10, !3, ->19
   16     9    >   INIT_FCALL                                               'var_dump'
         10        INIT_FCALL                                               'array_map'
         11        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FbB5Kg%3A16%240'
         12        BIND_LEXICAL                                             ~11, !3
         13        SEND_VAL                                                 ~11
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $12     
         16        SEND_VAR                                                 $12
         17        DO_ICALL                                                 
   15    18      > JMP                                                      ->8
         19    >   FE_FREE                                                  $10
   19    20        INIT_FCALL                                               'array_keys'
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                         $14     
         23      > FE_RESET_R                                       $15     $14, ->30
         24    > > FE_FETCH_R                                               $15, !4, ->30
   20    25    > > FE_RESET_R                                       $16     !1, ->28
         26    > > FE_FETCH_R                                               $16, !5, ->28
         27    > > JMP                                                      ->26
         28    >   FE_FREE                                                  $16
   19    29      > JMP                                                      ->24
         30    >   FE_FREE                                                  $15
   26    31        INIT_FCALL                                               'var_dump'
         32        SEND_VAR                                                 !2
         33        DO_ICALL                                                 
   28    34      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FbB5Kg%3A16%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bB5Kg
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $interval, !1 = $field
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        CONCAT                                           ~2      !1, !0
          3      > RETURN                                                   ~2
          4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FbB5Kg%3A16%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.99 ms | 1400 KiB | 19 Q