3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types = 1); // lint >= 8.0 namespace Bug7109; class HelloWorld { public int $aaa = 5; /** * @return HelloWorld|null */ public function get(): ?HelloWorld { return rand() ? $this : null; } } $a = new HelloWorld(); $b = null; var_dump($a->get()->aaa ?? 6); var_dump($b->aaa ?? 7);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5TbIf
function name:  (null)
number of ops:  19
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   19     0  E >   NEW                                                  $2      'Bug7109%5CHelloWorld'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
   20     3        ASSIGN                                                       !1, null
   22     4        INIT_NS_FCALL_BY_NAME                                        'Bug7109%5Cvar_dump'
          5        INIT_METHOD_CALL                                             !0, 'get'
          6        DO_FCALL                                          0  $6      
          7        FETCH_OBJ_IS                                         ~7      $6, 'aaa'
          8        COALESCE                                             ~8      ~7
          9        QM_ASSIGN                                            ~8      6
         10        SEND_VAL_EX                                                  ~8
         11        DO_FCALL                                          0          
   23    12        INIT_NS_FCALL_BY_NAME                                        'Bug7109%5Cvar_dump'
         13        FETCH_OBJ_IS                                         ~10     !1, 'aaa'
         14        COALESCE                                             ~11     ~10
         15        QM_ASSIGN                                            ~11     7
         16        SEND_VAL_EX                                                  ~11
         17        DO_FCALL                                          0          
         18      > RETURN                                                       1

Class Bug7109\HelloWorld:
Function get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5TbIf
function name:  get
number of ops:  11
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   INIT_NS_FCALL_BY_NAME                                        'Bug7109%5Crand'
          1        DO_FCALL                                          0  $0      
          2      > JMPZ                                                         $0, ->6
          3    >   FETCH_THIS                                           ~1      
          4        QM_ASSIGN                                            ~2      ~1
          5      > JMP                                                          ->7
          6    >   QM_ASSIGN                                            ~2      null
          7    >   VERIFY_RETURN_TYPE                                           ~2
          8      > RETURN                                                       ~2
   16     9*       VERIFY_RETURN_TYPE                                           
         10*     > RETURN                                                       null

End of function get

End of class Bug7109\HelloWorld.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.49 ms | 1101 KiB | 14 Q