php-8 Questions

2

Is it possible to combine annotations together with attributes like: /** * @Gedmo\Timestampable(on="create") */ #[ORM\Column(type: 'datetime')] private ?DateTime $createdAt;
Forta asked 11/11, 2021 at 16:2

2

Is there any way, using reflection or otherwise, to change a readonly property that has already been set? We sometimes do that in tests, and we don't want to avoid using readonly props just for tes...
Hon asked 18/3, 2022 at 17:12

2

Solved

I'm defining a class as follow, using the suggestion from https://blog.jetbrains.com/phpstorm/2020/10/phpstorm-2020-3-eap-4/#arrayshape to define the array shape as a constant so that it can be use...
Glasshouse asked 10/11, 2021 at 0:59

3

I've set-up everything as best as I can and yet I see JIT status as Disabled. Here's what I have: echo (function_exists('opcache_get_status') && opcache_get_status()['jit']['enabled']) ? ...
Arrowwood asked 10/5, 2022 at 8:4

5

Solved

What is the simplest way to detect if PHP is compiled with JIT and JIT is enabled from the running script?
Goshawk asked 30/6, 2020 at 9:32

1

I've been looking for some guidelines regarding the optimal value of opcache.jit_buffer_size. The proposed values are up to 256M (e.g. https://php.watch/versions/8.0/JIT#jit-opcache.jit_buffer_size...
Redhot asked 1/3, 2023 at 23:19

3

Solved

As Doctrine seems to have completely removed annotations support in their latest updates, I am trying to convert the annotations in my entities to attributes using Rector. I followed the (seemingly...
Reputable asked 7/10, 2022 at 9:4

2

Solved

PHP 8 changes how the "open" of a ZIP archive works and it is noted that: Using empty file as ZipArchive is deprecated. Libzip 1.6.0 do not accept empty files as valid zip archives any l...
Wolters asked 5/11, 2020 at 14:10

2

Solved

We are preparing to move to php 8.0.15 once some third party libraries we require are ready for it. Our centralized setUp() function for unit tests handles constructorArg population for our class m...
Nonentity asked 21/2, 2022 at 19:46

5

Solved

My app works on Laravel 8 with laravel/passport 10.0.1. After upgrading php version on dev server from 7.4 to 8.0, I'm getting It was not possible to parse your key, reason: "" error (wit...
Insanitary asked 29/11, 2020 at 23:53

1

I have been trying to install pdo_pgsql. Homebrew is not working. Adminer needs this extension for accessing the DB. How to solve the issue? PgSQL and PDO_PgSQL extensions are already enabled on th...
Trotline asked 8/3, 2021 at 17:29

6

Solved

Deprecated: Required parameter $xxx follows optional parameter $yyy in... Since upgrading to PHP 8.0 this error is thrown when running code like this: function test_function(int $var1 = 2, int $va...
Dyewood asked 14/12, 2020 at 22:16

5

Solved

I just updated my Mac M1 to Big Sur 11.5.2 and something in VSCode seems to have broken. I am unable to use the latest home-brew php which is installed. In VSCode its pointing to /usr/bin/php which...
Brussels asked 23/8, 2021 at 21:21

4

Solved

After updating PHP from 7.4 to 8.0, I ran composer update on my existing project, and got an error like this: acme/some-package[1.0.0, ..., 1.4.0] requires php ^5.6.4 || ^7.0 -> your php versi...
Mauritius asked 25/2, 2021 at 12:7

4

After upgrade to php8 I have a problem with php-cs-fixer which I installed globally via composer. Right now I can not use php-cs-fixer because every time I get: PHP needs to be a minimum version of...
Lentissimo asked 15/1, 2021 at 15:2

5

NB: Local server PHP Version 8.1.4, laravel project inside composer.json file have "php": "^7.2.5", version & "laravel/framework": "^7.0" PHP Fatal...
Gentility asked 6/6, 2022 at 8:57

3

Solved

I use the guzzlehttp/guzzle package in Laravel 8. After upgrading to PHP 8, I get: Symfony\Component\ErrorHandler\Error\FatalError: Invalid opcode 117/2/0. in file ../vendor/defuse/php-encryption/...
Entasis asked 27/11, 2020 at 7:43

3

Solved

I am updating my project from PHP 7.0 to PHP 8.0 and I couldn't find out, if it is allowed to EXPLICITLY assign resource as the data type: of a class property, of a method/function parameter, retu...
Alfonzoalford asked 30/3, 2021 at 13:8

5

I test phpmyadmin 5.0.4 and 5.1.0.RC1 on ubuntu server 20.04, and I'm geeting the following error : Warning in ./libraries/classes/Config.php#1285 mkdir(): Permission denied Backtrace ./libraries...
Villada asked 9/1, 2021 at 9:29

2

Solved

Eloquent allows Enum Casting. Eloquent also allows you to cast your attribute values to PHP enums. To accomplish this, you may specify the attribute and enum you wish to cast in your model's $cast...
Stoller asked 16/11, 2021 at 17:25

4

Solved

Is there any way to write the following statement using some kind of safe navigation operator? echo $data->getMyObject() != null ? $data->getMyObject()->getName() : ''; So that it looks l...
Floatable asked 10/9, 2012 at 12:28

6

Solved

I'm trying to update my PHP version to the brand new PHP 8. I have followed simular steps as this tutorial. But now the following error is shown: 12:06:23 [Apache] Error: Apache shutdown unexpected...
Bunting asked 30/11, 2020 at 11:16

1

I have a class that works on only the two types a and b. My "oldstyle" code today: class Work1 { public function do(string $type):string { if ($type!="a" && $type!=&qu...
Mi asked 17/1, 2023 at 11:11

1

I am trying to install LEMP on vultr's Ubuntu 22.04 server. I can install Nginx sudo apt install -y nginx - no problem. But when I try to install php8.0 by running these commands sudo apt install s...
Callida asked 19/3, 2022 at 15:14

2

Tried many ways, but still unable to get GD enabled with JPEG support in PHP8 container running in Docker. Here's the fragment of my Docker file: FROM php:8.0.10-apache RUN apt-get -y update &...
Daze asked 13/10, 2021 at 13:6

© 2022 - 2025 — McMap. All rights reserved.