Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #33292 [VarExporter] fix support for PHP 7.4 (nicolas-grekas)
This PR was merged into the 4.3 branch. Discussion ---------- [VarExporter] fix support for PHP 7.4 | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #32844 | License | MIT | Doc PR | - Commits ------- 1a036dc [VarExporter] fix support for PHP 7.4
- Loading branch information
Showing
15 changed files
with
201 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/Symfony/Component/VarExporter/Tests/Fixtures/array-iterator-legacy.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate( | ||
$o = [ | ||
clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['ArrayIterator'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('ArrayIterator')), | ||
], | ||
null, | ||
[ | ||
'ArrayIterator' => [ | ||
"\0" => [ | ||
[ | ||
[ | ||
123, | ||
], | ||
1, | ||
], | ||
], | ||
], | ||
], | ||
$o[0], | ||
[] | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/Symfony/Component/VarExporter/Tests/Fixtures/array-object-custom-legacy.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate( | ||
$o = [ | ||
clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['Symfony\\Component\\VarExporter\\Tests\\MyArrayObject'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('Symfony\\Component\\VarExporter\\Tests\\MyArrayObject')), | ||
], | ||
null, | ||
[ | ||
'ArrayObject' => [ | ||
"\0" => [ | ||
[ | ||
[ | ||
234, | ||
], | ||
1, | ||
], | ||
], | ||
], | ||
], | ||
$o[0], | ||
[] | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/Symfony/Component/VarExporter/Tests/Fixtures/array-object-legacy.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate( | ||
$o = [ | ||
clone (($p = &\Symfony\Component\VarExporter\Internal\Registry::$prototypes)['ArrayObject'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('ArrayObject')), | ||
clone $p['ArrayObject'], | ||
], | ||
null, | ||
[ | ||
'ArrayObject' => [ | ||
"\0" => [ | ||
[ | ||
[ | ||
1, | ||
$o[0], | ||
], | ||
0, | ||
], | ||
], | ||
], | ||
'stdClass' => [ | ||
'foo' => [ | ||
$o[1], | ||
], | ||
], | ||
], | ||
$o[0], | ||
[] | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/Symfony/Component/VarExporter/Tests/Fixtures/final-array-iterator-legacy.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate( | ||
$o = \Symfony\Component\VarExporter\Internal\Registry::unserialize([], [ | ||
'C:54:"Symfony\\Component\\VarExporter\\Tests\\FinalArrayIterator":49:{a:2:{i:0;i:123;i:1;s:21:"x:i:0;a:0:{};m:a:0:{}";}}', | ||
]), | ||
null, | ||
[], | ||
$o[0], | ||
[] | ||
); |
14 changes: 10 additions & 4 deletions
14
src/Symfony/Component/VarExporter/Tests/Fixtures/final-array-iterator.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
<?php | ||
|
||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate( | ||
$o = \Symfony\Component\VarExporter\Internal\Registry::unserialize([], [ | ||
'C:54:"Symfony\\Component\\VarExporter\\Tests\\FinalArrayIterator":49:{a:2:{i:0;i:123;i:1;s:21:"x:i:0;a:0:{};m:a:0:{}";}}', | ||
]), | ||
$o = [ | ||
clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['Symfony\\Component\\VarExporter\\Tests\\FinalArrayIterator'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('Symfony\\Component\\VarExporter\\Tests\\FinalArrayIterator')), | ||
], | ||
null, | ||
[], | ||
$o[0], | ||
[] | ||
[ | ||
[ | ||
0, | ||
[], | ||
[], | ||
], | ||
] | ||
); |
27 changes: 27 additions & 0 deletions
27
src/Symfony/Component/VarExporter/Tests/Fixtures/final-error-legacy.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate( | ||
$o = \Symfony\Component\VarExporter\Internal\Registry::unserialize([], [ | ||
'O:46:"Symfony\\Component\\VarExporter\\Tests\\FinalError":1:{s:12:"'."\0".'Error'."\0".'trace";a:0:{}}', | ||
]), | ||
null, | ||
[ | ||
'TypeError' => [ | ||
'file' => [ | ||
\dirname(__DIR__).\DIRECTORY_SEPARATOR.'VarExporterTest.php', | ||
], | ||
'line' => [ | ||
123, | ||
], | ||
], | ||
'Error' => [ | ||
'trace' => [ | ||
[], | ||
], | ||
], | ||
], | ||
$o[0], | ||
[ | ||
1 => 0, | ||
] | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/Symfony/Component/VarExporter/Tests/Fixtures/spl-object-storage-legacy.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate( | ||
$o = [ | ||
clone (($p = &\Symfony\Component\VarExporter\Internal\Registry::$prototypes)['SplObjectStorage'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('SplObjectStorage')), | ||
clone ($p['stdClass'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('stdClass')), | ||
], | ||
null, | ||
[ | ||
'SplObjectStorage' => [ | ||
"\0" => [ | ||
[ | ||
$o[1], | ||
345, | ||
], | ||
], | ||
], | ||
], | ||
$o[0], | ||
[] | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters