3v4l.org

run code in 300+ PHP versions simultaneously
<?php class HelloWorld { public int $aaa = 5; /** * @return HelloWorld|null */ public function get(): ?HelloWorld { return null; } public function sayHello(): int { return $this->get()->aaa ?? 6; } } (new HelloWorld())->sayHello();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MJenT
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $0      'HelloWorld'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'sayHello'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Class HelloWorld:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MJenT
function name:  get
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                   null
   12     1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function get

Function sayhello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MJenT
function name:  sayHello
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_METHOD_CALL                                         'get'
          1        DO_FCALL                                      0  $0      
          2        FETCH_OBJ_IS                                     ~1      $0, 'aaa'
          3        COALESCE                                         ~2      ~1
          4        QM_ASSIGN                                        ~2      6
          5        VERIFY_RETURN_TYPE                                       ~2
          6      > RETURN                                                   ~2
   16     7*       VERIFY_RETURN_TYPE                                       
          8*     > RETURN                                                   null

End of function sayhello

End of class HelloWorld.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.35 ms | 1010 KiB | 13 Q