3v4l.org

run code in 500+ PHP versions simultaneously
<?php $amounts = [ 1298, 1298.3, 1298.34, 1298.341, 1298.349279745, ]; foreach ($amounts as $amount) { preg_match('/\d+\.{0,1}\d{0,2}/', (string) $amount, $matches); var_dump($matches[0]); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 14
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/PtgrS
function name:  (null)
number of ops:  16
compiled vars:  !0 = $amounts, !1 = $amount, !2 = $matches
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   10     1      > FE_RESET_R                                           $4      !0, ->14
          2    > > FE_FETCH_R                                                   $4, !1, ->14
   11     3    >   INIT_FCALL                                                   'preg_match'
          4        SEND_VAL                                                     '%2F%5Cd%2B%5C.%7B0%2C1%7D%5Cd%7B0%2C2%7D%2F'
          5        CAST                                              6  ~5      !1
          6        SEND_VAL                                                     ~5
          7        SEND_REF                                                     !2
          8        DO_ICALL                                                     
   12     9        INIT_FCALL                                                   'var_dump'
         10        FETCH_DIM_R                                          ~7      !2, 0
         11        SEND_VAL                                                     ~7
         12        DO_ICALL                                                     
   10    13      > JMP                                                          ->2
         14    >   FE_FREE                                                      $4
   13    15      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.16 ms | 2071 KiB | 15 Q