3v4l.org

run code in 500+ PHP versions simultaneously
<?php final class DemoFile { /** * @var array{ * cache: array{directory: null} * } */ protected array $config = [ 'cache' => [ 'directory' => null, ], ]; public function getCacheDirectory(): ?string { $dir = $this->config['cache']['directory'] ?? null; \assert(\is_string($dir) || $dir === null, 'Invalid cache directory.'); return $dir; } } $demo = new DemoFile(); var_dump($demo->getCacheDirectory());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/02vqB
function name:  (null)
number of ops:  9
compiled vars:  !0 = $demo
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   25     0  E >   NEW                                                  $1      'DemoFile'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   26     3        INIT_FCALL                                                   'var_dump'
          4        INIT_METHOD_CALL                                             !0, 'getCacheDirectory'
          5        DO_FCALL                                          0  $4      
          6        SEND_VAR                                                     $4
          7        DO_ICALL                                                     
          8      > RETURN                                                       1

Class DemoFile:
Function getcachedirectory:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/02vqB
function name:  getCacheDirectory
number of ops:  19
compiled vars:  !0 = $dir
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   FETCH_OBJ_IS                                         ~1      'config'
          1        FETCH_DIM_IS                                         ~2      ~1, 'cache'
          2        FETCH_DIM_IS                                         ~3      ~2, 'directory'
          3        COALESCE                                             ~4      ~3
          4        QM_ASSIGN                                            ~4      null
          5        ASSIGN                                                       !0, ~4
   19     6        ASSERT_CHECK                                                 
          7        INIT_FCALL                                                   'assert'
          8        TYPE_CHECK                                       64  ~6      !0
          9      > JMPNZ_EX                                             ~6      ~6, ->12
         10    >   TYPE_CHECK                                        2  ~7      !0
         11        BOOL                                                 ~6      ~7
         12    >   SEND_VAL                                                     ~6
         13        SEND_VAL                                                     'Invalid+cache+directory.'
         14        DO_ICALL                                                     
   21    15        VERIFY_RETURN_TYPE                                           !0
         16      > RETURN                                                       !0
   22    17*       VERIFY_RETURN_TYPE                                           
         18*     > RETURN                                                       null

End of function getcachedirectory

End of class DemoFile.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.26 ms | 1113 KiB | 15 Q