Questions tagged [php-8.1]

For questions specific to the usage and new features of PHP 8.1. Also, include the more generic [php] tag when using this tag.

PHP 8.1 (released November 2021) includes many new features including:

A full list of changes can be found in the migration guide.

336 questions
0
votes
1 answer

Sage Pay / Opayo form integration - PHP 8.1 - PHP Fatal error: Uncaught Error: Attempt to assign property "start" on null

I appreciate there are similar questions, but I can't get any of the solutions to work with my (inherited) code, so would be grateful for any help you can offer. We use the Sage Pay / Opayo payment gateway via form integration. On completion/failure…
Mike West
  • 15
  • 5
0
votes
1 answer

How to regenerate php-fpm sockets

I have a server running Apache 2.4 and php 8.1 with FPM for several virtual domains, and just now I noticed one of these domains is missing it's fpm socket in /var/php-fpm... Been googling how to regenerate these files with no luck, or I just missed…
Cexoxa
  • 1
  • 1
0
votes
0 answers

Slim4 and PHP-DI doesn't inject using annotation

I'm migrating a project from an older version of Slim and PHP-DI to the last one and PHP 8.1.17. These are the composer dependency for slim and php-di: "slim/slim" : "~4.11", "php-di/php-di" : "^7.0.2", PHP-DI annotation doesn't work like the…
Tobia
  • 9,165
  • 28
  • 114
  • 219
0
votes
0 answers

openssl_pkey_new always return false with alpine 3.17

I'm trying to move from Alpine 3.16 to 3.17 which comes with a breaking change of OpenSSL from v1.1.1 to v3.x. This method openssl_pkey_new always fails on Alpine 3.17 and is not able to apply key generation probably. error:0480006C:PEM routines::no…
Ahmed Alaa El-Din
  • 1,813
  • 1
  • 16
  • 19
0
votes
1 answer

How do you doc-type an enum string in PHP?

for doctyping a class-string you can doctype using: class-string. But i cannot find any documentation surrounding enums. I can find you can document something to be a value of an Enum with…
Joel Harkes
  • 10,975
  • 3
  • 46
  • 65
0
votes
0 answers

Symfony 6 forms - add form field in validation

I have a working Symfony 6 form with working validation defined aprox. like this: $builder ->add('myTestedField', ChoiceType::class, [ 'label' => 'My Field', 'attr' => [ …
jave.web
  • 13,880
  • 12
  • 91
  • 125
0
votes
0 answers

Symfony 6.2.7 AssertionError assert($offset === strlen($sql))

i have a new error that i can't explain. When i execute a query, whether the result is zero or not i have the error "assert($offset === strlen($sql))" it comes from the class vendor/doctrine/dbal/src/SQL/Parser.php:115 I have looked on the various…
Sam Dee
  • 1
  • 1
0
votes
1 answer

php image upload is not working on live server with php 8.1 but working with 8.0

it was working fine on live host earlier but now i updated my php version to 8.1 and stopped working . But when i check it on xampp local server it is working fine . my HTML code is :-
Bittu
  • 51
  • 1
  • 7
0
votes
2 answers

Upgrading PHP 7.4 to PHP 8.1 for Laravel 8.x

I have a Laravel 8.x project that have been running on PHP 7.4 for a couple of years now and I would like to start planning the upgrade for Laravel to v9.x and v10.x. Before upgrading Laravel I thought I would upgrade the server to PHP 8.1 for the…
user2268244
  • 244
  • 1
  • 15
0
votes
0 answers

How use library events in Opencart 4.1.0.1?

Can anybody describe, how library events work in Opencart 4.0.1.1. I tried to find information in official git repository, but there not enough info. I tried add event data and write in log route and data…
0
votes
0 answers

Circular reference causes allowed memory exhausted error, how to remove the circular reference

I am pretty sure I have a circular reference, but I do not know howto solve it. I have a trait like this: trait UseCaseValidatableTrait { protected function validateParams(array $rules, array $messages = []) { // ... do smtg } …
Giacomo M
  • 4,450
  • 7
  • 28
  • 57
0
votes
1 answer

non-static method cannot be called statically laravel

I'm trying calling the controller method directly from the blade file, but it gives me an error like. Error Non-static method App\Http\Controllers\CallDetailsController::insertVicidialReportLog() cannot be called statically…
0
votes
0 answers

Dompdf library Incompatibility with PHP version 8.1.2 on CodeIgniter 3.1.13

I tried to convert my CodeIgniter 3 file to pdf with this Dompdf library: https://github.com/iamfiscus/Codeigniter-DOMPDF Got few errors but already fixed it from this github source:…
whileiam
  • 1
  • 1
0
votes
1 answer

Codeception 5 test parameters recommendation sought

I'm writing a Gherkin-based acceptance testing PoC. I have a feature file, step object, and a page object. In my sequence I will need to log-in the test user before conducting the rest of the series. Our SUT is a legacy PHP application that didn't…
0
votes
0 answers

Symfony5 - autowiring with using interface as typhint

I have an interface:
Calliso
  • 31
  • 6