3v4l.org

run code in 300+ PHP versions simultaneously
<?php $value = array( array(3075,15,461.25,16,535.05), array(3075,15,461.25808,16,535.05),//to be removed array(3075,15,461.2,16,535.05234)//to be removed ); function decimalFilter($v) { foreach ( $v as $x ) { if (strlen(substr(strrchr($x, "."), 1)) > 2) return false; } return true; } $value = array_filter($value, "decimalFilter"); var_dump($value);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t9WpK
function name:  (null)
number of ops:  10
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
   18     1        INIT_FCALL                                               'array_filter'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'decimalFilter'
          4        DO_ICALL                                         $2      
          5        ASSIGN                                                   !0, $2
   19     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function decimalfilter:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 17
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/t9WpK
function name:  decimalFilter
number of ops:  20
compiled vars:  !0 = $v, !1 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1      > FE_RESET_R                                       $2      !0, ->17
          2    > > FE_FETCH_R                                               $2, !1, ->17
   13     3    >   INIT_FCALL                                               'substr'
          4        INIT_FCALL                                               'strrchr'
          5        SEND_VAR                                                 !1
          6        SEND_VAL                                                 '.'
          7        DO_ICALL                                         $3      
          8        SEND_VAR                                                 $3
          9        SEND_VAL                                                 1
         10        DO_ICALL                                         $4      
         11        STRLEN                                           ~5      $4
         12        IS_SMALLER                                               2, ~5
         13      > JMPZ                                                     ~6, ->16
   14    14    >   FE_FREE                                                  $2
         15      > RETURN                                                   <false>
   12    16    > > JMP                                                      ->2
         17    >   FE_FREE                                                  $2
   16    18      > RETURN                                                   <true>
   17    19*     > RETURN                                                   null

End of function decimalfilter

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.62 ms | 1396 KiB | 21 Q