This forum is now read-only. Please use our new forums! Go to forums
Solution if stuck on this exercise
This exercise is a bit annoying because although the directions tell you to do one thing, the solution is the opposite. To prevent others from getting as annoyed as I did, here’s the solution that worked for me:
Answer 51724b1d76defe47f7001212
Hello, although your code isn’t correct it passes. :-(
The following code is the expected one:
<?php
class Person {
}
$teacher = new Person();
$student = new Person();
?>
Answer 517ac9cb82055c93d5000489
Here is the solution to part two of the exercise.
He uses $obj1 as a way to ad new instances(obj1 is just an example).
$teacher = new Person();
$student = new Person();
Remember you’re creating instances for the person class. Took me a while because that obj1 threw me off, I was thinking necessary to use it. Sometimes the directions are a little screwy.
Answer 52e9490a8c1ccc06e7003601
1 comments
just follow the instruction your class must be named a “Person” in order to work your code bro :D
Answer 52eaa88d80ff330dbc000286
I had this thing right, but it gave me the error: “Have you added the php tags?” I had, but I wrote it on line 10 instead of line 9…
1 comments
maybe u dont have a closing tags for that bro :D
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
4 comments
When do you know to use the { } symbols?
I thought it was:
If it has to be in the class (like properties and methods), it will go into the parentheses. Otherwise it will stay outside (instances). ;-)
This is correct boring12345
tanx for the solution bro :D this help me eventhough its simple