3v4l.org

run code in 300+ PHP versions simultaneously
<?php //$str = "Diese Seite wurde bisher 6.971 mal abgerufen."; $str = "Diese Seite wurde bisher 19 mal abgerufen."; $matches = array(); if (!preg_match('/([^\d]|^)\d{1,2}.\d{3}([^\d]|$)/', $str, $matches)) preg_match('/([^\d]|^)\d{4,5}([^\d]|$)/', $str, $matches); print_r($matches); var_dump(intval($matches[0]));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/7lum6
function name:  (null)
number of ops:  23
compiled vars:  !0 = $str, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Diese+Seite+wurde+bisher+19+mal+abgerufen.'
    4     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'preg_match'
          3        SEND_VAL                                                 '%2F%28%5B%5E%5Cd%5D%7C%5E%29%5Cd%7B1%2C2%7D.%5Cd%7B3%7D%28%5B%5E%5Cd%5D%7C%24%29%2F'
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !1
          6        DO_ICALL                                         $4      
          7        BOOL_NOT                                         ~5      $4
          8      > JMPZ                                                     ~5, ->14
    7     9    >   INIT_FCALL                                               'preg_match'
         10        SEND_VAL                                                 '%2F%28%5B%5E%5Cd%5D%7C%5E%29%5Cd%7B4%2C5%7D%28%5B%5E%5Cd%5D%7C%24%29%2F'
         11        SEND_VAR                                                 !0
         12        SEND_REF                                                 !1
         13        DO_ICALL                                                 
    9    14    >   INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
   10    17        INIT_FCALL                                               'var_dump'
         18        FETCH_DIM_R                                      ~8      !1, 0
         19        CAST                                          4  ~9      ~8
         20        SEND_VAL                                                 ~9
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.45 ms | 1395 KiB | 19 Q