source: src/router/php7/ext/opcache/tests/bug73746.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 2 months ago

update php

File size: 636 bytes
Line 
1--TEST--
2Bug #73746 (Method that returns string returns UNKNOWN:0 instead)
3--FILE--
4<?php
5namespace Core\Bundle\Service\Property\Room\Rooms;
6
7class CountryMapping
8{
9        const CZ = 'CZ';
10        const EN = 'EN';
11
12        public function get(string $countryIsoCode = null) : string // Works correctly if return type is removed
13        {
14                switch (strtoupper($countryIsoCode)) {
15                case 'CZ':
16                case 'SK':
17                        return self::CZ; // Works correctly if changed to CountryMapping::CZ
18                default:
19                        return self::EN; // Works correctly if changed to CountryMapping::EN
20                }
21        }
22}
23
24$mapping = new CountryMapping();
25var_dump($mapping->get('CZ'));
26?>
27--EXPECT--
28string(2) "CZ"
Note: See TracBrowser for help on using the repository browser.