3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_error_handler('myerrorhandler'); set_exception_handler('myexceptionhandler'); function myfunc(stdClass $a) {} function myerrorhandler($errno, $errstr, $errfile, $errline, $errcontext) { echo "Error handler\n$errno\n$errstr\n"; } function myexceptionhandler($e) { echo "Exception handler\n";var_dump($e); } try { myfunc('iamnotaclass'); } catch (Exception $e) { echo "Exception\n"; throw $e; } catch (Throwable $e) { echo "Throwable\n"; throw $e; }
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: 10
Branch analysis from position: 10
2 jumps found. (Code = 107) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
1 jumps found. (Code = 108) Position 1 = -2
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 = 108) Position 1 = -2
Found catch point at position: 14
Branch analysis from position: 14
filename:       /in/GdYhX
function name:  (null)
number of ops:  18
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'set_error_handler'
          1        SEND_VAL                                                 'myerrorhandler'
          2        DO_ICALL                                                 
    3     3        INIT_FCALL                                               'set_exception_handler'
          4        SEND_VAL                                                 'myexceptionhandler'
          5        DO_ICALL                                                 
   13     6        INIT_FCALL                                               'myfunc'
          7        SEND_VAL                                                 'iamnotaclass'
          8        DO_FCALL                                      0          
          9      > JMP                                                      ->17
   14    10  E > > CATCH                                                    'Exception', ->14
   15    11    >   ECHO                                                     'Exception%0A'
   16    12      > THROW                                         0          !0
         13*       JMP                                                      ->17
   17    14  E > > CATCH                                       last         'Throwable'
   18    15    >   ECHO                                                     'Throwable%0A'
   19    16      > THROW                                         0          !0
   20    17    > > RETURN                                                   1

Function myfunc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GdYhX
function name:  myfunc
number of ops:  2
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function myfunc

Function myerrorhandler:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GdYhX
function name:  myerrorhandler
number of ops:  12
compiled vars:  !0 = $errno, !1 = $errstr, !2 = $errfile, !3 = $errline, !4 = $errcontext
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
          4        RECV                                             !4      
    6     5        ROPE_INIT                                     5  ~6      'Error+handler%0A'
          6        ROPE_ADD                                      1  ~6      ~6, !0
          7        ROPE_ADD                                      2  ~6      ~6, '%0A'
          8        ROPE_ADD                                      3  ~6      ~6, !1
          9        ROPE_END                                      4  ~5      ~6, '%0A'
         10        ECHO                                                     ~5
    7    11      > RETURN                                                   null

End of function myerrorhandler

Function myexceptionhandler:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GdYhX
function name:  myexceptionhandler
number of ops:  6
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        ECHO                                                     'Exception+handler%0A'
          2        INIT_FCALL                                               'var_dump'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
   10     5      > RETURN                                                   null

End of function myexceptionhandler

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.68 ms | 1403 KiB | 20 Q