1
0
mirror of https://github.com/php/php-src.git synced 2026-03-28 02:02:32 +01:00
Files
archived-php-src/ext/opcache/tests/bug73746.phpt
Max Semenik e9f783fcdd Migrate skip checks to --EXTENSIONS--, p3
For rationale, see #6787

Extensions migrated in part 3:
* ftp
* gmp
* iconv
* opcache
* shmop
2021-04-03 15:23:25 +02:00

31 lines
722 B
PHP

--TEST--
Bug #73746 (Method that returns string returns UNKNOWN:0 instead)
--EXTENSIONS--
opcache
--FILE--
<?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'));
?>
--EXPECT--
string(2) "CZ"