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 = (float) ($element * 10); 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 = 31
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 31
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 23
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/OkQu9
function name:  (null)
number of ops:  33
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, ->31
          2    > > FE_FETCH_R                                               $5, !1, ->31
   16     3    >   INIT_FCALL                                               'is_numeric'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $6      
          6      > JMPZ                                                     $6, ->23
   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        CAST                                          5  ~11     ~10
         16        ASSIGN                                                   !3, ~11
   20    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !3
         19        DO_ICALL                                         $13     
         20        ECHO                                                     $13
         21        ECHO                                                     '%0A'
         22      > JMP                                                      ->30
   22    23    >   INIT_FCALL                                               'var_export'
         24        SEND_VAR                                                 !1
         25        SEND_VAL                                                 <true>
         26        DO_ICALL                                         $14     
         27        CONCAT                                           ~15     $14, '+is+NOT+numeric'
         28        ECHO                                                     ~15
         29        ECHO                                                     '%0A'
   15    30    > > JMP                                                      ->2
         31    >   FE_FREE                                                  $5
   24    32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.71 ms | 1396 KiB | 19 Q