3v4l.org

run code in 300+ PHP versions simultaneously
<?php function myErrorHandler($errno, $errstr, $errfile, $errline) { if ( E_RECOVERABLE_ERROR===$errno ) { echo "'catched' catchable fatal error\n"; throw new ErrorException($errstr, $errno, 0, $errfile, $errline); // return true; } return false; } set_error_handler('myErrorHandler'); class ClassA { public function method_a (ClassB $b) {} } class ClassWrong{} try{ $a = new ClassA; $a->method_a(new ClassWrong); } catch(Exception $ex) { echo "catched\n"; } echo 'done.'; /* throw new MyException('This is a really bad error', 123); final public ExceptionException::getPrevious ( void ) error_reporting(E_ALL); function exception_error_handler($errno, $errstr, $errfile, $errline ) { throw new ErrorException($errstr, '00007600', $errno, $errfile, $errline, new Exception('jjj')); } set_error_handler("exception_error_handler"); try { echo $x; } catch(Exception $e) { var_dump($e->getPrevious()); }*/
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 12
Branch analysis from position: 12
2 jumps found. (Code = 107) Position 1 = 13, Position 2 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mFJCT
function name:  (null)
number of ops:  16
compiled vars:  !0 = $a, !1 = $ex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'set_error_handler'
          1        SEND_VAL                                                 'myErrorHandler'
          2        DO_ICALL                                                 
   20     3        NEW                                              $3      'ClassA'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $3
   21     6        INIT_METHOD_CALL                                         !0, 'method_a'
          7        NEW                                              $6      'ClassWrong'
          8        DO_FCALL                                      0          
          9        SEND_VAR_NO_REF_EX                                       $6
         10        DO_FCALL                                      0          
         11      > JMP                                                      ->14
   23    12  E > > CATCH                                       last         'Exception'
   24    13    >   ECHO                                                     'catched%0A'
   26    14    >   ECHO                                                     'done.'
   60    15      > RETURN                                                   1

Function myerrorhandler:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mFJCT
function name:  myErrorHandler
number of ops:  17
compiled vars:  !0 = $errno, !1 = $errstr, !2 = $errfile, !3 = $errline
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    4     4        IS_IDENTICAL                                             !0, 4096
          5      > JMPZ                                                     ~4, ->15
    5     6    >   ECHO                                                     '%27catched%27+catchable+fatal+error%0A'
    6     7        NEW                                              $5      'ErrorException'
          8        SEND_VAR_EX                                              !1
          9        SEND_VAR_EX                                              !0
         10        SEND_VAL_EX                                              0
         11        SEND_VAR_EX                                              !2
         12        SEND_VAR_EX                                              !3
         13        DO_FCALL                                      0          
         14      > THROW                                         0          $5
    9    15    > > RETURN                                                   <false>
   10    16*     > RETURN                                                   null

End of function myerrorhandler

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

End of function method_a

End of class ClassA.

Class ClassWrong: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
187.5 ms | 1400 KiB | 15 Q