3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Core\Bundle\Service\Property\Room\Rooms; class CountryMapping { const CZ = 'CZ'; const EN = 'EN'; public function get(string $countryIsoCode = null) : string // Works correctly if return type is removed { switch (strtoupper($countryIsoCode)) { case 'CZ': case 'SK': return self::CZ; // Works correctly if changed to CountryMapping::CZ default: return self::EN; // Works correctly if changed to CountryMapping::EN } } } $mapping = new CountryMapping(); var_dump($mapping->get('CZ'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ju5dp
function name:  (null)
number of ops:  10
compiled vars:  !0 = $mapping
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'Core%5CBundle%5CService%5CProperty%5CRoom%5CRooms%5CCountryMapping'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   22     3        INIT_NS_FCALL_BY_NAME                                    'Core%5CBundle%5CService%5CProperty%5CRoom%5CRooms%5Cvar_dump'
          4        INIT_METHOD_CALL                                         !0, 'get'
          5        SEND_VAL_EX                                              'CZ'
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR_NO_REF_EX                                       $4
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Class Core\Bundle\Service\Property\Room\Rooms\CountryMapping:
Function get:
Finding entry points
Branch analysis from position: 0
4 jumps found. (Code = 188) Position 1 = 10, Position 2 = 10, Position 3 = 14, Position 4 = 5
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 10
Branch analysis from position: 10
filename:       /in/Ju5dp
function name:  get
number of ops:  21
compiled vars:  !0 = $countryIsoCode
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV_INIT                                        !0      null
   11     1        INIT_NS_FCALL_BY_NAME                                    'Core%5CBundle%5CService%5CProperty%5CRoom%5CRooms%5Cstrtoupper'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $1      
          4      > SWITCH_STRING                                            $1, [ 'CZ':->10, 'SK':->10, ], ->14
   12     5    >   CASE                                                     $1, 'CZ'
          6      > JMPNZ                                                    ~2, ->10
   13     7    >   CASE                                                     $1, 'SK'
          8      > JMPNZ                                                    ~2, ->10
          9    > > JMP                                                      ->14
   14    10    >   FETCH_CLASS_CONSTANT                             ~3      'CZ'
         11        VERIFY_RETURN_TYPE                                       ~3
         12        FREE                                                     $1
         13      > RETURN                                                   ~3
   16    14    >   FETCH_CLASS_CONSTANT                             ~4      'EN'
         15        VERIFY_RETURN_TYPE                                       ~4
         16        FREE                                                     $1
         17      > RETURN                                                   ~4
         18*       FREE                                                     $1
   18    19*       VERIFY_RETURN_TYPE                                       
         20*     > RETURN                                                   null

End of function get

End of class Core\Bundle\Service\Property\Room\Rooms\CountryMapping.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.2 ms | 1400 KiB | 17 Q