Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[php7] Fix for substr() always returning a string #15386

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
Jul 28, 2015

Conversation

nicolas-grekas
Copy link
Member

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

This should be the last required fix for PHP7 support.

The patch in the debug component is a workaround for a bug in PHP7 (http://3v4l.org/8rm9B) that is going to be fixed soon (@jpauli power).

@nicolas-grekas
Copy link
Member Author

FYI, I don't have the remaining failure on the Yaml component. I believe a php7 bug has been fixed that is currently not deployed on travis.

// Convert false values (from a previous call to substr()) to null
if (false === $value) {
// Convert empty values to null
if (!isset($value[0])) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not using empty instead ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$a = '0';
empty($a) === true

which would be wrong

@fabpot fabpot merged commit 77ee866 into symfony:2.3 Jul 28, 2015
fabpot added a commit that referenced this pull request Jul 28, 2015
…-grekas)

This PR was merged into the 2.3 branch.

Discussion
----------

[php7] Fix for substr() always returning a string

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

This should be the last required fix for PHP7 support.

The patch in the debug component is a workaround for a bug in PHP7 (http://3v4l.org/8rm9B) that is going to be fixed soon (@jpauli power).

Commits
-------

77ee866 [php7] Fix for substr() always returning a string
@nicolas-grekas nicolas-grekas deleted the fix-php7 branch July 28, 2015 14:29
@jpauli
Copy link

jpauli commented Jul 28, 2015

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