Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP PHP Basics Unit Converter Manipulating Numbers

Andrew Dovganyuk
Andrew Dovganyuk
10,633 Points

Plaese help what is wrong in my code???:(

Plaese help what is wrong in my code???:(

index.php
<?php

//Place your code below this comment

$integerOne = 1;
$integerOne = $integerOne + 5;
var_dump ($integerOne);
$integerTwo = 2;
$integerTwo = $integerTwo - 1;
var_dump ($integerTwo);


$floatOne = 1.5;
var_dump ($floatOne * $integerOne);


?>

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! You're doing really well here. They do say to display the results of integerOne multiplied by floatOne. What they are expecting here is for you to display the result without displaying the entire information contained in a var_dump. It's expecting an echo statement to be used here.

Challenges can be very strict and if you do something it's not expecting, it can cause the challenge to fail even if it's functional. To get this to pass, I removed all your var_dump lines as they are not required by the challenge. And the line you're missing is an echo statement that looks very much like the code you've already written. :thumbsup:

Take a look:

echo $floatOne * $integerOne;

Hope this helps! :sparkles:

edited for correctness

Andrew Dovganyuk
Andrew Dovganyuk
10,633 Points

Thank you Jennifer for your respond, but the code echo $floatOne * $integerOne; do nt work to :(

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Other than removing the var_dump and adding that echo, I'm not sure what to tell you. This code passes all three steps for me.

<?php

//Place your code below this comment

$integerOne = 1;
$integerTwo = 2;
$integerOne = $integerOne + 5;
$integerTwo = $integerTwo - 1;
$floatOne = 1.5;

echo $floatOne * $integerOne;

?>

You might consider restarting the challenge if you're still experiencing problems.

Andrew Dovganyuk
Andrew Dovganyuk
10,633 Points

Oh!!!!!!!!! Thanks now its work!!!! You save me!!! Thank you Jennifer!!!;)