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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.99 ms | 1400 KiB | 17 Q