3v4l.org

run code in 300+ PHP versions simultaneously
<?php function exception_error_handler($errno, $errstr, $errfile, $errline ) { throw new ErrorException($errstr, 0, $errno, $errfile, $errline); } set_error_handler("exception_error_handler"); function exception_handler($exception) { /*$min = ...; $max = ...; if ($exception->getCode() >= $min && $exception->getCode() <= $max) { // log exception }*/ } set_exception_handler('exception_handler'); function my_function($param1, $param2) { // do something great } try { my_function('only_one_param'); } catch (AppException $exception) { echo $exception->getMessage(); } /* 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: 10
Branch analysis from position: 10
2 jumps found. (Code = 107) Position 1 = 11, Position 2 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/On2ET
function name:  (null)
number of ops:  15
compiled vars:  !0 = $exception
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'set_error_handler'
          1        SEND_VAL                                                 'exception_error_handler'
          2        DO_ICALL                                                 
   20     3        INIT_FCALL                                               'set_exception_handler'
          4        SEND_VAL                                                 'exception_handler'
          5        DO_ICALL                                                 
   31     6        INIT_FCALL                                               'my_function'
          7        SEND_VAL                                                 'only_one_param'
          8        DO_FCALL                                      0          
          9      > JMP                                                      ->14
   33    10  E > > CATCH                                       last         'AppException'
   35    11    >   INIT_METHOD_CALL                                         !0, 'getMessage'
         12        DO_FCALL                                      0  $4      
         13        ECHO                                                     $4
   71    14    > > RETURN                                                   1

Function exception_error_handler:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/On2ET
function name:  exception_error_handler
number of ops:  13
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        NEW                                              $4      'ErrorException'
          5        SEND_VAR_EX                                              !1
          6        SEND_VAL_EX                                              0
          7        SEND_VAR_EX                                              !0
          8        SEND_VAR_EX                                              !2
          9        SEND_VAR_EX                                              !3
         10        DO_FCALL                                      0          
         11      > THROW                                         0          $4
    5    12*     > RETURN                                                   null

End of function exception_error_handler

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

End of function exception_handler

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

End of function my_function

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159 ms | 1403 KiB | 18 Q