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

How to replace mcrypt with openssl?

I am currently upgrading an existing PHP application from PHP 5.4 to PHP 8.1. I have managed to restore all functionality except for encryption and decryption of data. My application communicates with a third party server, so just running an old PHP…
LostPhysx
  • 3,573
  • 8
  • 43
  • 73
0
votes
1 answer

Trying to access array offset on value of type null in php 8.1

I have updated PHP 7.3 to version 8.1 but with the following code, I get a warning: $this->m_intEventId = $this->m_objMaintenanceRequest->getEventIds()[CEventSubType::WORKORDER_STATUS_UPDATED] ??…
0
votes
0 answers

Magento 2 PWA invalid json response body at http://localhost/graphql reason: Unexpected token < in JSON at position error occur while setup PWA studio

I got the below error while setup PWA with Magento 2 when I run the yarn build command. Magento version: 2.4.4 PWA Version: ^0.4.0 PHP version: 8.1 Node Js Version: v16.19.0 Yarn Version: 1.22.19 FetchError: invalid json response body at…
0
votes
1 answer

Model don't save into table using Yii and php 8.1

I migrate from PHP 7.4 to PHP 8.1 and now I have problem just with a table. Database: 10.3.38-MariaDB Yii version: "yiisoft/yii2": "~2.0.47", This table structure is this: CREATE TABLE `registro_actividad` ( `id` int(11) NOT NULL, `usuario_id`…
Benjamin
  • 144
  • 12
0
votes
0 answers

Problema with Debian 5.14 and php8.1-gd

A have a problem. I need the php8.1 and I intalled. But, a try install extensions how: gd with command: sudo apt install php8.1-gd and have a problem: enter image description here Translate: Reading package lists... Done Building dependency tree...…
Men
  • 1
0
votes
0 answers

I am creating custom module in magento But not work proper

When I am disable module from admin side the effect of frontside is only hide content and enable then content show. I want to show that when I am disable the module 404 error comes. I am creating some files like Block, Controller, etc, view,…
0
votes
0 answers

FAST-CGI for Apache in Windows Server

I have problems to configure php in the Apache in my Windows Server 2016 Datacenter. I don't have the php8apache2_4.dll in my non thread safe zip File. Do I have to download the Thread Safe Version or is any other way possible to handle php…
0
votes
1 answer

Return validator messages in custom Rule

A problem that we probably didn't know about when switching to PHP 8+: Very often, in the rules we created earlier, we returned a message like this: public function message(): array { return [$this->validator->errors()->messages()]; } When…
0
votes
2 answers

ReflectionClass $concrete is empty or null after upgrade to php8.0.8

Running php artisan passport:install after upgrading from php7.4 to php8.1 throws: Class "" not found error I have tried to bypass this error by checking for isClass before passing $concrete value to ReflectionClass method in Container.php, but…
0
votes
0 answers

Laravel 9.48.0 + PHP 8.1.6 in VSCode shows syntax error

i have win10 in cmd.exe with composer create project: composer create-project laravel/laravel firstproject or(laravel new firstproject) then: php artisan serve but in vscode i have some syntax error in vendor folder list of errors: Syntax…
0
votes
2 answers

What is the benefit using php attributes rather than static method

I use custom php attribute in my entity class, and then there are service that read this attribute to prepare configuration array. Something like this class User implements UserInterface { #[GridUi(label: 'ID')] private int id; …
Permana
  • 1,972
  • 2
  • 33
  • 51
0
votes
1 answer

JWT Token generated using firebase/php-jwt is showing as Invalid Token

I am using firebase/php-jwt for generating JWT Token using the following PHP Source Code
Akshay Khale
  • 8,151
  • 8
  • 50
  • 58
0
votes
1 answer

Symfony 5.1 Forms - Validation Error with CollectionType: This form should not contain extra fields - not working with PHP 8.2

I have a form like this: class AssignmentType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('ref') ->add('rate') ->add('costs') …
goldlife
  • 1,949
  • 3
  • 29
  • 48
0
votes
0 answers

Mapped superclass error when extend abstract class

I have some common fields in almost all tables. So I created an AbstractEntity class where I can add fields that are in common. /** * @MappedSuperclass */ abstract class AbstractEntity { /** * @ORM\Id() *…
nas
  • 2,289
  • 5
  • 32
  • 67
0
votes
2 answers

In PHP, what is the difference between the following function definitions?

function some_func(string|null $some_arg) function some_func(?string $some_arg) function some_func(string $some_arg = null) function some_func(?string $some_arg = null)
Singleton
  • 21
  • 1
  • 3