3v4l.org

run code in 300+ PHP versions simultaneously
<?php $values = array( 0, 1, '1', 1.1, 1.00, 1.01, 2.33, 3.445, -3.45, 12.3432 ); foreach($values as $value) { $isValid = false; // $value = abs($value); //$regexp = '/^[0-9]+\.[0-9][0-9]?$/'; //$result = preg_match($regexp, $value, $matches); $regexp = '/^[0-9]+?$/'; var_dump((bool)preg_match($regexp, $value)); if(count($matches) == 1) $isValid = true; var_dump($result); if($isValid) { echo $value."\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 24
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 24
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 17
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 23
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 23
Branch analysis from position: 17
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/96aui
function name:  (null)
number of ops:  26
compiled vars:  !0 = $values, !1 = $value, !2 = $isValid, !3 = $regexp, !4 = $matches, !5 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, <array>
   20     1      > FE_RESET_R                                       $7      !0, ->24
          2    > > FE_FETCH_R                                               $7, !1, ->24
   21     3    >   ASSIGN                                                   !2, <false>
   28     4        ASSIGN                                                   !3, '%2F%5E%5B0-9%5D%2B%3F%24%2F'
   29     5        INIT_FCALL                                               'var_dump'
          6        INIT_FCALL                                               'preg_match'
          7        SEND_VAR                                                 !3
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $10     
         10        BOOL                                             ~11     $10
         11        SEND_VAL                                                 ~11
         12        DO_ICALL                                                 
   31    13        COUNT                                            ~13     !4
         14        IS_EQUAL                                                 ~13, 1
         15      > JMPZ                                                     ~14, ->17
   32    16    >   ASSIGN                                                   !2, <true>
   34    17    >   INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !5
         19        DO_ICALL                                                 
   36    20      > JMPZ                                                     !2, ->23
   37    21    >   CONCAT                                           ~17     !1, '%0A'
         22        ECHO                                                     ~17
   20    23    > > JMP                                                      ->2
         24    >   FE_FREE                                                  $7
   39    25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.06 ms | 1396 KiB | 17 Q