Live data from Hacker News

Things you should know about PHP 7

pages.zend.com

71–80 of 124 posts

Re: Things you should know about PHP 7

#71
post #6

Earlier quoted context omitted.

>... and available on general cheap webhosting sometime around 2020. If we're lucky. Shared Hosting needs to die off anyway.

Shared hosting does mean that your provider is likely keeping their platform patched and up to date, which is possibly painful for you but likely nice for everyone else. The alternatives seem to be giving customers a VM or a dedicated server which tends to mean it's _never_ going to get any security updates since the day it was first set up. Shared hosting is a pain, but the alternatives have the potential for even m…

As a former herder of dedicated servers purchased for this sort of thing, you'd be surprised how difficult it is telling people they need to pay to upgrade it. We had a client with an old supermicro P3 running red hat 7 (not RHEL) until last year. Genuinely surprised it lasted as long as it did.

Edit: it was RH7, not RH5. Just checked. Still bad.

Re: Things you should know about PHP 7

#72
post #53
post #16

Earlier quoted context omitted.

Haxe uses the first syntax, as does AS3. So it's not like "other languages" are universally opposed to this order.

sure but AS3, Go Haxe and others ARE consistant function foo(a:int,b:string):bool{} in PHP this will be function foo(int a,string b):bool{}

Putting the type first for parameters and last for return values seems like exactly the same kind of inconsistency that has already earned PHP plenty of criticism. Personally I kind of like the Pascal style, I use the C style all day every day, but mixed style seems like the worst option available.

Re: Things you should know about PHP 7

#73

Earlier quoted context omitted.

It's also completely blank without javascript.

Why are you not running javascript? Is it a environment restriction, out of security concern or personal preference? Since tone can be tricky on the internet I'll just add that I am genuinely curious about this.

Sometimes it's not intentional JS blocking. I run adblock and ghostery and by blocking 3rd party scripts some crucial part of a site just break also.

For example, people track link clicks in a web app and they do it with Google analytics. If not handled correctly, it will break all the navigation on a page.

Re: Things you should know about PHP 7

#74
post #3

TL;DR: 1. Scheduled to come out in Q4 2015 2. operator, see https://wiki.php.net/rfc/combined-comparison-operator 3. Return Type Declarations & Scalar Type Hints 4. Speed improvements (25-70%) 5. Yep, speed improvements are for real. You're welcome.

Thank you. This website is completely useless on mobile.

Also doesn't work when EFF's Privacy Badger is running.

Re: Things you should know about PHP 7

#75
post #3

TL;DR: 1. Scheduled to come out in Q4 2015 2. operator, see https://wiki.php.net/rfc/combined-comparison-operator 3. Return Type Declarations & Scalar Type Hints 4. Speed improvements (25-70%) 5. Yep, speed improvements are for real. You're welcome.

> 1. Scheduled to come out in Q4 2015 Which won't happen, I can tell you. PHP's release dates always slip by at least a month, and that's without a very unstable master branch like PHP 7 has. If it does happen, it'll take a few micro (7.0.x) releases until it reaches stability. > 3. Return Type Declarations & Scalar Type Hints Also strict scalar typing: However, Zend not mentioning this is to be expected. The company…

> biggest opponents of strict typing in PHP

Umm, well I saw Zeev has voted in favor of scalar type hints on the RFC?

Re: Things you should know about PHP 7

#76
post #48

Earlier quoted context omitted.

The ones I miss most frequently are a faster json parser (I use ujson), a faster msgpack parser and a faster database driver. The pure python versions (even on PyPy) don't make the cut :(

json parser on pypy is competitive, try it (or give us examples where it's not). msgpack needs a better impl, but can be done, database drivers seem to work over cffi at reasonable speed.

I just checked out and seems like pypy has made some good progress database driver wise!

So I went ahead and installed pypy 2.5.1 to compare the json performance. It got better but ujson is just crazy fast. CPython (w/ ujson) is 70% faster to loads and 50% faster to dumps a sample json from my project (50~156kb json). I expect msgpack to be the same.

Unfortunately seems like Pypy still doesn't pay off in this app, but it might in many others that don't spend as much time (de)serializing.

Re: Things you should know about PHP 7

#77
post #6
post #4

Earlier quoted context omitted.

> 1. Scheduled to come out in Q4 2015 ... and available on general cheap webhosting sometime around 2020. If we're lucky. Thank god our company slowly moved away from building small PHP websites that have to run on the most fucked up PHP installations from the before-time. Now it's PHP 5.6+ everywhere :-)

>... and available on general cheap webhosting sometime around 2020. If we're lucky. Shared Hosting needs to die off anyway.

No it doesn't. If you're a small company paying for shared hosting at < $20 per month is a far better alternative than hiring an admin to run DO instances or whatever. If you have a full time developer who happens to know how to administer servers well it's fine, but many companies barely even even have a full time developer. For them shared hosting makes perfect sense.

Re: Things you should know about PHP 7

#78
post #38

While I eagerly look forward to PHP7, you can get more than PHP7 speed now with HHVM, and HHVM has never been easier to use. But competition is good, great actually. HHVM recently folded in JIT regex like PHP7, so they are copying from each other.

Hack is also a substantially better language than PHP. It, directly or indirectly, fixes a lot of horrible behaviour. PHP's absurd comparison operators, for instance, are safely usable once you drop them into a statically typed environment.

Hack is merely PHP with poorly-enforced type hints

Unlike PHP, Hack lets you, nay, encourages you, to turn off type checking in places

Re: Things you should know about PHP 7

#79
post #58

question. if, given a programming language is Turing Complete, is it possible that we might stop further development on some of the more,,, crappy languages that are already out there and adopt some of the less crappy ones to fill in any feature gap? i'm all for diversity and experimentation, but doesn't evolution say that some things just gotta die? EDIT: fixed some spelling errors

People do already choose languages other than PHP because they find PHP crappy. But in evolutionary terms, clearly PHP (and by extension Hack) are evolving, and are successful in their niche. If you don't want to use PHP you don't have to, alternatives already exist in abundance - including, of course, the fork of PHP itself. So use Java, or Python, or Ruby or C# or whatever floats your boat. But if you're arguing th…

If you stop development on PHP then lots of your favourite websites will need to waste an awful lot of time and money switching to a new language and retraining developers.

Re: Things you should know about PHP 7

#80
post #67

And here is "Things you should know about PHP in general": http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/

That's not a very good list about things you should know about PHP. That's a rant about that the bad parts.

You can Google '[x language] Sucks' or whatever other language and come up with a ton of good reasons why X sucks.

Post reply on HN