php

Back Open Paginator
22.12.2025 18:42
habr (@habr@zhub.link)

Хуки свойств в PHP: геттеры и сеттеры не нужны

В версии 8.4 наконец‑то появилась одна из тех фич, о которых давно мечтали многие, — хуки свойств. Что это такое? По сути, это встроенные механизмы get/set для свойств объектов, которые позволяют добавить свою логику при чтении или записи значения прямо внутри определения свойства. Никаких больше громоздких геттеров и сеттеров, никаких загадочных get и set , теперь всё можно сделать красиво и понятно на уровне самих свойств.

habr.com/ru/companies/otus/art

#php #PHP_84 #хуки_свойств #геттеры_и_сеттеры #свойства_объектов #инкапсуляция #виртуальные_свойства #рефакторинг




Show Original Post


22.12.2025 17:10
TurboLearnPHP (@TurboLearnPHP@mastodon.social)

Magic Numbers - Hardcoded vs Constants

⚡ Magic Numbers - Hardcoded vs Constants - Code quality comparison! Junior developers make common mistakes, senior devs write clean code. Learn from this! Which approach do you use?

youtube.com/watch?v=Jl8JXb1kjbU




Show Original Post


22.12.2025 16:45
neoacevedo (@neoacevedo@mastodon.social)

ko-fi.com/s/042ead1675

I've made this little Yii2 component for storage management in cloud. It supports AWS S3, Azure Blob Storage, Google Cloud Storage but also it can be used for local storage.




Show Original Post


22.12.2025 16:31
Crell (@Crell@phpc.social)

@richardjh @lenko @unknoxx Quality of the technology and market success have almost nothing to do with each other, in practice.

It is quite sad, but painfully true.

#PHP needs a new killer app or killer use case.




Show Original Post


22.12.2025 15:59
TurboLearnPHP (@TurboLearnPHP@mastodon.social)

Ternary Associativity

PHP ternary operator is left-associative! This trap catches everyone. Can you predict the output?

youtube.com/watch?v=qN3jEXSPiZc




Show Original Post


22.12.2025 15:37
kukuk (@kukuk@toot.community)

After unsuccessfully grappling with more than half a dozen PHP-based open source CMS & gallery apps, I just feel like saying:
Fuck #PHP. May it die soon. May it roast in hell forever.




Show Original Post


22.12.2025 15:10
jclermont (@jclermont@phpc.social)

I was helping a client in one of their private package repos and they wondered why I deleted the composer.lock they had committed. Here are a few reasons. #php #laravel masteringlaravel.io/daily/2025




Show Original Post


22.12.2025 14:44
backpackforlaravel (@backpackforlaravel@mstdn.social)

#Laravel #PHP

Do you map or loop? 👇

Functional elegance or just fancy syntax? What do you think👇





Show Original Post


22.12.2025 14:18
norbert (@norbert@phpc.social)

Data processing in #PHP is still in it's early stages. Don't believe me? Look at your system and tell me how it's handling imports/exports.
Is it perhaps hand written importer/exporter?
Any chance it's using file_get_contents?

What stops you from using a Data Frame?





Show Original Post


22.12.2025 12:16
lenko (@lenko@masto.es)

@unknoxx

PHP had a very strong early period, competing with ASP, which was a very rigid technology. It grew rapidly and somewhat wildly, and was massively adopted thanks to the rise of cheap servers with LAMP stacks and WordPress.

Between the language itself and the number of people who programmed terribly, it gained a reputation (not entirely undeserved) among professionals that has become ingrained in their collective consciousness and is still present through jokes and memes.

From version 7 onwards, with Composer, Symfony, Laravel, and other frameworks, programming in PHP is nothing like it used to be, but it's very difficult to change an idea once it becomes universal.

#php




Show Original Post


22.12.2025 10:48
nyamsprod (@nyamsprod@phpc.social)

I will postpone the release of the next minor version of the URI toolkit to next year to give me room for the holidays but more importantly because some fixes that will impact all the packages still need some ironing in regards to PHP versions and the upcoming new URI RFC in the works. You may voice your opinion in the PR github.com/thephpleague/uri-sr or in the RFC discussion externals.io/message/129486 some big changes are coming to #PHP #URI #query




Show Original Post


22.12.2025 10:41
unknoxx (@unknoxx@mastodon.social)

Why do many devs have this "mixed feelings" related to PHP?

I'm learning it, while working on forms with the POST method and this question keeps coming back in the back of my mind.

Is the criticism mostly historical or something relevant today?




Show Original Post


1 ...242 243 244 245 246 247 248 249 250 251 252 ...527
UP