TGStat
TGStat
Type to search
Advanced channel search
  • flag English
    Site language
    flag Russian flag English flag Uzbek
  • Sign In
  • Catalog
    Channels and groups catalog Search for channels
    Add a channel/group
  • Ratings
    Rating of channels Rating of groups Posts rating
    Ratings of brands and people
  • Analytics
  • Search by posts
  • Telegram monitoring
PHP - Laravel uz

9 Sep 2024, 19:58

Open in Telegram Share Report

Asymmetric Visibility

PHP`da object property`lari uchun public, protected yoki private visibility`lar berish mumkin. Bu qoida property`ni o'qish (get) va yozish (set) uchun bir xil - simmetrik ishlaydi.

PHP 8.4 da visibility`ga asimmetrik, ya'ni o'qish va yozish uchun turlicha qiymatlar berish imkoniyati qo'shiladi.

Quyidagi misolda bar nomli property`ni o'qish mumkin, lekin unga yozish mumkin emas:

class Foo
{
public private(set) string $bar = 'baz';
}

$foo = new Foo();
var_dump($foo->bar); // prints "baz"
$foo->bar = 'beep'; // Visibility error

RFC: https://wiki.php.net/rfc/asymmetric-visibility-v2

#php84
@PhpLaravelUz

314 0 2 7
Catalog
Channels and groups catalog Channels compilations Search for channels Add a channel/group
Ratings
Rating of Telegram channels Rating of Telegram groups Posts rating Ratings of brands and people
API
API statistics Search API of posts API Callback
Our channels
@TGStat @TGStat_Chat @telepulse @TGStatAPI
Read
Академия TGStat Telegram Research 2019 Telegram Research 2021 Telegram Research 2023
Contacts
Справочный центр Support Email Jobs
Miscellaneous
Terms and conditions Privacy policy Public offer
Our bots
@TGStat_Bot @SearcheeBot @TGAlertsBot @tg_analytics_bot @TGStatChatBot