Skip to content
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

Incorrect cast to (int) and (float) for num string. #828

Closed
kse300489 opened this issue Mar 20, 2015 · 0 comments · Fixed by #2194
Closed

Incorrect cast to (int) and (float) for num string. #828

kse300489 opened this issue Mar 20, 2015 · 0 comments · Fixed by #2194
Labels
Milestone

Comments

@kse300489
Copy link

kse300489 commented Mar 20, 2015

Example zephir:

            var
                version = "1.0 200 OK",
                floatVersion,
                intVersion;

            var_dump(version);

            let
                floatVersion = (float)version,
                intVersion   = (int)version;

            var_dump(floatVersion);
            var_dump(intVersion);

Output:

string(10) "1.0 200 OK"
float(0)
int(0)

PHP example:

$version      = "1.0 200 Found";
$intVersion   = (int)$version;
$floatVersion = (float)$version;

var_dump($version);
var_dump($intVersion);
var_dump($floatVersion);

Output:

string(13) "1.0 200 Found"
int(1)
double(1)

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/9780046-incorrect-cast-to-int-and-float-for-num-string?utm_campaign=plugin&utm_content=tracker%2F280146&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F280146&utm_medium=issues&utm_source=github).
@kse300489 kse300489 changed the title Incorect cast to (int) and (float) for num string. Incorect cast to (int) and (float) for num string. Also incorrect cast to (array). Mar 20, 2015
@kse300489 kse300489 changed the title Incorect cast to (int) and (float) for num string. Also incorrect cast to (array). Incorect cast to (int) and (float) for num string. Mar 20, 2015
@andresgutierrez andresgutierrez changed the title Incorect cast to (int) and (float) for num string. Incorrect cast to (int) and (float) for num string. Apr 4, 2015
@danhunsaker danhunsaker added this to Needs triage in Zephir Bugs Dec 12, 2018
@sergeyklay sergeyklay moved this from Needs triage to Low priority in Zephir Bugs Mar 10, 2019
@niden niden removed this from Low priority in Zephir Bugs Feb 16, 2021
Jeckerson added a commit that referenced this issue Apr 4, 2021
@Jeckerson Jeckerson added this to the 0.13.x milestone Apr 4, 2021
@Jeckerson Jeckerson linked a pull request Apr 4, 2021 that will close this issue
3 tasks
Jeckerson added a commit that referenced this issue Apr 5, 2021
Jeckerson added a commit that referenced this issue Apr 5, 2021
Jeckerson added a commit that referenced this issue Apr 5, 2021
@Jeckerson Jeckerson modified the milestones: 0.13.x, 0.13.2 Apr 5, 2021
Jeckerson added a commit that referenced this issue Apr 5, 2021
AlexNDRmac added a commit that referenced this issue Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants