3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_error_handler('myErrorHandler'); register_shutdown_function('fatalErrorShutdownHandler'); echo 'Fatal Error Handler ..'; function myErrorHandler($code, $message, $file, $line) { var_dump($message); } function fatalErrorShutdownHandler() { $last_error = error_get_last(); if ($last_error['type'] === E_ERROR) { // fatal error myErrorHandler(E_ERROR, $last_error['message'], $last_error['file'], $last_error['line']); } } final class Email { const EMAIL = "me@where.com"; private function __destruct() { echo 'Destroying ...',"\n"; return; } } $vo = new Email; echo $vo::EMAIL,"\n"; try { $vo = null; echo 'nullified',"\n"; } catch(Exception $e) { echo 'caught it',"\n"; echo $e->getMessage(); } finally { echo "You should not destroy the value object","\n"; } var_dump($vo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 162) Position 1 = 26, Position 2 = 25
Branch analysis from position: 26
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 18
Branch analysis from position: 18
2 jumps found. (Code = 107) Position 1 = 19, Position 2 = -2
Branch analysis from position: 19
2 jumps found. (Code = 162) Position 1 = 26, Position 2 = 25
Branch analysis from position: 26
Branch analysis from position: 25
filename:       /in/3vvFj
function name:  (null)
number of ops:  33
compiled vars:  !0 = $vo, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'set_error_handler'
          1        SEND_VAL                                                 'myErrorHandler'
          2        DO_ICALL                                                 
    5     3        INIT_FCALL                                               'register_shutdown_function'
          4        SEND_VAL                                                 'fatalErrorShutdownHandler'
          5        DO_ICALL                                                 
    6     6        ECHO                                                     'Fatal+Error+Handler+..'
   31     7        NEW                                              $4      'Email'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !0, $4
   32    10        FETCH_CLASS                                   0  $7      !0
         11        FETCH_CLASS_CONSTANT                             ~8      $7, 'EMAIL'
         12        ECHO                                                     ~8
         13        ECHO                                                     '%0A'
   34    14        ASSIGN                                                   !0, null
   35    15        ECHO                                                     'nullified'
         16        ECHO                                                     '%0A'
         17      > JMP                                                      ->24
   36    18  E > > CATCH                                       last         'Exception'
   37    19    >   ECHO                                                     'caught+it'
         20        ECHO                                                     '%0A'
   38    21        INIT_METHOD_CALL                                         !1, 'getMessage'
         22        DO_FCALL                                      0  $11     
         23        ECHO                                                     $11
   39    24    > > FAST_CALL                                                ->26
         25    > > JMP                                                      ->29
   40    26    >   ECHO                                                     'You+should+not+destroy+the+value+object'
         27        ECHO                                                     '%0A'
         28      > FAST_RET                                                 
   42    29    >   INIT_FCALL                                               'var_dump'
         30        SEND_VAR                                                 !0
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Function myerrorhandler:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3vvFj
function name:  myErrorHandler
number of ops:  8
compiled vars:  !0 = $code, !1 = $message, !2 = $file, !3 = $line
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    8     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                                 
   10     7      > RETURN                                                   null

End of function myerrorhandler

Function fatalerrorshutdownhandler:
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 = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/3vvFj
function name:  fatalErrorShutdownHandler
number of ops:  16
compiled vars:  !0 = $last_error
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'error_get_last'
          1        DO_ICALL                                         $1      
          2        ASSIGN                                                   !0, $1
   15     3        FETCH_DIM_R                                      ~3      !0, 'type'
          4        IS_IDENTICAL                                             ~3, 1
          5      > JMPZ                                                     ~4, ->15
   17     6    >   INIT_FCALL                                               'myerrorhandler'
          7        SEND_VAL                                                 1
          8        FETCH_DIM_R                                      ~5      !0, 'message'
          9        SEND_VAL                                                 ~5
         10        FETCH_DIM_R                                      ~6      !0, 'file'
         11        SEND_VAL                                                 ~6
         12        FETCH_DIM_R                                      ~7      !0, 'line'
         13        SEND_VAL                                                 ~7
         14        DO_FCALL                                      0          
   19    15    > > RETURN                                                   null

End of function fatalerrorshutdownhandler

Class Email:
Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3vvFj
function name:  __destruct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   ECHO                                                     'Destroying+...'
          1        ECHO                                                     '%0A'
   27     2      > RETURN                                                   null
   28     3*     > RETURN                                                   null

End of function __destruct

End of class Email.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.05 ms | 1394 KiB | 22 Q