Questions tagged [php-7.4]

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.

505 questions
14
votes
2 answers

How can I enable opcache preloading in PHP 7.4?

I'd like to enable opcache preloading (RFC) on my production servers in PHP 7.4. I'm using Symfony 4 if it changes anything.
Mike Doe
  • 16,349
  • 11
  • 65
  • 88
13
votes
5 answers

Laravel - Trying to access array offset of value of type int

I have an issue when I try to submit post requests to the database. The interesting thing is, that the error only occurs when I use PHP version 7.4.2. In PHP version 7.3.9 everything works fine. I am using Laravel 6.17. When is Laravel going to fix…
NKol
  • 663
  • 1
  • 9
  • 12
13
votes
3 answers

Use variable by reference in arrow function

PHP 7.4 introduced Arrow functions. And it also introduced implicit by-value scope binding which eliminate the need for use keyword. Now if we want to use a variable out of a closure's scope by reference with a regular anonymous function we would…
Rain
  • 3,416
  • 3
  • 24
  • 40
11
votes
3 answers

Is it possible to install PHP7.4 on stock Alpine 3.12 Docker image?

Is it possible to install PHP7.4 on stock Alpine 3.12 Docker image? I have seen this repo and its dockerfile which is using bintray cert and repository path, but I was wondering if there is a more "standard/Alpine" way of doing this natively?
Norgul
  • 4,613
  • 13
  • 61
  • 144
11
votes
6 answers

Updating PHP 7.4 on Ubuntu 20.04 doesn't update to the latest release

I was just trying to install PHP 7.4 on a fresh Ubuntu 20.04, Doing a simple apt install php php-cli installed the 7.4 version by default, But when I do apt update && apt upgrade the version is still 7.4.3 instead of 7.4.5! Please note that I'm…
J. Doe
  • 812
  • 1
  • 15
  • 33
11
votes
4 answers

PHP 7.4 Typed properties iteration

I just found something "kinda strange" about PHP 7.4 and I am not sure if it is just me missing something or maybe if it is an actual bug. Mostly I am interested in your opinion/confirmation. So in PHP, you can iterate over objects properties like…
Robert
  • 1,206
  • 1
  • 17
  • 33
10
votes
1 answer

Install PHP 7.4 met with "unmet dependencies", how to solve this?

I know a lot of topics have the same question but I've tried everything and nothing works for me. So I'm trying to install php 7.4 on my ubuntu stretch. I've done the following commands I found on the Internet: apt install ca-certificates…
Akame14
  • 151
  • 1
  • 2
  • 12
9
votes
1 answer

Silence PHP 7.4.8 server request logs "Accepted", "Closing"

After updating from PHP 7.3 to PHP 7.4.8, I have noticed the server has started to log "Accepted", "Closing" for all requests and sometimes: "Closed without sending a request; it was probably just an unused speculative preconnection". [Wed Aug 5…
9
votes
4 answers

ArrayObject does not work with end() in PHP 7.4

On migrating to PHP 7.4 I have to deal with a different behavior of some array functions like reset(), current() or end() concerning ArrayObject. The following example produces different outputs:
Trendfischer
  • 7,112
  • 5
  • 40
  • 51
9
votes
1 answer

Deprecation warning not catchable in PHP 7.4

In PHP 7.4.0 I see the following warning: Deprecated: Array and string offset access syntax with curly braces is deprecated in ... My error / exception handlers are not able to catch and log them. Example:
Dave
  • 93
  • 1
  • 5
8
votes
2 answers

Does mysqli have support for caching_sha2_password in PHP 7.4?

When I tried upgrading from PHP 7.3 to PHP 7.4, I received this error: Unexpected server response while doing caching_sha2 auth 109 As I see it, this indicates that PHP 7.4 MySQLi is trying to use the caching_sha2_password plugin. This article…
Minding
  • 1,383
  • 1
  • 17
  • 29
8
votes
4 answers

php7.4 mysqli times out with "gone away"

I have just installed php7.4, everything seems ok but when I try to go on my phpmyadmin, I can't : Note works fine in php7.3 before this installation The error is : mysqli_real_connect(): Unexpected server response while doing caching_sha2 auth:…
Michel
  • 99
  • 4
8
votes
4 answers

Rewriting an anonymous function in php 7.4

There is the following anonymous recursive function: $f = function($n) use (&$f) { return ($n == 1) ? 1 : $n * $f($n - 1); }; echo $f(5); // 120 I try to rewrite to version 7.4, but there is an error, please tell me what I'm missing? $f =…
wnull
  • 217
  • 6
  • 21
7
votes
2 answers

Install Xdebug for PHP 7.4 on M1 Apple

I want to install Xdebug on my Mac with M1. I use PHP 7.4.32 because of the project I attend. I cannot switch the PHP version. When I try to install Xdebug, it say's my PHP version has to update to 8.0.0 but I still want to use 7.4.32. $ pecl…
user19540948
7
votes
2 answers

Fatal error: Uncaught PhpOffice\PhpSpreadsheet\Reader\Exception: Could not find zip member

I have installed the latest version of this library using Composer. I created a test file to test the library's functionality, but when I try to parse a file and make a data array out of it, I get this error; Fatal error: Uncaught…
Ivan Savin
  • 71
  • 1
  • 1
  • 2
1
2
3
33 34