3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); $i = 1; $s = ''; $_type_enforcer = new class($i, $s) { public function __construct( public int &$i, public string &$s ) {} }; try { $i = ''; } catch (\Throwable $e) { echo $e->getMessage(), PHP_EOL; } try { $s = 1; } catch (\Throwable $e) { echo $e->getMessage(), PHP_EOL; } unset($_type_enforcer); try { $i = ''; } catch (\Throwable $e) { echo $e->getMessage(), PHP_EOL; } try { $s = 1; } catch (\Throwable $e) { echo $e->getMessage(), PHP_EOL; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
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 = 42) Position 1 = 22
Branch analysis from position: 22
Found catch point at position: 17
Branch analysis from position: 17
2 jumps found. (Code = 107) Position 1 = 18, Position 2 = -2
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
Found catch point at position: 25
Branch analysis from position: 25
2 jumps found. (Code = 107) Position 1 = 26, Position 2 = -2
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Found catch point at position: 32
Branch analysis from position: 32
2 jumps found. (Code = 107) Position 1 = 33, Position 2 = -2
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hNJnK
function name:  (null)
number of ops:  38
compiled vars:  !0 = $i, !1 = $s, !2 = $_type_enforcer, !3 = $e
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                       !0, 1
    6     1        ASSIGN                                                       !1, ''
    8     2        DECLARE_ANON_CLASS                                   <object> 
          3        NEW                                                  $7      $6
          4        SEND_VAR_EX                                                  !0
          5        SEND_VAR_EX                                                  !1
          6        DO_FCALL                                          0          
          7        ASSIGN                                                       !2, $7
   16     8        ASSIGN                                                       !0, ''
          9      > JMP                                                          ->15
   17    10  E > > CATCH                                           last         'Throwable'
   18    11    >   INIT_METHOD_CALL                                             !3, 'getMessage'
         12        DO_FCALL                                          0  $11     
         13        ECHO                                                         $11
         14        ECHO                                                         '%0A'
   22    15    >   ASSIGN                                                       !1, 1
         16      > JMP                                                          ->22
   23    17  E > > CATCH                                           last         'Throwable'
   24    18    >   INIT_METHOD_CALL                                             !3, 'getMessage'
         19        DO_FCALL                                          0  $13     
         20        ECHO                                                         $13
         21        ECHO                                                         '%0A'
   27    22    >   UNSET_CV                                                     !2
   30    23        ASSIGN                                                       !0, ''
         24      > JMP                                                          ->30
   31    25  E > > CATCH                                           last         'Throwable'
   32    26    >   INIT_METHOD_CALL                                             !3, 'getMessage'
         27        DO_FCALL                                          0  $15     
         28        ECHO                                                         $15
         29        ECHO                                                         '%0A'
   36    30    >   ASSIGN                                                       !1, 1
         31      > JMP                                                          ->37
   37    32  E > > CATCH                                           last         'Throwable'
   38    33    >   INIT_METHOD_CALL                                             !3, 'getMessage'
         34        DO_FCALL                                          0  $17     
         35        ECHO                                                         $17
         36        ECHO                                                         '%0A'
   39    37    > > RETURN                                                       1

Class class@anonymous:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hNJnK
function name:  __construct
number of ops:  7
compiled vars:  !0 = $i, !1 = $s
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
   11     1        RECV                                                 !1      
   10     2        ASSIGN_OBJ_REF                                               'i'
          3        OP_DATA                                                      !0
   11     4        ASSIGN_OBJ_REF                                               's'
          5        OP_DATA                                                      !1
   12     6      > RETURN                                                       null

End of function __construct

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
166.93 ms | 1738 KiB | 13 Q