3v4l.org

run code in 300+ PHP versions simultaneously
<?php $power= "0.1"; try{ if(is_float($power) || is_int($power)){ // ok, good } else{ throw new Exception("Amount of power was not int or float!", 1); return false; } } catch(Exception $e){ echo "Exception: ".$e->getMessage()."\n"; echo "Converting value to float if possible."; $power = (float) $power; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 5
Found catch point at position: 14
Branch analysis from position: 14
2 jumps found. (Code = 107) Position 1 = 15, Position 2 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9ZOgC
function name:  (null)
number of ops:  24
compiled vars:  !0 = $power, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '0.1'
    4     1        TYPE_CHECK                                   32  ~3      !0
          2      > JMPNZ_EX                                         ~3      ~3, ->5
          3    >   TYPE_CHECK                                   16  ~4      !0
          4        BOOL                                             ~3      ~4
          5    > > JMPZ                                                     ~3, ->7
          6    > > JMP                                                      ->13
    8     7    >   NEW                                              $5      'Exception'
          8        SEND_VAL_EX                                              'Amount+of+power+was+not+int+or+float%21'
          9        SEND_VAL_EX                                              1
         10        DO_FCALL                                      0          
         11      > THROW                                         0          $5
    9    12*       RETURN                                                   <false>
         13    > > JMP                                                      ->23
   14    14  E > > CATCH                                       last         'Exception'
   15    15    >   INIT_METHOD_CALL                                         !1, 'getMessage'
         16        DO_FCALL                                      0  $7      
         17        CONCAT                                           ~8      'Exception%3A+', $7
         18        CONCAT                                           ~9      ~8, '%0A'
         19        ECHO                                                     ~9
   16    20        ECHO                                                     'Converting+value+to+float+if+possible.'
   17    21        CAST                                          5  ~10     !0
         22        ASSIGN                                                   !0, ~10
   18    23    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.31 ms | 1395 KiB | 13 Q