How to set php class attribute?

Because do is reserved keyword in PHP.

Demo of do as method name. (An error)

Demo without do, successfull outputs 2

You should change method name from do to something else since it is reserved keyword used in do-while loop.

Leave a Comment