3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.2 ms | 1396 KiB | 19 Q