4 ms·
PHP's amenability to shared hosting environments is an advantage I failed to mention. I'm pretty much in the same place as you with regards to PHP: I know it l
by seldo 16y ago
PHP's amenability to shared hosting environments is an advantage I failed to mention.
I'm pretty much in the same place as you with regards to PHP: I know it like the back of my hand and everything and everybody works with it. But the code is ugly compared to other languages and I really want method chaining, dammit. Plus, of course, I don't want to have to write an MVC framework every time I want to do something.
- jlgbecom 16y agoUnless you're being more specific than I think you are, PHP5 has basic support for method chaining, I use it all the time.
- byoung2 16y agoI use structures like this in PHP5 all the time: $object->doThis()->doThat()->doTheOther(); But maybe he is referring to method chaining using PHP's built-in functions. There isn't a way that I'm aware of to do the following (short of wrapping the built-in functions with your own classes): $string->preg_replace("/[^A-Za-z]+/","_")->trim()->upper();
- seldo 16y agoPrecisely what I meant, thanks for clarifying.
- BerislavLopac 16y agoBut this is not method chaining, that's simple function nesting, and can easily be done as: $string = preg_replace("/[^A-Za-z]+/","_", trim(upper($string))); Or am I missing your point?
- bl4k 16y agosomething tells me you don't know what method chaining is
- jhaglund 16y agoRe: MVC re-writing. I settled on Zend Framework and havn't looked back. http://framework.zend.com/ http://framework.zend.com/ (link added)
- jawngee 16y ago> I really want method chaining, dammit What? We've been doing code like: filter('user') ->first_name->like('bob') ->age->equals('22') ->order_by->created->desc ->find(); Since 5.2.x
- auxbuss 16y agoMethod-chaining has been there for a while. I keep happening upon projects with their own craptacular homebrew MVC framework, and their own abysmal homebrew caching. Fix is a swap for yii and memcached -- feel free to choose your faves.