3v4l.org

run code in 500+ PHP versions simultaneously
<?php final class DemoFile { private readonly string $method; public static function create(int $a): static { $self = new static(); $self->method = 'hi'; if ($a > 0) { $self->method = 'hello'; } return $self; } } $demo = DemoFile::create(2); var_dump($demo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hv7TE
function name:  (null)
number of ops:  8
compiled vars:  !0 = $demo
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   INIT_STATIC_METHOD_CALL                                      'DemoFile', 'create'
          1        SEND_VAL                                                     2
          2        DO_FCALL                                          0  $1      
          3        ASSIGN                                                       !0, $1
   19     4        INIT_FCALL                                                   'var_dump'
          5        SEND_VAR                                                     !0
          6        DO_ICALL                                                     
          7      > RETURN                                                       1

Class DemoFile:
Function create:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/hv7TE
function name:  create
number of ops:  14
compiled vars:  !0 = $a, !1 = $self
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
    9     1        NEW                              static              $2      
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !1, $2
   10     4        ASSIGN_OBJ                                                   !1, 'method'
          5        OP_DATA                                                      'hi'
   11     6        IS_SMALLER                                                   0, !0
          7      > JMPZ                                                         ~6, ->10
   12     8    >   ASSIGN_OBJ                                                   !1, 'method'
          9        OP_DATA                                                      'hello'
   14    10    >   VERIFY_RETURN_TYPE                                           !1
         11      > RETURN                                                       !1
   15    12*       VERIFY_RETURN_TYPE                                           
         13*     > RETURN                                                       null

End of function create

End of class DemoFile.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.33 ms | 1299 KiB | 13 Q