14 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
Advice
0
votes
7
replies
145
views
PHP shorthand for isset && truthy
Is there a shorter way to write the following in php?
$bar = isset($foo['bar']) && $foo['bar'];
or
$verylongname = isset($_POST['verylongname']) && $_POST['verylongname'];
I'm using ...
4
votes
3
answers
258
views
PHP 8.4 rounding gives different result than 8.2
I am in the process of upgrading our code from php 8.2 to 8.4
I noticed we are getting some test failures because of round() returning different values than expected. Ultimately the problem could be ...
0
votes
1
answer
112
views
How do I join and select from a many-to-many relation?
I have tables Properties and Features with many-to-many relationship PropertiesFeatures (which holds their IDs):
When I select multiple features (feature IDs) as an array, I need all properties which ...
3
votes
1
answer
780
views
After upgrading from PHP 8.3 to 8.4 I get "Maximum call stack size ... reached. Infinite recursion?"
After upgrading my project from PHP 8.3 to PHP 8.4, I started getting the following error:
Maximum call stack size of 8339456 bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. ...
0
votes
1
answer
272
views
Missing libraries for PHP8.4 extensions
Ubuntu 25.04 (Plucky).
Need to install PHP8.4.
The only way to do this - use PPA by Ondrej Sury which supports just up to Noble release of Ubuntu (24.04). No problem to change sources in latesy ...
0
votes
1
answer
202
views
Hooked/readonly properties for virtual fields [closed]
I have had several times a class (parent) that can generate a "virtual field" based on "values" contained in child classes.
The peculiarity is that these values are immutable (...
-1
votes
1
answer
24k
views
Datasource class could not be found
i googled this error in many ways but only could find irrelevant messages
i am migrating a cakephp 4.2 PHP application to cakephp 5 and only the 'default' database is usable
in my app_local.php i have ...
2
votes
1
answer
3k
views
Error on PHP 8.4-fpm IMAP package install with Dockerfile
In my Dockerfile for php8.4-fpm i am installing IMAP package with the following commands:
FROM php:8.4-fpm
[...]
RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl && \
...
0
votes
0
answers
75
views
PHP scripts no more accessing SSL
On my Windows 10 machine, I run some PHP scripts that call API functions on a game, Torn. Torn allows and encourages the call of such API.
Since a few days, all my command line scripts stopped working ...
1
vote
1
answer
209
views
Property hook not found when serializing an object using __sleep
I noticed something strange when using the combination property hooks with the magic __sleep() method. I have no idea whether I incorrectly use hooks or that this is a bug in PHP.
See the following ...
1
vote
1
answer
445
views
how to use DomDocument's querySelector in PHP 8.4.3?
According to https://www.php.net/manual/en/dom-parentnode.queryselector.php Dom\ParentNode::querySelector is supported in PHP >= 8.4.0. Pursuant to that I should think the following code would work:...
0
votes
1
answer
696
views
PHP 8.4 Upgrade in Laravel Sail Causes zend_mm_heap corrupted Error During PHPUnit Tests
Environment:
PHP: 8.4
Laravel: 11.35.1
Sail: 1.39.1
PHPUnit: 10.5.39
macOS: 15.1.1 (24B91)
We are upgrading from PHP 8.2 to PHP 8.4. The only change made so far has been upgrading PHP within Laravel ...
3
votes
2
answers
11k
views
PHP 8.4.1 : Constant E_STRICT is deprecated in pearcmd.php on line 441
I've upgraded php from 8.3 to PHP8.4.1_1 (via Homebrew on mac OS X intel), then I started to have a lot of warnings when using PECL/PEAR, while I was using PECL to install GRPC/PROTOBUF/MONGODB ...
3
votes
1
answer
1k
views
mysqli_ping is deprecated. What should I replace it with?
I was using mysqli_ping() to check if the mysqli connection was up. In the latest PHP 8.4 version, this function was deprecated and will be removed in the future. Why is this function deprecated, what ...