3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '0x123'; if (!is_numeric($str)) { throw new Exception('Not a number'); } // Exception not thrown, instead wrong result is generated here: $n = (int) $str; // 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fW3i3
function name:  (null)
number of ops:  13
compiled vars:  !0 = $str, !1 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '0x123'
    4     1        INIT_FCALL                                               'is_numeric'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        BOOL_NOT                                         ~4      $3
          5      > JMPZ                                                     ~4, ->10
    5     6    >   NEW                                              $5      'Exception'
          7        SEND_VAL_EX                                              'Not+a+number'
          8        DO_FCALL                                      0          
          9      > THROW                                         0          $5
    9    10    >   CAST                                          4  ~7      !0
         11        ASSIGN                                                   !1, ~7
         12      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.84 ms | 1394 KiB | 15 Q