Live data from Hacker News

PHP 7 Released

github.com

251–260 of 317 posts

Re: PHP 7 Released

#251

Earlier quoted context omitted.

Wordpress alone runs 25%+ of all websites. PHP's time is clearly still now. I probably won't bother with PHP, but it can't hurt to keep my idea of what it's like up to date. It's only technology, no need to be fanatical about it.

To be fair, don't just down vote the parent comment because your don't like someone bashing php; it's a pretty reasonable question to ask. Most people don't actually know that php powers such a large portion of the internet, because globally there's waning interest in php ( http://www.tiobe.com/index.php/content/paperinfo/tpci/PHP.ht... ) and it's generally dreaded by developers ( http://stackoverflow.com/research/de…

There's plenty of php work. I don't have that language on my resume, I don't seek such jobs, but there are just sooo many of them that 5 of my previous 7 years of employment with 4 firms, probably 10 contracts --- all PHP.

It's just like "alright that's fine". Maybe there's so many of them because my high falutin snobby peers are simply too good for dirty php. Who knows?

Re: PHP 7 Released

#253

Are they skipping 6.X releases or something? The latest release according to php.net [0] is 5.6.15 which come out October 29th of 2015. [0] https://secure.php.net/releases/

For a long time, there was a PHP6 in the works, but then HHVM and Hack came around and started making PHP6 look bad. There was another fork called PHP-NG, I believe, which went in a different direction. There was a huge pissing match in the internals list, and in the end, I think they threw threw out most of the PHP6 proposals and started fresh. To clear up matters, they skipped PHP6 and called it PHP7. Don't quote m…

The primary reasons for skipping PHP6 were that several books had been published on what PHP6 was supposed to be (full unicode support, for example), talks had been given and the original php 6 branch was ultimately ditched. The full list of reasons are at: https://wiki.php.net/rfc/php6

Re: PHP 7 Released

#254

Earlier quoted context omitted.

Agree, then again there are different types of people. Some wants to learn from bottom up(analytic approach), others want to see cool stuff then tweak, modify, replace to find the limits (holistic approach). IIRC there is a tendency that young people prefer the holistic approach while teachers either are selected for or grow into preferring the analytical approach.

Doesn't holistic approach just make sense? It's not like you learned to speak with your parents reading you the dictionary beginning with the letter A.

Its a good way to start and actually make things happen. But it's also important to get beyond that to become a strong developer.

Some do, some don't.

jQuery is a common way to learn to do front end programming. It saves a lot of time when used well. But it is important to extend the knowledge to core javascript and be able to write code when jQuery is not available (like when writing scripts to embed on different sites).

Re: PHP 7 Released

#256
post #250

Earlier quoted context omitted.

> PDO is awesome but requires deeper level of understanding (for a beginner), which may increase the frustration and may end up returning back to the mysql_query and co. Yeah, that's basically why I wrote EasyDB. https://github.com/paragonie/easydb $rows = $db->run('SELECT * FROM comments WHERE blogpostid = ? ORDER BY created ASC', $_GET['blogpostid']); foreach ($rows as $row) { // etc } Teach people to do things thi…

At the same time I understand why it would be more confusing for newbies. In a language that already has string interpolation you're telling them to use a crappier custom version of string interpolation that's safe for databases. Tutorials need to be more upfront about that.

I've got "writing an open access PHP 7 online book to hopefully serve as a new, best-practices tutorial" next on my to do list.

Re: PHP 7 Released

#257

Earlier quoted context omitted.

Apologies, I meant string literals. There's no technical reason the language couldn't make it so that string literals can be identified at runtime. There are several good ways to put a stop to SQL injection. Better education is one, better APIs is another. There is no reason to just give up on the idea of using SQL queries directly because of injection attacks.

Pop quiz: What is the singular cause of SQL injection, XSS, and stack overflows that causes a security vulnerability? ... The answer is: Data being treated as an instruction. Solution: Separate them so that data can never be interpreted as an instruction! In SQLi, this solution is to use parameterized queries. You send the query in one packet, then the parameters in a second one. SQLi is thus prevented. (Not that SQL…

I'm not sure what your point is here, because what I'm advocating is precisely to make it easier to use parameterized queries and more difficult not to.

Re: PHP 7 Released

#258
post #3

Probably one of the biggest releases since 5 in my opinion. Scalar and return type declarations being added in are a couple of massive additions. For a language that used to cop a lot of flak, PHP sure has grown to become a mature and quite decent language.

by copying all the python features :D

Except that in PHP type declaration mismatches are actually errors... They aren't just "documentation" to be used by static analyzers.

Re: PHP 7 Released

#259
post #42

Earlier quoted context omitted.

http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/

Yes, quote a blog post from NEARLY FOUR YEARS AGO that mostly consists of "I don't like the way this thing is so therefore it's wrong" + "This is a problem that was fixed in a later iteration of PHP" to justify why PHP 7 is bad. One thing I like about PHP 7 is that they had an opportunity to say "Fuck BC" and chose to use this version change to obsolete the shitty tutorials that make bad programmers (mysql_*).

Sorry to be dense... what is "BC"?

Re: PHP 7 Released

#260

Earlier quoted context omitted.

Not the language? PHP is the only lasting language where making code that allows SQL injection is easier than code that forbids it. PHP includes all the worst practices you'll find on any languages. Javascript has the eval problem - PHP has it too; Perl have the too fluid type system where you can't specify anything - PHP too, except that it lacks Perl's tainted mode; Asp made it easier to create code subject to XSS…

> PHP is the only lasting language where making code that allows SQL injection is easier than code that forbids it. Pretty sure this is true for any language, the key difference is education. When learning JDBC for example, you're taught to use prepared statements with params vs. string concatenation.

Heck, a very popular Java book (Android programming specifically) has examples of database queries using concatenation (and hence SQLi).
Post reply on HN