6 kyu
Object-Oriented PHP #8 - Interfaces [Advanced]
Loading description...
Object-oriented Programming
Fundamentals
Tutorials
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
It's worth noting that this part of the description:
is not (or no longer) correct. As long as both methods follow signature compatibility rules, a class can implement two interfaces describing methods with the same name.
So the two interfaces in the exercise that overlap are actually compatible, as the methods are identical.
Failed asserting that two strings are identical. Expected: 'Hello Benjamin, how are you?' Actual : 'Hello Donald, how are you?'
why does the $name variable take values from another class?
Failed asserting that null is identical to 'Barry'. Failed asserting that null is identical to 'Donald'.
what am I doing wrong?
smells like your're returning
null
LOL No. I just made a mistake in a word __construct
I'm too :) While not look your answer, not know where the mistake :)
Donald, you are awesome katamaker! So much work have been done to create these serieses. I wish more PHP katas in this conscientious and consistent way.
Just finished! Thank you for this kata series!!!! This is the best I've come across with PHP. You have no idea how much I've learned from doing these.
I appreciate them and hope there's more!
Cheers for the series, very helpful!
Thanks for the compliment; glad you found it helpful :D
i like this kata series and im awaiting the function series^^. But i have a question for what do you need interfaces if you doing your job correctly...
Its 100 times more work where you can make more mistakes.
Glad you're enjoying my Kata Series :D
As discussed in the Lesson in this Kata, various advantages of interfaces include:
That being said, if you are working on a small PHP project by yourself which involves only one or two classes, it is unnecessary and indeed bad practice to define interfaces for those classes to implement.
Hope this answers your question :D
Thanks for the hard work. This episode required a lot of careful typing by the student AND the course creator!
Thanks for your compliment :D
Generally nice series (perhaps a little bit long this one;-)), so many thanks for your effort! I would like to see some "PHP things without OOP" (or not as main and only point), like "normal/useful PHP commands, statements a.s.o" (PHP basics) needed for "usual programs or katas" - i think you know what i mean;-).
This series will probably end after one or two more Kata. After that, I'm thinking of perhaps starting a new series on PHP Functions ;)
Sounds good, i'm curious about it;-)! And i'm sure for the next part (PHP Functions) you quicker will get more code/solutions too (so perhaps more motivation for you;-))...