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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.81 ms | 1396 KiB | 17 Q