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){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/bY866
function name:  (null)
number of ops:  12
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%2FbY866%3A10%240'
          5        SEND_VAL                                                 ~4
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
   11     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FbY866%3A10%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bY866
function name:  {closure}
number of ops:  10
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        ARRAY_KEY_EXISTS                                         !1, !2
          3      > JMPZ                                                     ~3, ->7
          4    >   FETCH_DIM_RW                                     $4      !2, !1
          5        PRE_INC                                                  $4
          6      > JMP                                                      ->9
          7    >   ASSIGN_DIM                                               !2, !1
          8        OP_DATA                                                  1
          9    > > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.2 ms | 1395 KiB | 17 Q