3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { public function __construct( $author, ) { if (is_int($author)) { throw new \InvalidArgumentException('oh no'); } } } try { new A(author: 100); } catch (\Exception $e) { echo $e->getMessage(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 6
Branch analysis from position: 6
2 jumps found. (Code = 107) Position 1 = 7, Position 2 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8J86F
function name:  (null)
number of ops:  11
compiled vars:  !0 = $e
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   NEW                                                  $1      'A'
          1        SEND_VAL_EX                                                  100, 'author'
          2        CHECK_UNDEF_ARGS                                             
          3        DO_FCALL                                          1          
          4        FREE                                                         $1
          5      > JMP                                                          ->10
   16     6  E > > CATCH                                           last         'Exception'
   17     7    >   INIT_METHOD_CALL                                             !0, 'getMessage'
          8        DO_FCALL                                          0  $3      
          9        ECHO                                                         $3
   18    10    > > RETURN                                                       1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8J86F
function name:  __construct
number of ops:  8
compiled vars:  !0 = $author
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
    7     1        TYPE_CHECK                                       16          !0
          2      > JMPZ                                                         ~1, ->7
    8     3    >   NEW                                                  $2      'InvalidArgumentException'
          4        SEND_VAL_EX                                                  'oh+no'
          5        DO_FCALL                                          0          
          6      > THROW                                             0          $2
   10     7    > > RETURN                                                       null

End of function __construct

End of class A.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
128.1 ms | 476 KiB | 7 Q