News for hackers. Stuff that matters.
Re:OK, here's the thing: this is only the entrance of the ra... by grandalf on Tuesday October 19, 2010 @02:13AM (#1806372)
The one thing I dislike about how a lot of php code is written is the way that requires are used as function calls (but without any declaration of what variables the required code is expecting to find).

Oddly, Rails partials work this way too. They can see the controller's instance variables and are often written without any sort of defined interface, which makes for confusing, brittle code. Fortunately Rails offers the option to pass in :locals (just as php offers the option of simply using functions instead of require).

Re:OK, here's the thing: this is only the entrance of the ra... by jasonlotito on Tuesday October 19, 2010 @02:58PM (#1808285)
Wait, what? A lot of PHP code use requires as functions? Honestly surprised here. I've never seen this.
Re:OK, here's the thing: this is only the entrance of the ra... by grandalf on Tuesday October 19, 2010 @07:09PM (#1809221)
sugarcrm, phpbb, and others do it. It's very ugly. I have not seen either codebase in several years though so it may have changed.