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

PHP Parse error: Invalid numeric literal #108

Open
dvjunior opened this issue Sep 16, 2017 · 3 comments
Open

PHP Parse error: Invalid numeric literal #108

dvjunior opened this issue Sep 16, 2017 · 3 comments

Comments

@dvjunior
Copy link

No description provided.

@dvjunior
Copy link
Author

dvjunior commented Sep 16, 2017

<?php

function wesley_safadao($day, $month, $year)
{
    $safadeza = array_sum(range(1, $month)) + ($year / 100) * (50 - $day);
    $anjo = 100 - $safadeza;
    return "Você é {$safadeza}% safado e {$anjo}% anjo";
}

echo wesley_safadao(12,08,94);

@haskellcamargo
Copy link
Collaborator

Não é 08. É 8. 08 é um octal inválido.

@arojunior
Copy link

O arquivo de teste acaba induzindo ao erro. No exemplo está echo wesley_safadao(21,01,95);

Com base na resposta do @haskellcamargo, o resultado de wesley_safadao(12,08,94); é diferente de wesley_safadao(12,8,94);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants