This forum is now read-only. Please use our new forums! Go to forums
Please help me i stuck on this section for 3days, only 1 section, I just got an error message, although the program run "I have sides" on the screen
Any suggestion??? Please help me out,
<?php
class Shape {
public $hasSides = true;
}
class Square extends Shape {
}
$square = new Square();
// Add your code below!
if (property_exists($square,"hasSides")) {
echo "I have sides!";
}
?>
Answer 515c0e1405c67af34c00021e
1- Go to that section ( if I recall, it’s the third one). 2- Make sure it displays “I have sides” on the right screen 3- Click on submit. ( You will get the same error but that’s fine, just trust me). 4- With the new coding interface, you can change from one section to another with the drop-down list located on the top left side of your screen. 5- click on that dropdown list and select the next section ( the forth one). 6- If you check the dropdown list again, you will normally see that the previous section( the one which has got the problem) is validated. Even if you click on submit again, it won’t work.
Another bug which has to be fixed in the php track by the codecademy guys…
Answer 518b4cdf085155f114003595
This worked for me:
<?php
class Shape {
public $hasSides = true;
}
class Square extends Shape {
}
$square = new Square();
// Add your code below!
if (property_exists($square, "hasSides") ) {
echo "I have sides!";
}
?>
Answer 516329d521c92c6313000997
any of suggestions doesn’t work for me
1 comments
me too.
Answer 515bfaffce60d89c79000e40
I had similar problem but it just ‘passed’ when I submitted it few times in row.
1 comments
thanks for helping me out, i pass now
Answer 516916bd99f5cd4b56001204
I tried the suggest steps and I still was getting the error, but changing echo to print got the green light!
Answer 5170888cced9aa3dfd000036
I just put in your code and it worked first try!
Answer 515c42fe812a55a64e00005f
Submitting it a second time worked for me also!
Answer 5268d30aabf821e956003537
class Square extends Shape {
}
$square = new Square();
if ( property_exists($square, 'hasSides')){
echo 'I have sides';
}
if ( property_exists($square, 'Shape' )) {
echo "I have sides!";
}
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
14 comments
thanks for helping me out, i pass now
You pass now BUT if you go back to the main php track, it will display that you didn’t… ( new bug)
well, i am aware of that too, but i try new method by keeping on submitting the code again and again, until I got Greet light. Once it is Green light, problem solve, I pass forever. Thanks again, by the way.
if you also experience problem with this session, I hope you can pass soon too
I can’t pass the section, but my code is correct, but it won’t give me the badge for the section… thoughts? help?
well i pass after a lot of try in a lot of days (like 5 days) in a row, and when i truly pass, they gave me badge for object-oriented as well, good luck.
The solution is : submitting a lot, like 30 times with the shortcut: ctrl+enter or cmd+enter (if you’re a mac user) eventually, you will pass, believe me.
thanks
Tnks, it’s solve
+1000000 Thanks!!!!!!!!!!!!!!!!!!!!!!
You’re welcome! Could you please click on the up arrow to vote :) thanks
@Chedly Greed ^_^ You got that for that work.
Doesn’t work as of 4/14
Sadly doesn’t work anymore… :(