3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function __construct(){ if(isset($this)){ $this->baz = 10; }else{ return new self(); } } } var_dump(A::__construct());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EkI5Z
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_STATIC_METHOD_CALL                                  'A'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR                                                 $0
          4        DO_ICALL                                                 
          5      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 5
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EkI5Z
function name:  __construct
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ISSET_ISEMPTY_THIS                               ~0      
          1      > JMPZ                                                     ~0, ->5
    7     2    >   ASSIGN_OBJ                                               'baz'
          3        OP_DATA                                                  10
          4      > JMP                                                      ->8
    9     5    >   NEW                          self                $2      
          6        DO_FCALL                                      0          
          7      > RETURN                                                   $2
   11     8    > > RETURN                                                   null

End of function __construct

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.32 ms | 1395 KiB | 15 Q