3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( Array('weight' => '317.51474856007','reps' => '10'), Array('weight' => 50,'reps' => 10), Array('reps' => 10), Array('reps' => 10) ); $count = array(); array_walk_recursive($arr, function($v, $k)use(&$count){if(array_key_exists($k, $count))$count[$k]++;else $count[$k]=1;}, $count); print_r($count);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OisnT
function name:  (null)
number of ops:  13
compiled vars:  !0 = $arr, !1 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, <array>
   10     2        INIT_FCALL                                               'array_walk_recursive'
          3        SEND_REF                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FOisnT%3A10%240'
          5        BIND_LEXICAL                                             ~4, !1
          6        SEND_VAL                                                 ~4
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
   11     9        INIT_FCALL                                               'print_r'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FOisnT%3A10%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OisnT
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $v, !1 = $k, !2 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
          3        ARRAY_KEY_EXISTS                                         !1, !2
          4      > JMPZ                                                     ~3, ->8
          5    >   FETCH_DIM_RW                                     $4      !2, !1
          6        PRE_INC                                                  $4
          7      > JMP                                                      ->10
          8    >   ASSIGN_DIM                                               !2, !1
          9        OP_DATA                                                  1
         10    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FOisnT%3A10%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.43 ms | 1388 KiB | 17 Q