Bookmarks tagged with #php.
Show all
Show all
PHP 7: Type-safe Arrays of Objects
With PHP 7 you can choose to write much more type-safe code than before, thanks to scalar type hints and return types. But what about arrays? There’s still only the generic “array” type hint, you cannot specify what’s in the array. For the IDE, you can add PhpDoc comments:
Tags:
#php
Saved
on: 2024-08-21
Building a Better PHP Project: What Tools Should I Not Miss?
I've just been handed a PHP project that's a bit of a blank slate – no static analysis, linters, coding standards, or tests have been used so far. N
Saved
on: 2023-12-15
Design Patterns in PHP 8 Series' Articles - DEV Community
Design Patterns in PHP 8 Series' Articles Back to Max Zhuk's Series Jul 20 '22 Design Patterns in PHP 8: Singleton & Multiton #php #webdev #programming #oop 71 9 3 min read Jul 22 '22 Design Patterns in PHP 8: alternative implementations #php #webdev #programming #oop 51 4 2 min read Jul 31 '22 Desi
Saved
on: 2023-09-08
PHP Fibers: A practical example
PHP 8.1 introduced Fibers as a new feature of the language. I often see many people refer to fibers as threads, which is not accurate and I think gives some people the idea that PHP is somehow now multithreaded.
Tags:
#php
Saved
on: 2023-08-22
(4) PHP doesn't suck (anymore) - YouTube
PHP in 2023 is very different than PHP in 2012. Let's run through some of the changes!
Looking for PHP jobs or looking to hire PHP devs? Check out Larajobs: https://larajobs.com/?partner=108
Follow me:
Twitter: https://twitter.com/aarondfrancis
LinkedIn: https://www.linkedin.com/in/aarondfrancis
Saved
on: 2023-08-17
Route Binding in Laravel - Ahmed Ash
In your Laravel projects, how do you go about setting up routes for a particular resource? Do you do it in the following manner? Then, do you implement it like this in your ArticlesController?
Saved
on: 2023-08-08
Testing without mocking frameworks.
Over the years, my coding practices have changed a lot. From hacking away until it works to TDD/BDD/DDD and everything in between. One of the biggest changes in my developer career has been when, why, and how I test my code. In particular, my view on mocking frameworks has changed a lot.
Saved
on: 2023-03-28
Steve vs Matt — How two developers approach the same problem | Laravel News
It's very common to see two programmers who code the same feature differently. But it's much less common for those two programmers to see eye-to-eye and remain friendly.
Saved
on: 2022-12-21
Effective Eloquent | Laravel News
Get ready to level up your Laravel skills with this tutorial on eloquent queries! You'll learn everything you need to know, from beginner to advanced techniques. To begin with, let's take a step back and think about what Eloquent is.
Saved
on: 2022-12-21
Modern PHP features explained - PHP 8.0 and 8.1 | Laravel News
Since its release in late 2020, PHP 8 has been a game changer. In this tutorial, I will walk through all the latest features with real-world examples of when I might choose to use them.
Tags:
#php
Saved
on: 2022-10-28
DDD, Hexagonal, Onion, Clean, CQRS, … How I put it all together – @hgraca
This post is part of The Software Architecture Chronicles, a series of posts about Software Architecture. In them, I write about what I’ve learned about Software Architecture, how I think of it, and how I use that knowledge.
Saved
on: 2022-08-17
Symfony Demo meets Modular, Microservice-ready Architecture
Hi guys.
I've created a Symfony 6 based Application that can serve as an Enterprise Architecture reference for anyone who's planning to build Large S
Saved
on: 2021-12-09
Modern PHP Cheat Sheet - Front Line PHP
Every file that's loaded in the preload script will be preloaded into memory until server restart.
Saved
on: 2021-11-26
What’s New in PHP 8.1: Enums, First-Class Callables, Fibers, Readonly Prope
Brent Roose, Nikita Popov, Larry Garfield, Dmitry Stogov, Matthieu Napoli, and Aaron Piotrowski talk about all the new features in PHP 8.1.
https://php.net/releases/8.1/en.php
00:00 Intro
00:18 Enums
02:30 Readonly properties
03:18 Fibers
04:54 New in initializers
05:42 Performance improvements
06
Tags:
#php
Saved
on: 2021-11-26
Recommendations for productivity tools/libraries?
Hi, just curious what are the tools/libraries/techniques/etc that save you the most time developing web apps on a daily basis? Thanks
Saved
on: 2021-11-06
Using the Symfony Messenger component
When developing a large scale application the software often needs to do a lot of different tasks. These tasks can consume a lot of time. Because you want your application to be fast and offer a great user experience you don’t want to process these tasks immediately.
Saved
on: 2021-10-10
PHP 8.0: How to Get Started & The Most Interesting New Features - Wizeline
PHP 8 is a major update to the PHP programming language, released on November 26, 2020. According to the official page, this most recent version contains several new features and optimizations.
Tags:
#php
Saved
on: 2021-09-24
Laravel vs. Symfony: A Side by Side Comparison
When facing the start of a brand new PHP application, there is one decision that can’t be overlooked: which framework should you use? And when it comes to PHP frameworks, the "fight" is often Laravel vs. Symfony.
Saved
on: 2021-07-30
[Common mistake] Sharing session across multiple Laravel subdomain - DEV Co
To Share session across domain and it's multiple especially when you have large ecosystem were multiple applications communicate with one database So when a user authenticates any of these apps, they will be logged in everywhere. For example, when a user AUTH into http://mywebsite.
Saved
on: 2021-06-17
Writing better Regular Expressions in PHP • PHP.Watch
Regular Expressions are powerful, PHP but they are not known to be readable, and more often than not, maintaining a regular expression is not a straight-forward task. PHP uses PCRE (PCRE2 since PHP 7.
Saved
on: 2021-06-16
What it means to run a monolith on AWS Lambda
Let's talk about the elephant monolith in the room. It's easy to associate monoliths with legacy, weird, outdated, insecure code. A beast developed for decades that nobody wants to touch because they'll break it and it is impossible to wrap your head around everything.
Saved
on: 2021-05-31
Do not mock what you do not own | The PHP Consulting Company
Saved
on: 2021-04-26
Tackling the Beast: How to Gradually Upgrade a Legacy Code Base to PHP 7 -
SPONSORS
Saved
on: 2021-04-24
Setup Step Debugging in PHP with Xdebug 3 and Docker Compose - Matthew Sett
What will you need? To follow along with this tutorial, make sure that you have Docker installed for your operating system, ideally the latest version, and one of Xdebug’s supported clients.
Saved
on: 2021-03-11
Code analysis tools to help with upgrading an app to a newer PHP version? :
Hi folks –
I have some older sites (some on PHP 5.6.40; some on various versions of 7.x) that I'd like to update to newer versions of PHP.
Of cour
Saved
on: 2021-03-03
Testing your controllers when you have a decoupled core — Matthias Noback -
A lot can happen in 9 years. Back then I was still advocating that you should unit-test your controllers and that setter injection is very helpful when replacing controller dependencies with test doubles.
Saved
on: 2021-03-02
A monorepo approach to larger modules in Laravel and Lambda
I work with a large enterprise application that's broken down into a few teams, languages and modules.
Saved
on: 2021-03-01
When to use empty in PHP? I’d say never — beberlei.de
This article contains a list of alternatives to use instead of empty expression.
Tags:
#php
Saved
on: 2021-02-19
Unit testing tips by examples in PHP
I just created a repository on Github with examples of good unit testing in PHP. I still work on these tips. I will also try to write more about some
Saved
on: 2021-02-19
Should we use a framework? — Matthias Noback - Blog
Since I've been writing a lot about decoupled application development it made sense that one of my readers asked the following question: "Why should we use a framework?" The quick answer is: because you need it. A summary of the reasons: So, yes, you/we need a framework.
Saved
on: 2021-02-17
PHP Internals News podcast :: Globals, and Phasing Out Serializable
Derick Rethans 0:14 Hi I'm Derick. Welcome to PHP internals news, a podcast dedicated to explain the latest developments in the PHP language. This is Episode 75. In this episode, I'm talking with Nikita Popov about a few RFCs that he has been working on over the past few months.
Tags:
#php
Saved
on: 2021-02-16
Symfony Lock and Messenger component - Happyr developer blog
The lock component have saved me so many times. It helps me with race conditions, it makes my code simpler and my application more reliable. I’m using it to fix all kinds of problems and I’ve noticed that I use a few different methods.
Saved
on: 2021-02-15
Build your own PSR-4 autoloader
Deprecated: Return type of Illuminate\View\ComponentAttributeBag::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/pretzelhands/Projects/pretzel
Tags:
#php
Saved
on: 2021-01-26
Gitbar - Il podcast dei developer italiani
Conversazioni sullo sviluppo software fatte davanti a una birra.
Saved
on: 2021-01-15
It’s not legacy code — it’s PHP. Vimeo has been using PHP in production… |
In the last year, Vimeo developers have written backend code in lots of languages — PHP, Go, Ruby, Python, NodeJS, Java, C, C++, and a bit of Rust. In 2004, we started with just one: PHP. It was an ideal language for brand-new startups like Vimeo.
Saved
on: 2021-01-15
Tools for better programming
Recently I discovered these tools that have helped me to control the quality of my code.
+ https://github.com/rectorphp/rector
+ https://github.com/
Saved
on: 2021-01-13
Modernizing PHP » Blog
How many times have we seen it, where an application does HR, payroll, shipping, billing, makes coffee, sweeps the floors, etc.? Too many times to count for me. The truth is that applications like this, these monoliths, are too large for their own good.
Tags:
#php
Saved
on: 2020-12-28
An alternative way to organize the Laravel directory structure // Stefan Ba
In this article, I would like to show you an alternative way to organize your Laravel directory structure. I think the default structure is fine for the most projects. But when it comes down to larger projects I was looking for a different structure.
Saved
on: 2020-12-02
Practical Refactoring Tips For Developers That Love Legacy Applications - N
SPONSORS
Saved
on: 2020-11-24
PHP Internals News podcast :: Short Functions
Derick Rethans 0:15 Hi, I'm Derick, and this is PHP internals news, a weekly podcast dedicated to demystifying the development of the PHP language. Derick Rethans 0:24 Hello, this is Episode 69. Today I'm talking with Larry Garfield, about an RFC that he's just announced called short functions.
Tags:
#php
Saved
on: 2020-11-06
Union types - What's new in PHP 8
A union type accepts values of multiple different types, rather than a single one. Learn how they work in PHP 8.
Saved
on: 2020-10-29
Object Oriented Done Right
Alan Kay, the inventor of the term “object-oriented programming”, told a story once during a talk more than 20 years ago. You can build a dog house using only a hammer, nails, planks, and just a little bit of skill. I figure even I would be able to build it given enough time.
Saved
on: 2020-10-29
Unconventional Autoloaders (Talk) - Liam Hammett
We use autoloaders in PHP all the time, but if you change your mindset a little, you’ll find they can do a lot more than you might’ve thought.
Saved
on: 2020-10-28
PHP 8 - try out all new features - Marcel Pociot's blog about Laravel, PHP
PHP 8 is already in it's release candidate stage, with RC 3 being released on October 29th, and the general availability release targeted for November 26th. So it is time to take a look at all the new and upcoming features of PHP 8. You can take a look at PHP 8's release schedule here.
Tags:
#php
Saved
on: 2020-10-27
How to run over 30k tests in under 5 minutes | by Daan van Marsbergen | Sep
When I started my professional career I had no idea what a unit test looked like. I think I skipped that part on W3Schools. It didn’t matter, because my first employer was not using tests.
Saved
on: 2020-10-09
Step-debugging linked composer dependencies with PhpStorm – Rob Allen's Dev
One project I’m working on has multiple separate parts in different git repositories that are brought into the main project using linked composer directories. I needed to get step debugging working in PhpStorm and this is the approach I took.
Saved
on: 2020-10-08
Writing Effective PHP - Forum PHP 2019 - Afup - Association française des u
PHP has evolved massively since its first days, and it's on the road to a full-featured language. However, at the same time, there is a lot of outdated information and libraries with poorly written code. This talk is about writing PHP Code that is: safe, robust, and maintainable.
Saved
on: 2020-10-06
Apache2 and php fpm performance optimization — Step-by-step guide | by Seba
I had to handle high traffic loads in my career and I fought with down-time, not used memory and a lot of trouble in my past. In this article I want to give a step-by-step guide to apache2 performance settings, which is a concentrated result of a lot of reading and trying.
Saved
on: 2020-09-29
Dynamically changing the log level in Symfony apps — Matthias Noback - Blog
This is just a quick post sharing something I was able to figure out after doing some research. The situation: our application throws exceptions by means of "talking back to the user". As developer we don't want to be notified about all these exceptions.
Saved
on: 2020-09-29
Web Scraping with PHP
You might have seen one of our other tutorials on how to scrape websites, for example with Ruby , JavaScript or Python , and wondered: what about the most widely used server-side programming language for websites , which, at the same time, is the one of the most dreaded ? Wonder no more - today it's
Tags:
#php
Saved
on: 2020-09-24
How to run over 30k tests in under 5 minutes | by Daan van Marsbergen | Sep
When I started my professional career I had no idea what a unit test looked like. I think I skipped that part on W3Schools. It didn’t matter, because my first employer was not using tests.
Saved
on: 2020-09-04
Legacy to Laravel: How to Modernize an Aging PHP Application | Tighten
Here at Tighten, we love Laravel and get excited about staying up to date with the latest and greatest features our framework of choice has to offer.
Saved
on: 2020-09-02
Turbocharged PHP Development with Xdebug, Docker & PHPStorm - Jump24
Quite the controversial “hot-take” from Derick, and while it certainly caused quite the stir (that it was probably designed to), it made me think. I thought, ‘Do I need to revisit Xdebug?’, and I realised that I’d fallen into Derick’s trap. But think I did.
Saved
on: 2020-08-26
Symfony 5: guida rapida (Symfony Docs)
Ringraziamenti Di cosa si tratta? Preparazione dell'ambiente di lavoro Presentazione del progetto Da zero al…
Saved
on: 2020-08-20
I have built MVC Framework from scratch using PHP for only education purposes
The following video series might help you to better understand how PHP frameworks work behind.
Source code: [https://github.com/thecodeholic/php-mvc-
Saved
on: 2020-08-20
Modernizing a Legacy PHP Application
Update Aug, 11: This post was well received on Reddit, so I added new anti-patterns to reflect the comments. Recently, I had the chance occasion to work on numerous legacy PHP applications. I spotted common anti-patterns that I had to fix.
Tags:
#php
Saved
on: 2020-08-11
Enhancements to PHP code coverage in 2020
In 2003, with the release of Xdebug 1.2, Derick Rethans introduced the ability to collect code coverage data to the PHP ecosystem for the first time.
Saved
on: 2020-08-01
PHP 8: before and after - stitcher.io
It's only a few months before PHP 8 will be released, and honestly there are so many good features. In this post I want to share the real-life impact that PHP 8 will have on my own code.
Tags:
#php
Saved
on: 2020-07-20
PHP Insights
Analysis of code quality and coding style. Beautiful overview of code architecture and it's complexity. Designed to work out-of-the-box with Laravel, Symfony, Yii, WordPress, Magento2, and more.
Saved
on: 2020-06-27
Samuel Štancl su Twitter: "✨ In this thread I'll list tactics you can use t
Saved
on: 2020-06-16
How do you build your (production) docker images ?
Hi,
I'd like to start a discussion about docker images for php projects.
I feel like the resources I find on this topic are not advanced enough
htt
Saved
on: 2020-06-13
morris/lessql
LessQL is a lightweight and performant alternative to Object-Relational Mapping for PHP. If you are looking for an SQL-based approach superior to raw PDO, check out DOP as an alternative.
Saved
on: 2020-05-10
Smooth deploy of a loaded PHP web application with php-fpm and nginx, without downtime or errors
Added the cachetool option, thanks to reddit users ds11 and SevereHeight for mentioning it.
Tags:
#php
Saved
on: 2020-05-10
How to Migrate Spaghetti to 304 Symfony 5 Controllers Over Weekend | Tomas
During Easter weekend, usually, people take a break and have a rest. Instead, we used these 4 days of holiday to migrate the 304-controller application. At least that was the goal on Friday. Me in my colleague in the migrated project accepted the challenge. We got into many minds and code-traps.
Tags:
#php
Saved
on: 2020-04-19
Part 1 - How to use TDD to build a REST API in Laravel 6 - YouTube
Saved
on: 2020-04-08
brendt/aggregate.stitcher.io
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
Saved
on: 2020-03-13
Behind the scenes of Flare (or How to structure big Laravel applications) -
At Laracon AU, I gave a talk on how you can structure a big Laravel application. The codebases of both Flare and Oh Dear served as examples. By watching this talk you'll gain some valuable insights that could be applicable to your projects as well. Enjoy!
Saved
on: 2020-03-07
Clean Code and Object Calisthenics Rules I try to Follow — beberlei.de
The first thing I put in place when Tideways hired its first engineer was PHP Code Sniffer with a slightly adopted Doctrine Standard (PSR-2 + a lot more), coupled with static analysis using Psalm.
Saved
on: 2020-03-03
Introducing Stripe payment into your PHP projects
Full working code repository here (with cart simulation) Simple example on how to implement Stripe PaymentIntent (SCA compliant) into your project to enable payment.
Saved
on: 2020-03-01
What is the recommended way to deploy php in containers ? (using "php-pfm
Saved
on: 2020-02-18
Tuning dynamic php-fpm settings - Chris Morrell | Chris Morrell
This is as much a note to self than anything else. Each time I need to change my php-fpm settings, I need to Google “php-fpm dynamic tuning” or something similar. With a little luck, next time I Google it, I'll find this page :)
Saved
on: 2020-02-16
Redux in 30 lines of PHP
The official website calls Redux “a predictable state container for JS Apps”. The main benefit of Redux is that it shines a light on your global application state, allowing you to trace when, where, why, and how your application’s state changed.
Saved
on: 2020-02-09
JoliCode - Battle log: a deep dive in Symfony stack in search of optimizati
My team and I are working on a big project that is becoming bigger and bigger. Split in micro services, each end-user call generates an increasing number of HTTP API calls. Performance was becoming a problem and the Developer eXperience (DX) suffered as a result.
Saved
on: 2020-01-20
DarkGhostHunter/Preloader: Preloader helper to create a PHP-ready preload s
Get the best options to keep your application fast as ever, with just one line. This package generates a PHP preloading script from your Opcache statistics automatically. No need to hack your way in.
Saved
on: 2020-01-15
Php slim framework (Routing, middleware, service container, setting up twig templating and middleware).
Saved
on: 2020-01-14
Handling Plugins In PHP
A common problem that developers face when building applications is how to allow the application to be “plug-able” at runtime. Meaning, to allow non-core code to modify the way an application is processed at runtime.
Saved
on: 2019-12-30
Routing in Slim 4 – Rob Allen's DevNotes
Routing in Slim 4 works pretty much exactly the same as in Slim 3. They are used to map a URL that the browser requests to a specific handler that executes the code for that particular page or API endpoint. You can also attach middleware that will only be run when that route is matched.
Saved
on: 2019-12-19