Linked by Thom Holwerda on Mon 20th Feb 2006 17:55 UTC
General Development "The introduction of new object-oriented programming features in PHP V5 has significantly raised the level of functionality in this programming language. Not only can you have private, protected, and public member variables and functions - just as you would in the Java, C++, or C# programming languages - but you can also create objects that bend at runtime, creating new methods and member variables on the fly. You can't do that with the Java, C++, or C# languages. This kind of functionality makes super-rapid application development systems, such as Ruby on Rails, possible."
Thread beginning with comment 97767
To view parent comment, click here.
To read all comments associated with this story, please click here.
Member since:

And how is reflection at fault here?

Err, what did I miss? I don't follow you. My example had nothing to do with reflection, it had to do with php not requiring you to declare variables.

I guess my example wasn't too good because he was asking about functions/methods and I was talking about variables. I'm not going to try to invent an example for functions/methods because I don't understand enough about how php handles them but I don't think it's too hard to come up with a scenario where you mistype or make a bad assumption and something unintended happens.

Anyways, this is getting too much into the semantics of strongly/weakly typed languages. As I said before, both have their advantages and places (I personally happen to be much more comfortable with strong typing).

Reply Parent Score: 1

Shane Member since:

Sorry, I assumed that you were saying that the ability to dynamically add methods was going to create security issues. The poster you replied to assumed the same thing, since he asked for an example relating to that.

As for declaring variables, it is not that big of an issue. On your development server, just configure PHP to give you a notice whenever it encounters an uninitialised variable.

Reply Parent Score: 1

AnonaMoose Member since:

No actually I`ve been saying it will NOT cause security issues and I asked for an example that would show an example of one.
To clarify I`m mainly talking about the adding of methods dynamically, SQL injection is another issue alltogether.

Hope this clears up the confusion as I know I`m confused about how you understood my reply the way you did ;) , maybe some sleep for me is on the cards.

Reply Parent Score: 1