3v4l.org

run code in 300+ PHP versions simultaneously
<?php function checknum($number){ if($number>1) { throw new Exception("value must be 1 or below"); } return true; } try{ checknum(1); echo "if you see this the num is 1 or below"; } catch (Exception $e) { echo "err msg:".$e->getMessage(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 5
Branch analysis from position: 5
2 jumps found. (Code = 107) Position 1 = 6, Position 2 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W9JrS
function name:  (null)
number of ops:  11
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'checknum'
          1        SEND_VAL                                                 1
          2        DO_FCALL                                      0          
   11     3        ECHO                                                     'if+you+see+this+the+num+is+1+or+below'
          4      > JMP                                                      ->10
   13     5  E > > CATCH                                       last         'Exception'
   15     6    >   INIT_METHOD_CALL                                         !0, 'getMessage'
          7        DO_FCALL                                      0  $2      
          8        CONCAT                                           ~3      'err+msg%3A', $2
          9        ECHO                                                     ~3
   16    10    > > RETURN                                                   1

Function checknum:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W9JrS
function name:  checknum
number of ops:  9
compiled vars:  !0 = $number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        IS_SMALLER                                               1, !0
          2      > JMPZ                                                     ~1, ->7
    5     3    >   NEW                                              $2      'Exception'
          4        SEND_VAL_EX                                              'value+must+be+1+or+below'
          5        DO_FCALL                                      0          
          6      > THROW                                         0          $2
    7     7    > > RETURN                                                   <true>
    8     8*     > RETURN                                                   null

End of function checknum

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.62 ms | 1389 KiB | 14 Q