Skip to content

[VarExporter] fix exporting array indexes #29741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 1, 2019
Merged

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Jan 1, 2019

Q A
Branch? 4.2
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #29715
License MIT
Doc PR

@xabbuh
Copy link
Member Author

xabbuh commented Jan 1, 2019

From the PHP documentation:

The key is optional. If it is not specified, PHP will use the increment of the largest previously used integer key.

@simPod
Copy link
Contributor

simPod commented Jan 1, 2019

Seems that it works 👍

@fabpot
Copy link
Member

fabpot commented Jan 1, 2019

Thank you @xabbuh.

@fabpot fabpot merged commit 3c936f4 into symfony:4.2 Jan 1, 2019
fabpot added a commit that referenced this pull request Jan 1, 2019
This PR was merged into the 4.2 branch.

Discussion
----------

[VarExporter] fix exporting array indexes

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #29715
| License       | MIT
| Doc PR        |

Commits
-------

3c936f4 [VarExporter] fix exporting array indexes
@xabbuh xabbuh deleted the issue-29715 branch January 1, 2019 18:02
@simPod
Copy link
Contributor

simPod commented Jan 2, 2019

Is there a chance this is released anytime soon?

I have not found a way to include it eg. via dev-master as 4.2 because Symfony uses one repository for all code merging that is kind of unusual to me. Is it possible to use this patch without release in some way? The commit is so far not there https://github.com/symfony/var-exporter/commits/master. Thanks!

@xabbuh
Copy link
Member Author

xabbuh commented Jan 2, 2019

Using ~4.2@dev as the version constraint should do the trick. The master branch is for the 4.3 release, but the 4.2 branch hasn't been merged into master yet.

@simPod
Copy link
Contributor

simPod commented Jan 2, 2019

@xabbuh that install the original version with if (\is_int($k)) { only. Am I missing something?

composer require symfony/var-exporter:"~4.2@dev" ->

        {
            "name": "symfony/var-exporter",
            "version": "dev-master",
            "source": {
                "type": "git",
                "url": "https://github.com/symfony/var-exporter.git",
                "reference": "d89a4ab8d3d8d7ac6487f2252b63b6d865f0cfac"
            },
            "dist": {
                "type": "zip",
                "url": "https://api.github.com/repos/symfony/var-exporter/zipball/d89a4ab8d3d8d7ac6487f2252b63b6d865f0cfac",
                "reference": "d89a4ab8d3d8d7ac6487f2252b63b6d865f0cfac",
                "shasum": ""
            },
            "require": {
                "php": "^7.1.3"
            },
            "require-dev": {
                "symfony/var-dumper": "^4.1.1"
            },
            "type": "library",
            "extra": {
                "branch-alias": {
                    "dev-master": "4.3-dev"
                }
            },
            "autoload": {
                "psr-4": {
                    "Symfony\\Component\\VarExporter\\": ""
                },
                "exclude-from-classmap": [
                    "/Tests/"
                ]
            },
            "notification-url": "https://packagist.org/downloads/",
            "license": [
                "MIT"
            ],
            "authors": [
                {
                    "name": "Nicolas Grekas",
                    "email": "p@tchwork.com"
                },
                {
                    "name": "Symfony Community",
                    "homepage": "https://symfony.com/contributors"
                }
            ],
            "description": "A blend of var_export() + serialize() to turn any serializable data structure to plain PHP code",
            "homepage": "https://symfony.com",
            "keywords": [
                "clone",
                "construct",
                "export",
                "hydrate",
                "instantiate",
                "serialize"
            ],
            "time": "2018-12-13T12:43:21+00:00"
        }

@ogizanagi
Copy link
Contributor

ogizanagi commented Jan 2, 2019

@simPod : try ~4.2.0@dev instead (or 4.2.x@dev).

@simPod
Copy link
Contributor

simPod commented Jan 2, 2019

Works, thanks!

@fabpot fabpot mentioned this pull request Jan 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants