3v4l.org

run code in 500+ 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 = 12, 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: 12
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 = 12
Branch analysis from position: 12
Branch analysis from position: 10
Branch analysis from position: 10
filename:       /in/Ju5dp
function name:  get
number of ops:  17
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, ], ->12
   12     5    >   CASE                                                         $1, 'CZ'
          6      > JMPNZ                                                        ~2, ->10
   13     7    >   CASE                                                         $1, 'SK'
          8      > JMPNZ                                                        ~2, ->10
          9    > > JMP                                                          ->12
   14    10    >   FREE                                                         $1
         11      > RETURN                                                       'CZ'
   16    12    >   FREE                                                         $1
         13      > RETURN                                                       'EN'
         14*       FREE                                                         $1
   18    15*       VERIFY_RETURN_TYPE                                           
         16*     > RETURN                                                       null

End of function get

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

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
167.21 ms | 2533 KiB | 15 Q