3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); use JetBrains\PhpStorm\NoReturn; \set_error_handler(static function (int $errno, string $errstr, string $errfile, int $errline): bool { throw new \ErrorException($errstr, 0, $errno, $errfile, $errline); }); //\register_shutdown_function(static function (): void { // $error = \error_get_last(); // // if ($error !== null) { // throw new \ErrorException($error['message'], 0, $error['type'], $error['file'], $error['line']); // } //}); echo (new class { #[NoReturn] public function __invoke(): string { try { trigger_error('trigger_error was called!', E_USER_ERROR); exit('exit was called!'); return 'Hello, World!'; } catch (\Throwable $e) { return $e->getMessage(); } return 'exit was skipped!'; } })();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PpKuY
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'set_error_handler'
          1        DECLARE_LAMBDA_FUNCTION                          ~0      [0]
    9     2        SEND_VAL                                                 ~0
    7     3        DO_ICALL                                                 
   19     4        DECLARE_ANON_CLASS                               <unknown> 
          5        NEW                                              $3      $2
          6        DO_FCALL                                      0          
          7        INIT_DYNAMIC_CALL                                        $3
   31     8        DO_FCALL                                      0  $5      
   19     9        ECHO                                                     $5
   31    10      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/PpKuY
function name:  {closure}
number of ops:  14
compiled vars:  !0 = $errno, !1 = $errstr, !2 = $errfile, !3 = $errline
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        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
    9    12*       VERIFY_RETURN_TYPE                                       
         13*     > RETURN                                                   null

End of Dynamic Function 0

Class class@anonymous:
Function __invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
Found catch point at position: 7
Branch analysis from position: 7
2 jumps found. (Code = 107) Position 1 = 8, Position 2 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PpKuY
function name:  __invoke
number of ops:  15
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_FCALL                                               'trigger_error'
          1        SEND_VAL                                                 'trigger_error+was+called%21'
          2        SEND_VAL                                                 256
          3        DO_ICALL                                                 
   24     4      > EXIT                                                     'exit+was+called%21'
   25     5*       RETURN                                                   'Hello%2C+World%21'
          6*       JMP                                                      ->12
   26     7  E > > CATCH                                       last         'Throwable'
   27     8    >   INIT_METHOD_CALL                                         !0, 'getMessage'
          9        DO_FCALL                                      0  $2      
         10        VERIFY_RETURN_TYPE                                       $2
         11      > RETURN                                                   $2
   29    12*       RETURN                                                   'exit+was+skipped%21'
   30    13*       VERIFY_RETURN_TYPE                                       
         14*     > RETURN                                                   null

End of function __invoke

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.71 ms | 1016 KiB | 15 Q