3v4l.org

run code in 300+ PHP versions simultaneously
<?php $preg = '\d+(\,\d{3})?(\,\d{3})?(?:\.\d{1,2})?'; $arr = [ '$5,710.75', '$5,710,710.75', '$5710.15', '$57', '$57.1', '$57.', '$5,7.1', '$5,710,710,710.75', ]; foreach ($arr as $str) { echo "$str -> "; $res = preg_match($preg,$a); var_dump($res); } //
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/I7nNI
function name:  (null)
number of ops:  18
compiled vars:  !0 = $preg, !1 = $arr, !2 = $str, !3 = $res, !4 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5Cd%2B%28%5C%2C%5Cd%7B3%7D%29%3F%28%5C%2C%5Cd%7B3%7D%29%3F%28%3F%3A%5C.%5Cd%7B1%2C2%7D%29%3F'
    5     1        ASSIGN                                                   !1, <array>
   16     2      > FE_RESET_R                                       $7      !1, ->16
          3    > > FE_FETCH_R                                               $7, !2, ->16
   17     4    >   NOP                                                      
          5        FAST_CONCAT                                      ~8      !2, '+-%3E+'
          6        ECHO                                                     ~8
   19     7        INIT_FCALL                                               'preg_match'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !4
         10        DO_ICALL                                         $9      
         11        ASSIGN                                                   !3, $9
   20    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !3
         14        DO_ICALL                                                 
   16    15      > JMP                                                      ->3
         16    >   FE_FREE                                                  $7
   22    17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.97 ms | 1011 KiB | 15 Q