Questions tagged [php-8.2]

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

PHP 8.2 was released in November 2022

A list of features and changes can be found in the migration guide

80 questions
0
votes
0 answers

The data i get back to FETCH from my PHP file, had an added empty paragraph at the beginning

I use the FETCH API to pull data from the backend, but since some time I am getting an empty paragraph at the beginning of each response. Unfortunately for me, I am not able to track down what change was made that has caused this, so I am looking…
Daniel82
  • 33
  • 8
0
votes
0 answers

Using PHPOffice/phpspreadsheet with PHP+Apache Ubuntu

I use the PhpSpreadsheet library in my Laravel app which runs on a PHP8.2 server + Apache(Laragon) on Windows 10; everything works fine locally. I load an xlsx file, edit it and save with no problem. But that I deploy the application (the same code)…
0
votes
1 answer

"Attempt to read property \"id\" on null", Create access token error with laravel passport, laravel 9, php 8.2.2

devs, so I have been struggling with this problem for about 10 hours now, and I can't seem to find a solution online, worst is that I don't even know why it happens. I am working on a project which uses PHP LARAVEL as the backend and I started…
0
votes
1 answer

the variable $context is not interpreted correctly in the template

I can't get out of this error: Object of class Symfony\Bridge\Twig\Mime\WrappedTemplatedEmail could not be converted to string My setup : php 8.2 symfony 6.2 mailer 6.2 and i use maildev I would like to generate a mail sending with ajax. My service…
Na Ba
  • 15
  • 4
0
votes
0 answers

How do I authenticate an author to edit their own posts?

every time I go to 'edit' a post, the server returns a 403 - forbidden error. Although I can create, timestamp, and associate posts to the user that created them, The same user cannot seem to edit them... What am I doing wrong? Here are my Routes…
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
0
votes
1 answer

Trying to access array offset on value of type bool Yii2 PHP8.2

The following code produces the mentioned error. What is the fix for PHP 8.2? PHP Warning – yii\base\ErrorException Trying to access array offset on value of type bool In…
KrisPbcon
  • 21
  • 2
0
votes
0 answers

While Creating PHP AWS Client Giving Error as "Invalid configuration value provided for \"configuration_mode\"

Working on one application where creating a object for the AWSRekognition which is throwing an error as follow . Invalid configuration value provided for "configuration_mode". Expected…
0
votes
1 answer

Why do I get errors in guzzle, despite the fact that everything is fine with the curl?

I have error with Guzzle 7 in PHP 8.2. If i do query by Postman or curl all okey, but i need use guzzle lib or analog php lib. My code: $this->client = new Client([ 'base_uri' => 'https://fcm.googleapis.com/fcm/', 'headers' => [ …
0
votes
0 answers

Rocky 8.7 proxy connection to websocket in Laravel 9

Upgrading php-7.3 from php 8.2 on rocky-8.7 but WebSocket connection is not working Before Upgrade: when WebSocket connection working fine Rocky: 8.7 PHP: 7.3.33 Laravel: 8.83 beyondcode/laravel-websockets: 1.13.1 pusher/pusher-php-server:…
Kailas
  • 3,173
  • 5
  • 42
  • 52
0
votes
1 answer

PHP 8.x Array to string conversion error in function validate_optional_fields in PHP-Nuke Titanium

I must be missing something... This is suppose to do supplementary validation of optional profile fields. This expects common stuff like trim() and strip_tags() to have already been run. Params are passed by-ref, so I can set them to an empty string…
0
votes
1 answer

Xdebug PHP. What are the optimal settings? Mine is dead slow

It's an old-age question. Am crawling at this point. It's year 2023, and yes, I have read tons of post here and elsewhere on the internet pertaining to this issue. It's important I use Xdebug for development. It's really concerning since a job that…
John Miller
  • 527
  • 4
  • 15
0
votes
0 answers

PHP8.2 Refactoring: How do I refactor dynamic parameters in PHP 8.2 since they are deprecated?

I have used an interface and a trait to fulfill the interface. interface Attachable { public function getAttachment(); public function setAttachment($attachment); } trait HasAttachment { public $attachment = null; public function…
0
votes
1 answer

Why PHP7 is faster than PHP8 in reading CSV file?

I did some simple test: reading csv file with 100 000 rows (10 columns) filled up by random English words. Script opened file, and put every rows to an array variable. ab -n 100 -l http://localhost:8000 I sent 100 request by Apache Benchmark command…
piweu
  • 1
  • 1
0
votes
2 answers

How can if fix this Laravel one to many with a custom foreign key behavior

I'm new to laravel and trying to make two tables with a one (customer) to many(table) relation and a custom Foreign Key tables.customer(I can not change this) The connection is over customers.id on tables.customer. After Running php artisan…
Silvan
  • 390
  • 7
  • 24