For questions specific to the usage and features of version 7.4 of PHP. When using this tag also include the more generic [php] tag.
Questions tagged [php-7.4]
505 questions
-2
votes
1 answer
PHP Deprecated: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
After upgrading PHP version from 7.3 to 7.4 I'm getting one deprecated issue.
[27-Nov-2020 01:14:32 UTC] PHP Deprecated: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in…

Udaya Arunakantha
- 55
- 1
- 9
-2
votes
1 answer
Best way to get keys from Generator that contains array
I try to find out how we can get keys from an \Generator() that yield values of an array.
What i actually do :
function t(): \Generator {
yield from [
'hello' => 0,
'yellow' => 1,
'coco' => 2,
];
}
$keys =…

Lounis
- 597
- 7
- 15
-2
votes
2 answers
Laravel - add part of session content into array
I am looking to move a part of a session into a variable.
The blade echo works fine outside the php tags.
Inside the pgh tags I get an error about '{'.
Question: How can I move the mentioned session content into a PHP variable? If possible I would…

Toolbox
- 2,333
- 12
- 26
-2
votes
3 answers
Laravel 7 php artisan migrate database error
When I run 'php artisan migrate' i am getting the following error
Access denied for user 'dbuser'@'localhost' (using password: YES) (SQL: select * from information_schema.tables where table_schema = dbname_main and table_name = migrations and…

Sreejith Sasidharan
- 1,318
- 5
- 25
- 46
-2
votes
2 answers
Notification Api System Correct Process
I built a small notification api system that has id, user_id, subject, text, status, created_at columns in the data base.
My current process is that when a user requests for her notifications i get the most recent 100 unread messages and send to…

Sayra
- 55
- 8
-2
votes
1 answer
php7.4, php7.4-fpm, http2, Apache, nginx, I'm confused
Can I use php7.4-fpm with Apache? Or is php-fpm really only for use with nginx? And why?
Does php7.4 support http2? Or do you still need php-fpm? The official http2 site (http2.pro) hasn't been updated in a couple of years.
Is it Still worth…

alebal
- 5,838
- 3
- 10
- 28
-4
votes
2 answers
Splatpacking versus array_values() to re-index an array with numeric keys
As of PHP7.4, there is a newly available technique to re-index an array with numeric keys.
I'll call it "array re-packing" or maybe something fun like "splatpacking". The simple process involves using the splat operator (...) -- aka "spread…

mickmackusa
- 43,625
- 12
- 83
- 136