3v4l.org

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

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

End of function myerrorhandler

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.25 ms | 1403 KiB | 18 Q