Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Casting TableCell value to string.#21430

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

@jaydiablo
Copy link
Contributor

QA
Branch?2.7
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#21429
LicenseMIT
Doc PR

PHP throws a catchable fatal error when the value from this method is
used in strstr in the Table class. This fixes the error by casting to a string before returning the value.

PHP throws a catchable fatal error when the value from this method isused in strstr in the Table class.
@xabbuh
Copy link
Member

Taking it strictly the current behaviour is not wing as theTableCell constructor documents that it expects a string. In the other hand does this change not do any harm. So +0 from me on the proposed change.

@chalasr
Copy link
Member

Looks like a feature to me, it is the expected behavior on 2.7.

@nicolas-grekas
Copy link
Member

👍 on 2.7, minor tweak to me

@nicolas-grekasnicolas-grekas added this to the2.7 milestoneJan 29, 2017
@fabpot
Copy link
Member

fabpot commentedJan 30, 2017
edited
Loading

I would only cast for ints then.

@xabbuh
Copy link
Member

@jaydiablo Can you make the change@fabpot asked for? :)

@jaydiablo
Copy link
ContributorAuthor

Sure, what about other numeric values that aren't ints? Like a float.

Should we wrap the cast in something like:

if (is_numeric($value) && !is_string($value)) {

?

@fabpot
Copy link
Member

My point was that I don't want to have a cast to a string for objects for instance.

@fabpot
Copy link
Member

Thank you@jaydiablo.

fabpot added a commit that referenced this pull requestFeb 3, 2017
This PR was squashed before being merged into the 2.7 branch (closes#21430).Discussion----------Casting TableCell value to string.| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#21429| License       | MIT| Doc PR        |PHP throws a catchable fatal error when the value from this method isused in strstr in the Table class. This fixes the error by casting to a string before returning the value.Commits-------1e5707f Casting TableCell value to string.
@fabpotfabpot closed thisFeb 3, 2017
@jaydiablojaydiablo deleted the console-tablecell-numeric-fix branchFebruary 4, 2017 06:09
This was referencedFeb 6, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

2.7

Development

Successfully merging this pull request may close these issues.

6 participants

@jaydiablo@xabbuh@chalasr@nicolas-grekas@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp