Tagged articles
3 articles
Page 1 of 1
Open Source Tech Hub
Open Source Tech Hub
Jul 17, 2025 · Backend Development

How PHP’s #[\NoDiscard] Attribute Prevents Silent Return‑Value Bugs

The article explains PHP 8.5’s #[\NoDiscard] attribute, showing how it forces developers to handle function return values, provides syntax and usage examples, demonstrates real‑world scenarios, and describes ways to suppress warnings when the return value is intentionally ignored.

attributenodiscardphp8.5
0 likes · 5 min read
How PHP’s #[\NoDiscard] Attribute Prevents Silent Return‑Value Bugs
php Courses
php Courses
May 9, 2024 · Backend Development

Using Enums in PHP: Interfaces, Traits, Attributes, and Best Practices

This article explains PHP enums, showing how they improve code readability and safety, and demonstrates their integration with interfaces, traits, attributes, validation rules, casting, and matching mechanisms, providing practical examples and best‑practice recommendations for backend developers.

InterfacePHPattribute
0 likes · 7 min read
Using Enums in PHP: Interfaces, Traits, Attributes, and Best Practices
php Courses
php Courses
Feb 6, 2024 · Backend Development

Method‑Based Model Casting in Laravel 11

Laravel 11 introduces a method‑based model casting system that replaces the traditional $casts property, allowing developers to define type conversions via Attribute methods, which improves code clarity, flexibility, testability, and overall maintainability of Eloquent models.

Backend DevelopmentEloquentLaravel
0 likes · 7 min read
Method‑Based Model Casting in Laravel 11