448191 Posted February 24, 2007 Share Posted February 24, 2007 I guess that COULD be implemented. It would bring a lot of complex changes to the php core me thinks though..Not to mention it wouldn't exactly improve readabilty of code... ;) Quote Link to comment Share on other sites More sharing options...
Nameless12 Posted March 1, 2007 Share Posted March 1, 2007 "->" is used in c when you have a pointer to a structure and as we all know php is made in c. In c "->" means "points at" Quote Link to comment Share on other sites More sharing options...
neylitalo Posted March 1, 2007 Share Posted March 1, 2007 Yes, that's what it means and does in C, but it doesn't do the same thing in PHP. Quote Link to comment Share on other sites More sharing options...
Nameless12 Posted March 2, 2007 Share Posted March 2, 2007 You are right it does not do the same thing because php is not c. But pointers to structures and instances are so alike that this is the reason cpp and php and perl and a few others chose to use the points at symbol and that is why i said what I did but after saying this i wonder if php copied perl, c or cpp most probably all 3. I am not quite sure, It might be time for me to learn more of the php internals I have put it off for so long. Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted March 2, 2007 Share Posted March 2, 2007 Maybe the original person(s) that implemented objects in PHP didn't want to deal with the added complexity of dealing with the problems myself and 448191 discussed above; or they didn't [i]know[/i] how to deal with them.Either way, they chose -> and the bottom line is no one has bothered to go back and implement a dot operator that does the same thing. And why would anyone want to? There's no [i]practical[/i] reason in this case to go back and implement a second operator that does the exact same thing as one that already exists. Quote Link to comment Share on other sites More sharing options...
.josh Posted March 2, 2007 Share Posted March 2, 2007 I'm guessing they used -> instead of . because they implemented . as concatenator [i]before[/i] oop was implemented, simple as that. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.