3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.88 ms | 1388 KiB | 17 Q