3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyJobHandlerException extends Exception { public function __construct(string $message, public readonly int $jobId, ?\Throwable $previous = null) { parent::__construct($message, previous: $previous); } } function execute_job(int $jobId) { throw new \Exception('execute_job failed'); } function runner() { $jobId = 1; try { execute_job($jobId); } catch (\Throwable $e) { throw new MyJobHandlerException('Wrapping the exception', $jobId, $e); } } runner();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2pc2Z
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_FCALL                                               'runner'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function execute_job:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/2pc2Z
function name:  execute_job
number of ops:  6
compiled vars:  !0 = $jobId
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        NEW                                              $1      'Exception'
          2        SEND_VAL_EX                                              'execute_job+failed'
          3        DO_FCALL                                      0          
          4      > THROW                                         0          $1
   11     5*     > RETURN                                                   null

End of function execute_job

Function runner:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 5
Branch analysis from position: 5
2 jumps found. (Code = 107) Position 1 = 6, Position 2 = -2
Branch analysis from position: 6
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/2pc2Z
function name:  runner
number of ops:  13
compiled vars:  !0 = $jobId, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, 1
   16     1        INIT_FCALL                                               'execute_job'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
          4      > JMP                                                      ->12
   17     5  E > > CATCH                                       last         'Throwable'
   18     6    >   NEW                                              $4      'MyJobHandlerException'
          7        SEND_VAL_EX                                              'Wrapping+the+exception'
          8        SEND_VAR_EX                                              !0
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0          
         11      > THROW                                         0          $4
   20    12    > > RETURN                                                   null

End of function runner

Class MyJobHandlerException:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2pc2Z
function name:  __construct
number of ops:  11
compiled vars:  !0 = $message, !1 = $jobId, !2 = $previous
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      null
          3        ASSIGN_OBJ                                               'jobId'
          4        OP_DATA                                                  !1
    5     5        INIT_STATIC_METHOD_CALL                                  
          6        SEND_VAR_EX                                              !0
          7        SEND_VAR_EX                                              !2, 'previous'
          8        CHECK_UNDEF_ARGS                                         
          9        DO_FCALL                                      1          
    6    10      > RETURN                                                   null

End of function __construct

End of class MyJobHandlerException.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.71 ms | 1003 KiB | 15 Q