I started a fresh new Focal VM and followed the testcase to get symfony installed and configured, as well as docker. The VM is running php7.4 7.4.3-4ubuntu2.15 from -updates.
Upon running the cloned project that reproduces the issue, I see:
$ curl http://127.0.0.1:8000
...
Error:
Typed property Proxies\__CG__\App\Entity\Store::$ must not be accessed before initialization (in __sleep)
at vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php:626
at serialize()
(vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php:626)
at Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer->getCacheKey()
(vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php:327)
at Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer->denormalize()
(vendor/symfony/serializer/Serializer.php:191)
at Symfony\Component\Serializer\Serializer->denormalize()
(src/Controller/DefaultController.php:47)
at App\Controller\DefaultController->index()
(vendor/symfony/http-kernel/HttpKernel.php:146)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
(vendor/symfony/http-kernel/HttpKernel.php:68)
at Symfony\Component\HttpKernel\HttpKernel->handle()
(vendor/symfony/http-kernel/Kernel.php:201)
at Symfony\Component\HttpKernel\Kernel->handle()
(public/index.php:25)
...
I then went and enabled -proposed and upgraded php7.4 to 7.4.3-4ubuntu2.16, and restarted the reproducer.
Additionally, looking at the php testcase added to the source tarball, we see during build of 7.4.3-4ubuntu2.16 the test passes:
TEST 12251/13940 [ext/standard/tests/serialize/sleep_uninitialized_typed_prop.phpt]
PASS Referencing an uninitialized typed property in __sleep() should be skipped [ext/standard/tests/serialize/sleep_uninitialized_typed_prop.phpt]
The package in -proposed fixes the issue, happy to mark verified for Focal.
Performing verification for Focal
I started a fresh new Focal VM and followed the testcase to get symfony installed and configured, as well as docker. The VM is running php7.4 7.4.3-4ubuntu2.15 from -updates.
Upon running the cloned project that reproduces the issue, I see:
$ curl http:// 127.0.0. 1:8000 __CG__\ App\Entity\ Store:: $ must not be accessed before initialization (in __sleep)
...
Error:
Typed property Proxies\
at vendor/ symfony/ serializer/ Normalizer/ AbstractObjectN ormalizer. php:626 symfony/ serializer/ Normalizer/ AbstractObjectN ormalizer. php:626) Component\ Serializer\ Normalizer\ AbstractObjectN ormalizer- >getCacheKey () symfony/ serializer/ Normalizer/ AbstractObjectN ormalizer. php:327) Component\ Serializer\ Normalizer\ AbstractObjectN ormalizer- >denormalize () symfony/ serializer/ Serializer. php:191) Component\ Serializer\ Serializer- >denormalize () Controller/ DefaultControll er.php: 47) DefaultControll er-> index() symfony/ http-kernel/ HttpKernel. php:146) Component\ HttpKernel\ HttpKernel- >handleRaw( ) symfony/ http-kernel/ HttpKernel. php:68) Component\ HttpKernel\ HttpKernel- >handle( ) symfony/ http-kernel/ Kernel. php:201) Component\ HttpKernel\ Kernel- >handle( ) index.php: 25)
at serialize()
(vendor/
at Symfony\
(vendor/
at Symfony\
(vendor/
at Symfony\
(src/
at App\Controller\
(vendor/
at Symfony\
(vendor/
at Symfony\
(vendor/
at Symfony\
(public/
...
I then went and enabled -proposed and upgraded php7.4 to 7.4.3-4ubuntu2.16, and restarted the reproducer.
We now see:
$ curl -I http:// 127.0.0. 1:8000
HTTP/1.1 200 OK
The issue no longer reproduces.
Additionally, looking at the php testcase added to the source tarball, we see during build of 7.4.3-4ubuntu2.16 the test passes:
TEST 12251/13940 [ext/standard/ tests/serialize /sleep_ uninitialized_ typed_prop. phpt] tests/serialize /sleep_ uninitialized_ typed_prop. phpt]
PASS Referencing an uninitialized typed property in __sleep() should be skipped [ext/standard/
The package in -proposed fixes the issue, happy to mark verified for Focal.