This media is not supported in your browser
VIEW IN TELEGRAM
What is the latest app you built for just yourself? I love janky one day builds like this.
https://redd.it/1mhg3t8
@r_php
https://redd.it/1mhg3t8
@r_php
New in PHP 8.5: Closures as Constant Expressions
https://chrastecky.dev/programming/new-in-php-8-5-closures-as-constant-expressions
https://redd.it/1mhfosi
@r_php
https://chrastecky.dev/programming/new-in-php-8-5-closures-as-constant-expressions
https://redd.it/1mhfosi
@r_php
Laravel Analytics Beyond Pageviews - SimpleStats 5.0
Hi folks,
while everyone was enjoying Laracon US, we've worked hard to finally release SimpleStats 5.0 with a bunch of new features and improvements!
SimpleStats is a server-side, GDPR compliant and 100% accurate analytics tool for Laravel applications, that goes beyond simple counts of views and visits. It shows you in-depth metrics like Registrations, Conversion Rate, Daily Active Users, campaign ROI, Average Revenue per User, Total Revenue and much more in just a few minutes!
Laravel Analytics Dashboard of SimpleStats
Here's what's new:
Improved performance and scalability - especially noticeable when exploring large time ranges
Event-based pricing (no more total limit blocks for visitors, registrations, etc.)
Email reports for projects (daily/weekly/monthly reports of your project KPIs)
Instant project alerts on new user or payment (disabled by default - ideal for early-stage or smaller teams)
Dark mode improvements and manual toggle in user profile
Redesigned onboarding and registration flow
Dashboard remembers your last selected filters instead of always resetting to "last 7 days"
Fixed edge cases in DAU/WAU/MAU calculation
UI/UX improvements throughout the app
Mobile & responsive improvements for better navigation on all devices
Improved ingestion performance on API stats endpoints
Clickable charts for detail view feature now also supported for week range types
Many small bug fixes and visual refinements
Improved documentation
Feel free to step by and check out SimpleStats at: https://simplestats.io
Thanks for reading,
Zacharias
PS: Your feedback is highly appreciated!
https://redd.it/1mhd868
@r_php
Hi folks,
while everyone was enjoying Laracon US, we've worked hard to finally release SimpleStats 5.0 with a bunch of new features and improvements!
SimpleStats is a server-side, GDPR compliant and 100% accurate analytics tool for Laravel applications, that goes beyond simple counts of views and visits. It shows you in-depth metrics like Registrations, Conversion Rate, Daily Active Users, campaign ROI, Average Revenue per User, Total Revenue and much more in just a few minutes!
Laravel Analytics Dashboard of SimpleStats
Here's what's new:
Improved performance and scalability - especially noticeable when exploring large time ranges
Event-based pricing (no more total limit blocks for visitors, registrations, etc.)
Email reports for projects (daily/weekly/monthly reports of your project KPIs)
Instant project alerts on new user or payment (disabled by default - ideal for early-stage or smaller teams)
Dark mode improvements and manual toggle in user profile
Redesigned onboarding and registration flow
Dashboard remembers your last selected filters instead of always resetting to "last 7 days"
Fixed edge cases in DAU/WAU/MAU calculation
UI/UX improvements throughout the app
Mobile & responsive improvements for better navigation on all devices
Improved ingestion performance on API stats endpoints
Clickable charts for detail view feature now also supported for week range types
Many small bug fixes and visual refinements
Improved documentation
Feel free to step by and check out SimpleStats at: https://simplestats.io
Thanks for reading,
Zacharias
PS: Your feedback is highly appreciated!
https://redd.it/1mhd868
@r_php
Using query builder with manually written SQL
While it is tempting to ditch ORMs and query builders to write all SQL manually, writing 20 slightly different queries for `Repository::getStuffAndMoreStuffByThisAndThat()` methods quickly becomes tedious.
If only it would be possible to start with a manually written base query and then modify it using builder methods... Well, it is actually possible, at least when dealing with Postgres, using [pg\_wrapper](https://github.com/sad-spirit/pg-wrapper) / [pg\_builder](https://github.com/sad-spirit/pg-builder) / [pg\_gateway](https://github.com/sad-spirit/pg-gateway) packages.
A quick overview of these:
**pg\_wrapper** is an object-oriented wrapper for native pgsql extension and converter of complex types between Postgres and PHP (dates and times, intervals, ranges, arrays, composite types, you name it). It transparently converts query result fields to proper PHP types.
**pg\_builder** is a query builder for Postgres that contains a reimplementation of the part of Postgres own SQL parser dealing with DML (it can parse `SELECT` and other preparable statements but cannot parse e.g. `CREATE TABLE`). The query being built is represented as an Abstract Syntax Tree of Node objects. This tree can be freely modified, new parts for it can be provided either as Nodes or as strings.
**pg\_gateway** is a Table Data Gateway implementation depending on the above two.
* It reads tables' metadata to transparently convert query parameters as well.
* The same metadata is used by helpers to build common `WHERE` conditions, column lists and the like.
* Queries built by gateways' `select()` methods behave like database views: they can be added to other queries via joins, CTEs, `exists()` clauses.
* As we are using pg\_builder under the hood, query parts can be given as strings and query AST can be modified in any way when needed.
I already [wrote about these a couple years ago](https://www.reddit.com/r/PHP/comments/16lyknf/pggateway_mix_and_match_manually_written_sql_with/), there were a lot of changes since then
* I ate my own dog food by using pg\_gateway in a few projects, this led to major API overhaul and quality-of-life changes.
* The packages were upgraded for PHP 8.2+ (yes, PHP 8.4+ versions are planned, but not quite now).
* Last but not least, the docs were redone with tutorials / howtos added. [The soft deletes howto](https://pg-gateway.readthedocs.io/en/latest/howto-gateways.html) in particular shows starting with SQL strings and using builder after that. [The DTO howto](https://pg-gateway.readthedocs.io/en/latest/howto-mapping.html) shows using mappers to convert query results to DTOs
Hope for feedback, especially for the docs.
https://redd.it/1mhmom9
@r_php
While it is tempting to ditch ORMs and query builders to write all SQL manually, writing 20 slightly different queries for `Repository::getStuffAndMoreStuffByThisAndThat()` methods quickly becomes tedious.
If only it would be possible to start with a manually written base query and then modify it using builder methods... Well, it is actually possible, at least when dealing with Postgres, using [pg\_wrapper](https://github.com/sad-spirit/pg-wrapper) / [pg\_builder](https://github.com/sad-spirit/pg-builder) / [pg\_gateway](https://github.com/sad-spirit/pg-gateway) packages.
A quick overview of these:
**pg\_wrapper** is an object-oriented wrapper for native pgsql extension and converter of complex types between Postgres and PHP (dates and times, intervals, ranges, arrays, composite types, you name it). It transparently converts query result fields to proper PHP types.
**pg\_builder** is a query builder for Postgres that contains a reimplementation of the part of Postgres own SQL parser dealing with DML (it can parse `SELECT` and other preparable statements but cannot parse e.g. `CREATE TABLE`). The query being built is represented as an Abstract Syntax Tree of Node objects. This tree can be freely modified, new parts for it can be provided either as Nodes or as strings.
**pg\_gateway** is a Table Data Gateway implementation depending on the above two.
* It reads tables' metadata to transparently convert query parameters as well.
* The same metadata is used by helpers to build common `WHERE` conditions, column lists and the like.
* Queries built by gateways' `select()` methods behave like database views: they can be added to other queries via joins, CTEs, `exists()` clauses.
* As we are using pg\_builder under the hood, query parts can be given as strings and query AST can be modified in any way when needed.
I already [wrote about these a couple years ago](https://www.reddit.com/r/PHP/comments/16lyknf/pggateway_mix_and_match_manually_written_sql_with/), there were a lot of changes since then
* I ate my own dog food by using pg\_gateway in a few projects, this led to major API overhaul and quality-of-life changes.
* The packages were upgraded for PHP 8.2+ (yes, PHP 8.4+ versions are planned, but not quite now).
* Last but not least, the docs were redone with tutorials / howtos added. [The soft deletes howto](https://pg-gateway.readthedocs.io/en/latest/howto-gateways.html) in particular shows starting with SQL strings and using builder after that. [The DTO howto](https://pg-gateway.readthedocs.io/en/latest/howto-mapping.html) shows using mappers to convert query results to DTOs
Hope for feedback, especially for the docs.
https://redd.it/1mhmom9
@r_php
GitHub
GitHub - sad-spirit/pg-wrapper: Converter of complex PostgreSQL types and an OO wrapper for PHP's pgsql extension
Converter of complex PostgreSQL types and an OO wrapper for PHP's pgsql extension - sad-spirit/pg-wrapper
Psalm v7: up to 10x performance!
https://blog.daniil.it/2025/07/10/psalm-v7-up-to-10x-performance/
https://redd.it/1mhna04
@r_php
https://blog.daniil.it/2025/07/10/psalm-v7-up-to-10x-performance/
https://redd.it/1mhna04
@r_php
Daniil Gentili's blog
Psalm v7: up to 10x performance! - Daniil Gentili's blog
Announcing the public beta of Psalm v7! Psalm is one of the biggest and most powerful PHP Static analysis tools, featuring exclusive features like security analysis, and Psalm v7 brings huge performance improvements to security analysis, up to 10x thanks…
Psalm v6 Deep Dive: Copy-on-Write + dynamic task dispatching
https://blog.daniil.it/2025/05/11/psalm-v6-deep-dive-copy-on-write-dynamic-task-dispatching/
https://redd.it/1mhnb0g
@r_php
https://blog.daniil.it/2025/05/11/psalm-v6-deep-dive-copy-on-write-dynamic-task-dispatching/
https://redd.it/1mhnb0g
@r_php
Daniil Gentili's blog
Psalm v6 Deep Dive: Copy-on-Write + dynamic task dispatching - Daniil Gentili's blog
A deep dive into Psalm 6.1's performance improvements, powered by CoW optimizations, and dynamic task dispatching with amphp/parallel!
I took a deep dive into the upcoming "clone with"-style syntax in PHP 8.5
https://www.youtube.com/watch?v=hkuy11kLlmM
https://redd.it/1mi3eep
@r_php
https://www.youtube.com/watch?v=hkuy11kLlmM
https://redd.it/1mi3eep
@r_php
YouTube
Clone with in PHP 8.5… kind of
Read the full RFC: https://wiki.php.net/rfc/clone_with_v2
Code Quality
Hi guys, I hope you are all doing good.
How do you guys ensure code quality on your PHP application?
I am currently leading(a one man team🤣) the backend team for a small startup using PHP and Laravel on the backend.
Currently, we write integration test(with Pest), use PHPstan for static analysis(level 9), Laravel Pint for code style fixing.
I have recently been wondering how else to ensure code quality on the backend.
How else do you guys enforce / ensure code quality on your applications?
Are there specific configurations you use alongside these tools, or are there even some other tools you use that isn't here?
Thanks in advance, guys.
https://redd.it/1mi53j1
@r_php
Hi guys, I hope you are all doing good.
How do you guys ensure code quality on your PHP application?
I am currently leading(a one man team🤣) the backend team for a small startup using PHP and Laravel on the backend.
Currently, we write integration test(with Pest), use PHPstan for static analysis(level 9), Laravel Pint for code style fixing.
I have recently been wondering how else to ensure code quality on the backend.
How else do you guys enforce / ensure code quality on your applications?
Are there specific configurations you use alongside these tools, or are there even some other tools you use that isn't here?
Thanks in advance, guys.
https://redd.it/1mi53j1
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Do you update flex recipes when upgrading Symfony version?
I just updated my app from Symfony 7.2 to 7.3. When using the `composer recipes:update` command, i get a big list of recipes to update. However, the process is annoying as i have to do it one by one with a commit after each. How important is this step and how do you do it?
https://redd.it/1mia8eh
@r_php
I just updated my app from Symfony 7.2 to 7.3. When using the `composer recipes:update` command, i get a big list of recipes to update. However, the process is annoying as i have to do it one by one with a commit after each. How important is this step and how do you do it?
https://redd.it/1mia8eh
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
scout:queue-import: Faster Indexing in Laravel Scout
https://nabilhassen.com/scoutqueue-import-faster-indexing-in-laravel-scout
https://redd.it/1miez6x
@r_php
https://nabilhassen.com/scoutqueue-import-faster-indexing-in-laravel-scout
https://redd.it/1miez6x
@r_php
Nabilhassen
scout:queue-import: Faster Indexing in Laravel Scout
The new scout:queue-import command splits your model’s ID range into chunks and queues jobs for each, enabling faster parallel indexing of large datasets.
Excessive micro-optimization did you know?
Some built-in functions have compiler optimized versions that avoid a lot of the internal overhead of the PHP engine. By importing them in source files (e.g.,
<?php
namespace SomeNamespace;
$now1 = microtime(true);
for ($i = 0; $i < 1000000; $i++) {
$result1 = strrev("Hello, World!");
}
$elapsed1 = microtime(true) - $now1;
echo "Without import: " . round($elapsed1, 6) . " seconds\n";
$now2 = microtime(true);
for ($i = 0; $i < 1000000; $i++) {
$result2 = \strrev("Hello, World!");
}
$elapsed2 = microtime(true) - $now2;
echo "With import: " . round($elapsed2, 6) . " seconds\n";
For this tight loop, it results in an 86.2% performance increase. This was tested with OPcache enabled. You will se smaller performance gains with it disabled.
Will this affect real world applications? Most likely not by much.
https://redd.it/1milupj
@r_php
Some built-in functions have compiler optimized versions that avoid a lot of the internal overhead of the PHP engine. By importing them in source files (e.g.,
use function array_map) or by prefixing them with the global namespace separator, for example \is_string($foo):<?php
namespace SomeNamespace;
$now1 = microtime(true);
for ($i = 0; $i < 1000000; $i++) {
$result1 = strrev("Hello, World!");
}
$elapsed1 = microtime(true) - $now1;
echo "Without import: " . round($elapsed1, 6) . " seconds\n";
$now2 = microtime(true);
for ($i = 0; $i < 1000000; $i++) {
$result2 = \strrev("Hello, World!");
}
$elapsed2 = microtime(true) - $now2;
echo "With import: " . round($elapsed2, 6) . " seconds\n";
For this tight loop, it results in an 86.2% performance increase. This was tested with OPcache enabled. You will se smaller performance gains with it disabled.
Will this affect real world applications? Most likely not by much.
https://redd.it/1milupj
@r_php
PHP.Watch
Function Inlining in Zend Engine
A list of special PHP functions that Zend Engine can inline and optimize.
AI & Programming
PHPStorm, my preferred IDE uses AI to predict what I’m writing. It works quite well but it does have me questioning the future of my job security and hobby.
While currently AI produces often buggy and difficult to maintain spaghetti, how much longer until this is no longer the reality?
Is there anything I should be doing to prepare for this?
https://redd.it/1mingtk
@r_php
PHPStorm, my preferred IDE uses AI to predict what I’m writing. It works quite well but it does have me questioning the future of my job security and hobby.
While currently AI produces often buggy and difficult to maintain spaghetti, how much longer until this is no longer the reality?
Is there anything I should be doing to prepare for this?
https://redd.it/1mingtk
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
SymfonyCon Amsterdam 2025: Join the Symfony Hackathon: Collaborate, Contribute, Create
https://symfony.com/blog/symfonycon-amsterdam-2025-join-the-symfony-hackathon-collaborate-contribute-create?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1mj0eml
@r_php
https://symfony.com/blog/symfonycon-amsterdam-2025-join-the-symfony-hackathon-collaborate-contribute-create?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1mj0eml
@r_php
Symfony
SymfonyCon Amsterdam 2025: Join the Symfony Hackathon: Collaborate, Contribute, Create (Symfony Blog)
Ready to contribute to Symfony? On Nov 29, we’re hosting a Hackday in Amsterdam focused on mentoring, roadmap planning, testing, and more. Come shape the future of Symfony!
assetMapper and fonts
Hi,
I'm trying to import a google font.
php bin/console importmap:require @fontsource/oswald
This works fine, but after, i need to replace this with the local version, in my css
import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap');
i've tried
@import url('@fontsource/oswald/index.min.css');
or
@import url('@fontsource/oswald');
But it does not work..
How can i do that ?
https://redd.it/1miy6l1
@r_php
Hi,
I'm trying to import a google font.
php bin/console importmap:require @fontsource/oswald
This works fine, but after, i need to replace this with the local version, in my css
import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap');
i've tried
@import url('@fontsource/oswald/index.min.css');
or
@import url('@fontsource/oswald');
But it does not work..
How can i do that ?
https://redd.it/1miy6l1
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
PHP development with FrankenPHP and Docker
https://sevalla.com/blog/modern-php-with-frankenphp-and-docker/
https://redd.it/1mj2ueo
@r_php
https://sevalla.com/blog/modern-php-with-frankenphp-and-docker/
https://redd.it/1mj2ueo
@r_php
Sevalla
Modern PHP development with FrankenPHP and Docker
A hands-on guide to deploying PHP applications with FrankenPHP and Docker, from simple containers to standalone binaries.
PhpStorm 2025.2 Is Now Available
https://blog.jetbrains.com/phpstorm/2025/08/phpstorm-2025-2-is-now-available/
https://redd.it/1mj3lrx
@r_php
https://blog.jetbrains.com/phpstorm/2025/08/phpstorm-2025-2-is-now-available/
https://redd.it/1mj3lrx
@r_php
The JetBrains Blog
PhpStorm 2025.2 Is Now Available | The PhpStorm Blog
Along with making Laravel Idea free for PhpStorm users, this release brings improvements to the remote development experience, JetBrains AI tools, and more. Download PhpStorm 2025.2 Junie co
Configuring Renovatebot for upgrading Symfony?
I'm setting up Renovatebot to update my packages in a Symfony app, but i'm a bit confused about the Symfony packages.
I want to make a group so it will update them all together when doing Symfony upgrade. But how to make it change this part? eg. when upgrading from 7.2 to 7.3
"extra": {
"symfony": {
"allow-contrib": false,
"require": "7.2.*"
}
}
https://redd.it/1mj6r1f
@r_php
I'm setting up Renovatebot to update my packages in a Symfony app, but i'm a bit confused about the Symfony packages.
I want to make a group so it will update them all together when doing Symfony upgrade. But how to make it change this part? eg. when upgrading from 7.2 to 7.3
"extra": {
"symfony": {
"allow-contrib": false,
"require": "7.2.*"
}
}
https://redd.it/1mj6r1f
@r_php