3v4l.org

run code in 300+ PHP versions simultaneously
<?php function inverse($x) { if (!$x) { throw new Exception('Division by zero.'); } return 1/$x; } try { echo inverse(5) . "\n"; echo inverse(0) . "\n"; } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; } echo inverse(0) . "\n"; echo intval(FALSE); echo !$x; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 11
Branch analysis from position: 11
2 jumps found. (Code = 107) Position 1 = 12, Position 2 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NrtCX
function name:  (null)
number of ops:  27
compiled vars:  !0 = $e, !1 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'inverse'
          1        SEND_VAL                                                 5
          2        DO_FCALL                                      0  $2      
          3        CONCAT                                           ~3      $2, '%0A'
          4        ECHO                                                     ~3
   12     5        INIT_FCALL                                               'inverse'
          6        SEND_VAL                                                 0
          7        DO_FCALL                                      0  $4      
          8        CONCAT                                           ~5      $4, '%0A'
          9        ECHO                                                     ~5
         10      > JMP                                                      ->17
   15    11  E > > CATCH                                       last         'Exception'
   16    12    >   ECHO                                                     'Caught+exception%3A+'
         13        INIT_METHOD_CALL                                         !0, 'getMessage'
         14        DO_FCALL                                      0  $6      
         15        ECHO                                                     $6
         16        ECHO                                                     '%0A'
   18    17    >   INIT_FCALL                                               'inverse'
         18        SEND_VAL                                                 0
         19        DO_FCALL                                      0  $7      
         20        CONCAT                                           ~8      $7, '%0A'
         21        ECHO                                                     ~8
   20    22        CAST                                          4  ~9      <false>
         23        ECHO                                                     ~9
   21    24        BOOL_NOT                                         ~10     !1
         25        ECHO                                                     ~10
   22    26      > RETURN                                                   1

Function inverse:
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/NrtCX
function name:  inverse
number of ops:  10
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        BOOL_NOT                                         ~1      !0
          2      > JMPZ                                                     ~1, ->7
    4     3    >   NEW                                              $2      'Exception'
          4        SEND_VAL_EX                                              'Division+by+zero.'
          5        DO_FCALL                                      0          
          6      > THROW                                         0          $2
    6     7    >   DIV                                              ~4      1, !0
          8      > RETURN                                                   ~4
    7     9*     > RETURN                                                   null

End of function inverse

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.69 ms | 1394 KiB | 16 Q