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 ); foreach($values as $value) { $isValid = false; $value = abs($value); if(is_int($value)) $isValid = true; $regexp = '/^[0-9]+\.[0-9][0-9]?$/'; preg_match($regexp, $value, $matches); if(count($matches) == 1) $isValid = true; if($isValid) { echo $value."\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 25
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 25
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 21
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 24
Branch analysis from position: 21
Branch analysis from position: 11
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/vgg66
function name:  (null)
number of ops:  27
compiled vars:  !0 = $values, !1 = $value, !2 = $isValid, !3 = $regexp, !4 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, <array>
   19     1      > FE_RESET_R                                       $6      !0, ->25
          2    > > FE_FETCH_R                                               $6, !1, ->25
   20     3    >   ASSIGN                                                   !2, <false>
   21     4        INIT_FCALL                                               'abs'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $8      
          7        ASSIGN                                                   !1, $8
   23     8        TYPE_CHECK                                   16          !1
          9      > JMPZ                                                     ~10, ->11
   24    10    >   ASSIGN                                                   !2, <true>
   27    11    >   ASSIGN                                                   !3, '%2F%5E%5B0-9%5D%2B%5C.%5B0-9%5D%5B0-9%5D%3F%24%2F'
   28    12        INIT_FCALL                                               'preg_match'
         13        SEND_VAR                                                 !3
         14        SEND_VAR                                                 !1
         15        SEND_REF                                                 !4
         16        DO_ICALL                                                 
   30    17        COUNT                                            ~14     !4
         18        IS_EQUAL                                                 ~14, 1
         19      > JMPZ                                                     ~15, ->21
   31    20    >   ASSIGN                                                   !2, <true>
   33    21    > > JMPZ                                                     !2, ->24
   34    22    >   CONCAT                                           ~17     !1, '%0A'
         23        ECHO                                                     ~17
   19    24    > > JMP                                                      ->2
         25    >   FE_FREE                                                  $6
   36    26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.96 ms | 1396 KiB | 17 Q