3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.76 ms | 1396 KiB | 17 Q