3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class Foo { public function __construct(int $integer) { $this->integer = $integer; } } try { $foo = new Foo('1'); } catch (TypeError $e) { } finally { assert(isset($e), 'TypeError was thrown'); assert(!isset($foo), '$foo is unset'); } $foo = (new ReflectionClass(Foo::class))->newInstance('1'); var_dump($foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
2 jumps found. (Code = 162) Position 1 = 8, Position 2 = 7
Branch analysis from position: 8
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
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
filename:       /in/aZTJl
function name:  (null)
number of ops:  33
compiled vars:  !0 = $foo, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $3      'Foo'
          1        SEND_VAL_EX                                              '1'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
          4      > JMP                                                      ->6
   11     5  E > > CATCH                                       last         'TypeError'
   12     6    > > FAST_CALL                                                ->8
          7    > > JMP                                                      ->22
   13     8    >   ASSERT_CHECK                                             
          9        INIT_FCALL                                               'assert'
         10        ISSET_ISEMPTY_CV                                 ~6      !1
         11        SEND_VAL                                                 ~6
         12        SEND_VAL                                                 'TypeError+was+thrown'
         13        DO_ICALL                                                 
   14    14        ASSERT_CHECK                                             
         15        INIT_FCALL                                               'assert'
         16        ISSET_ISEMPTY_CV                                 ~8      !0
         17        BOOL_NOT                                         ~9      ~8
         18        SEND_VAL                                                 ~9
         19        SEND_VAL                                                 '%24foo+is+unset'
         20        DO_ICALL                                                 
         21      > FAST_RET                                                 
   17    22    >   NEW                                              $11     'ReflectionClass'
         23        SEND_VAL_EX                                              'Foo'
         24        DO_FCALL                                      0          
         25        INIT_METHOD_CALL                                         $11, 'newInstance'
         26        SEND_VAL_EX                                              '1'
         27        DO_FCALL                                      0  $13     
         28        ASSIGN                                                   !0, $13
   18    29        INIT_FCALL                                               'var_dump'
         30        SEND_VAR                                                 !0
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

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

End of function __construct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.74 ms | 1016 KiB | 15 Q