3v4l.org

run code in 300+ PHP versions simultaneously
<?php $float = array( 12.5, 12.000000001, 12.00000, 12, 12.41757445, 12.071774 ); foreach ($float as $i) { if (preg_match('/\d+.[^1-9]+/', $i)) { echo $i . PHP_EOL; echo round($i) . " match" . PHP_EOL; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 17
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 16
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 16
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/EcaDU
function name:  (null)
number of ops:  19
compiled vars:  !0 = $float, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   12     1      > FE_RESET_R                                       $3      !0, ->17
          2    > > FE_FETCH_R                                               $3, !1, ->17
   14     3    >   INIT_FCALL                                               'preg_match'
          4        SEND_VAL                                                 '%2F%5Cd%2B.%5B%5E1-9%5D%2B%2F'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $4      
          7      > JMPZ                                                     $4, ->16
   15     8    >   CONCAT                                           ~5      !1, '%0A'
          9        ECHO                                                     ~5
   16    10        INIT_FCALL                                               'round'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $6      
         13        CONCAT                                           ~7      $6, '+match'
         14        CONCAT                                           ~8      ~7, '%0A'
         15        ECHO                                                     ~8
   12    16    > > JMP                                                      ->2
         17    >   FE_FREE                                                  $3
   18    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161 ms | 1399 KiB | 17 Q