3v4l.org

run code in 500+ PHP versions simultaneously
<?php class MyClassException extends Exception { public function __construct(string $message, public string $className = '') { parent::__construct($message); } } spl_autoload_register(static function ($className) { // Do magic class file loading here. throw new MyClassException('Class not found', $className); }); try { $a = unserialize('O:10:"DummyClass":0:{}'); } catch (MyClassException $e) { $a = null; // Or some other missing class handling } var_dump($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 9
Branch analysis from position: 9
2 jumps found. (Code = 107) Position 1 = 10, Position 2 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vYmts
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a, !1 = $e
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                                   'spl_autoload_register'
          1        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
   13     2        SEND_VAL                                                     ~2
   10     3        DO_ICALL                                                     
   16     4        INIT_FCALL                                                   'unserialize'
          5        SEND_VAL                                                     'O%3A10%3A%22DummyClass%22%3A0%3A%7B%7D'
          6        DO_ICALL                                             $4      
          7        ASSIGN                                                       !0, $4
          8      > JMP                                                          ->11
   17     9  E > > CATCH                                           last         'MyClassException'
   18    10    >   ASSIGN                                                       !0, null
   21    11    >   INIT_FCALL                                                   'var_dump'
         12        SEND_VAR                                                     !0
         13        DO_ICALL                                                     
         14      > 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/vYmts
function name:  {closure:/in/vYmts:10}
number of ops:  7
compiled vars:  !0 = $className
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
   12     1        NEW                                                  $1      'MyClassException'
          2        SEND_VAL_EX                                                  'Class+not+found'
          3        SEND_VAR_EX                                                  !0
          4        DO_FCALL                                          0          
          5      > THROW                                             0          $1
   13     6*     > RETURN                                                       null

End of Dynamic Function 0

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

End of function __construct

End of class MyClassException.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
152.08 ms | 492 KiB | 11 Q