/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/opcache/tests/bug73746.phpt
30 строк
723 B
Máté Kocsis
Deprecate implicit nullable parameter types (#12959)
13 мар 2024, 23:40
Не верифицирован
13 мар 2024, 23:40
330cc5c
Код
Авторство
О чём код?
--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"