3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( '3A32', '4565', '7890', '0012', 'A324', '9002', '3200', '345A', '0436' ); $n1 = 3; $n2 = 3; $n3 = 'A'; function checkValues($array,$numbers=array()){ $finalArray = []; if(!empty($numbers)){ foreach($array as $arr){ $splitArr = str_split($arr); $matched = true; $count_number_Array = array_count_values($numbers); $count_split_array = array_count_values($splitArr); foreach($count_number_Array as $key=>$value){ if(!isset($count_split_array[$key]) || $count_split_array[$key] < $value){ $matched = false; break; } } if($matched === true){ $finalArray[] = $arr; } } } return $finalArray; } print_r(checkValues($array, array($n1,$n2,$n3)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fEKTO
function name:  (null)
number of ops:  15
compiled vars:  !0 = $array, !1 = $n1, !2 = $n2, !3 = $n3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   15     1        ASSIGN                                                   !1, 3
   16     2        ASSIGN                                                   !2, 3
   17     3        ASSIGN                                                   !3, 'A'
   44     4        INIT_FCALL                                               'print_r'
          5        INIT_FCALL                                               'checkvalues'
          6        SEND_VAR                                                 !0
          7        INIT_ARRAY                                       ~8      !1
          8        ADD_ARRAY_ELEMENT                                ~8      !2
          9        ADD_ARRAY_ELEMENT                                ~8      !3
         10        SEND_VAL                                                 ~8
         11        DO_FCALL                                      0  $9      
         12        SEND_VAR                                                 $9
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Function checkvalues:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 41
Branch analysis from position: 6
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 40
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 40
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 34
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 34
Branch analysis from position: 23
2 jumps found. (Code = 47) Position 1 = 27, Position 2 = 30
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 33
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 39
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 39
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 30
Branch analysis from position: 34
Branch analysis from position: 34
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
Branch analysis from position: 41
filename:       /in/fEKTO
function name:  checkValues
number of ops:  43
compiled vars:  !0 = $array, !1 = $numbers, !2 = $finalArray, !3 = $arr, !4 = $splitArr, !5 = $matched, !6 = $count_number_Array, !7 = $count_split_array, !8 = $value, !9 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <array>
   20     2        ASSIGN                                                   !2, <array>
   21     3        ISSET_ISEMPTY_CV                                 ~11     !1
          4        BOOL_NOT                                         ~12     ~11
          5      > JMPZ                                                     ~12, ->41
   22     6    > > FE_RESET_R                                       $13     !0, ->40
          7    > > FE_FETCH_R                                               $13, !3, ->40
   23     8    >   INIT_FCALL                                               'str_split'
          9        SEND_VAR                                                 !3
         10        DO_ICALL                                         $14     
         11        ASSIGN                                                   !4, $14
   24    12        ASSIGN                                                   !5, <true>
   25    13        INIT_FCALL                                               'array_count_values'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $17     
         16        ASSIGN                                                   !6, $17
   26    17        INIT_FCALL                                               'array_count_values'
         18        SEND_VAR                                                 !4
         19        DO_ICALL                                         $19     
         20        ASSIGN                                                   !7, $19
   27    21      > FE_RESET_R                                       $21     !6, ->34
         22    > > FE_FETCH_R                                       ~22     $21, !8, ->34
         23    >   ASSIGN                                                   !9, ~22
   28    24        ISSET_ISEMPTY_DIM_OBJ                         0  ~24     !7, !9
         25        BOOL_NOT                                         ~25     ~24
         26      > JMPNZ_EX                                         ~25     ~25, ->30
         27    >   FETCH_DIM_R                                      ~26     !7, !9
         28        IS_SMALLER                                       ~27     ~26, !8
         29        BOOL                                             ~25     ~27
         30    > > JMPZ                                                     ~25, ->33
   29    31    >   ASSIGN                                                   !5, <false>
   30    32      > JMP                                                      ->34
   27    33    > > JMP                                                      ->22
         34    >   FE_FREE                                                  $21
   33    35        TYPE_CHECK                                    8          !5
         36      > JMPZ                                                     ~29, ->39
   34    37    >   ASSIGN_DIM                                               !2
         38        OP_DATA                                                  !3
   22    39    > > JMP                                                      ->7
         40    >   FE_FREE                                                  $13
   41    41    > > RETURN                                                   !2
   42    42*     > RETURN                                                   null

End of function checkvalues

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.75 ms | 1020 KiB | 17 Q