3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = array( '0x539', '02471', '1337e0', '0b10100111001', ); foreach ($tests as $element) { var_dump((int)$element); if (is_numeric($element)) { echo "'{$element}' is numeric", PHP_EOL; } else { echo "'{$element}' is NOT numeric", PHP_EOL; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 23
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 23
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 17
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/9QLjT
function name:  (null)
number of ops:  25
compiled vars:  !0 = $tests, !1 = $element
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1      > FE_RESET_R                                       $3      !0, ->23
          2    > > FE_FETCH_R                                               $3, !1, ->23
   11     3    >   INIT_FCALL                                               'var_dump'
          4        CAST                                          4  ~4      !1
          5        SEND_VAL                                                 ~4
          6        DO_ICALL                                                 
   12     7        INIT_FCALL                                               'is_numeric'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $6      
         10      > JMPZ                                                     $6, ->17
   13    11    >   ROPE_INIT                                     3  ~8      '%27'
         12        ROPE_ADD                                      1  ~8      ~8, !1
         13        ROPE_END                                      2  ~7      ~8, '%27+is+numeric'
         14        ECHO                                                     ~7
         15        ECHO                                                     '%0A'
         16      > JMP                                                      ->22
   15    17    >   ROPE_INIT                                     3  ~11     '%27'
         18        ROPE_ADD                                      1  ~11     ~11, !1
         19        ROPE_END                                      2  ~10     ~11, '%27+is+NOT+numeric'
         20        ECHO                                                     ~10
         21        ECHO                                                     '%0A'
   10    22    > > JMP                                                      ->2
         23    >   FE_FREE                                                  $3
   17    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.03 ms | 1396 KiB | 17 Q