PHP 7 Ready For Release (softpedia.com)
An anonymous reader writes: After a long wait web developers can finally start migrating their code to PHP 7. The new version comes with minimal syntax modifications, and is more focused on improving performance and upgrading PHP's core interpreter. Softpedia reports: "As mentioned above, PHP 7 is focused on speed, and benchmarks carried out over the past few months, have shown it to be almost twice as fast as older PHP 5.x releases, and neck in neck with Facebook's HHVM project, a Just-In-Time compiler for PHP code." A full list of new features is available here.
neck and neck, I think.
I've been benchmarking the PHP 7 RCs against HHVM and PHP 5.6 for quite some time now with my own framework. I'm still perplexed as to why they are claiming it is faster than HHVM. Maybe in some specific benchmark? On my in-house framework, HHVM pushes nearly twice the requests-per-second performance compared to PHP 7. However, on the command line, PHP both 5.6 and 7 have a significantly faster startup time, but this point is mostly irrelevant for web servers.
Unlike slashdot's normal habit of running behind the times with news stories, this one is too early.
PHP 7 is slated for a full release tomorrow.
Good job guys....
I'm not saying the curators of PHP aren't semi-retarded, but the reason they jumped over 6 is because 6 was basically a complete failure. They planned it out, but never managed to deliver. Anything important or useful in v6 was implemented in v5 point releases, and when it came time to put out a new major version, the number 6 had connotations that were undesirable.
So, I don't think "marketing war" is a fair characterization.
Horrors addressed: 0 ... but at least now you have the option of statically typing variables, it seems.
PHP has addressed several of those issues over time (and in 7). The author of that blog seems to be updating it as things are fixed.
"I need static typing" == "I'm too lazy to keep track of what I'm doing with my variables"
I'm not saying the curators of PHP aren't semi-retarded, but the reason they jumped over 6 is because 6 was basically a complete failure. They planned it out, but never managed to deliver. Anything important or useful in v6 was implemented in v5 point releases, and when it came time to put out a new major version, the number 6 had connotations that were undesirable.
So, I don't think "marketing war" is a fair characterization.
PHP 6's big selling point was going to be Unicode support. That's what fell through. The remaining fun features (and more) eventually went into 5.x.
The problem is that a number of publishers went forward with PHP 6 books - likely to try to stay ahead of the competition. Check Amazon. There's a bunch. And that says nothing about blogs and other online sources. The decision to jump to 7 basically came down to "we'd rather deal with people asking what happened to version 6 than people complaining about how the stuff they saw about 'PHP 6' wasn't true".
Doesn't matter anyway, apparently I was too lazy to read it right too. They only added strict scalar type declarations for function parameters and return values; not quite the same thing.
Where's our 64-bit support?..
Static typing is really helpful if you want to compile, because the function knows ahead of type the data types that will be passed in.
Yea, it's whale guts all over the place.
I will say PHP7 might be a huge break from that. The parser changed to be a lot more sane and they finally deprecated all those mysql_ functions. There are a lot more real exceptions in core libraries instead of errors that silently get discarded.
I dunno...it looks a lot less crap. But let's get things straight. PHP4/5 are garbage from a design perspective. There is a lot wrong with their type system. Oh and PHP7 has a type system..that's been bolted on. eh... I'm sure people will find fun new stuff for /r/lolphp
Cue the PHP haters to flood this topic with endless criticisms and loads of "it's SO awful" stories about how terrible PHP is.
I've said it before and I'll say it again: I like PHP, and coding in it enabled me to make a shitload of money over the last dozen years or so. It still makes me money every single day, and all at a cost to me of almost nothing. Linux, Apache, mySQL, and PHP -the classic LAMP stack- has been very, very good to me.
Hate on it all you want, but working alone in my little home office I learned and used PHP to make more than enough money to buy a nice home, travel the world, support my family, and live a very comfortable life.
Is it the "best" language? I have no idea, but it's good enough for me and that's what counts.
So please, feel free to tell me how terrible and horrible it is. :)
Just cruising through this digital world at 33 1/3 rpm...
Only a Sith deals in Booleans.
Erlang is the shittier man compared to PHP and is sooo kewl with this new version of Erlang called "Outlaw Techno Bitch!?" It's the new trend with your NoSQL database
See all the details here
http://saveie6.com/
The last time I compared Eevee's "fractal" article to ManiacDan's "hardly" rebuttal, I found that PHP's alleged problems fit into two categories: those that can be easily worked around with coding standards, and about a half dozen real issues.
PHP 7 has completely addressed one of the real issues, namely parse errors in include being fatal, by introducing engine exceptions. Function argument and return value type hints add some of the benefits of Python-style strong typing to PHP. And though associativity on ?: is still on the less useful side for reasons of backward compatibility, the new null coalesce operator ?? is on the proper side for chaining.
So I just...uhhh...happened to be on this site called imagefap.
They have a banner on their front page advertising for PHP devs.
And I couldn't help thinking that someone has finally found an appropriate use for PHP...
I am 65 and retired, and I use hater all the time. So, so much for your theory. I also noted that he was willing to post with a name, as opposed to hiding behind anonymous. Which degrades your post even further in my humble opinion.
I have worked in several major corporations and with probably every language you have ever heard of and then some, and PHP is no different than any there - it is no more secure or insecure than the programmer makes it and the application it is used in.
But, have fun hating, it seems to be what you are best at.
All languages start out cute and fuzzy then become smelly adolescents. By the time they hit 7.0 there should be a logan's run for languages.
Some drink at the fountain of knowledge. Others just gargle.
I started working in php when version 3 came out.
I feel like I've really grown as a programmer since then, and I've done my best to stay on top of the new features and practices in subsequent versions of php.
Reviewing the new features for php 7, I have to say that I'm excited about the strong typing features, especially. HHVM was appealing because they got there earlier, but it's nice to see the main branch of php getting to a place where everybody agrees that statically typed code is a good idea.
I may not feel this way in a few months.
But for now, I'm on cloud 9.
This signature has Super Cow Powers
All of them have been addresses. Below is sample code of what PHP7 looks like
public static void main(String[] args){
Scanner scannerToReadAirlines = null;
try{
scannerToReadAirlines = new Scanner(new File("airlines.txt"));
}
catch(IOException e){
System.out.println("Could not connect to file airlines.txt.");
}
if(scannerToReadAirlines != null){
ArrayList<Airline> airlinesPartnersNetwork = new ArrayList<Airline>();
Airline newAirline;
String[] airlineNames;
}
}
Slashdot, fix the reply notifications... You won't get away with it...
If you are not with me you're ?TYPE MISMATCH ERROR
I use Macs for work, Linux for education, and Windows for cardplaying.
Job security and "good language" are very different things, and perhaps inversely related. The screwier the language, the more time it takes a coder to work with it. More paychecks for you, perhaps, but the company could be paying more compared to a "good" language.
It's like asking an auto-mechanic if a Ford Escort car is any good. Good to own, or good for his wallet?
I'm not judging PHP here, just questioning the perspective of your metric.
Table-ized A.I.
https://github.com/php/php-src...
Some PHP 5 functions do not work correctly with UTF-8 encoding of Cyrillic alphabets. There is usually a work-around. Still I am curious if there will be some updates of Unicode support in PHP 7?
The problem is that a number of publishers went forward with PHP 6 books - likely to try to stay ahead of the competition. Check Amazon. There's a bunch.
I can confirm that there's a book, listed on Amazon under my name as author, but never actually written, for exactly this reason. The publisher went ahead and told Amazon it'd be available on such-and-such a date, then cancelled the project a month or so later. They apparently didn't bother to tell Amazon about this before going into receivership a month or two after that.
For a couple of years afterwards, I had to explain to people that, no, the book didn't actually exist and that I've no control over what Amazon put on their website. I even tried contacting Amazon about this, and their response was that they'd have to hear from the publisher to do anything about it. So 6 or 7 years later... it's still there, but the subject is now sufficiently out of date that no-one asks about it anymore.
Il n'y a pas de Planet B.
To be fair, all the common scripting languages suck. C#/VB.net is actually a fairly decent "compiled" language (ignoring the MS API's and environment).
But, the common scripting/dynamic languages out there all suck in different ways. (I suppose a lot of it is subjective.)
Here are the main features I'd like to see in a "production" dynamic language:
* Non-type-tag-based type system. Whether "123.4" is a string or number depends entirely on the operation acting on it. You don't have to test for a hidden type tag/indicator. I hate those. I want WYSIWYG typing for scalars. Perl and ColdFusion almost got it right. (Perhaps it can store probable numbers as floating point under the hood as a speed optimization, but such "compression" should be hidden from the programmer and not affect results/output.)
* No overloading of common operators such as "+" for both addition and string concatenation. And better syntax or built-in functions to explicitly indicate comparison types. Perl almost got it right, but it's too easy to forget and cross confuse. There are some interesting solutions to this.
* No white-space block indicators, per Python/Ruby. Use either {...} and/or foo...end foo.
* Optional and optionally named parameters. MS's recent languages did this fairly well.
* Better parameter type checking options/syntax (via parsing if need be).
* Type name should come after variable name in declarations, not before. The C family fucked this up. Pascal and VB do it better.
* Modern set-based switch/case statement. C's "break" is fucked.
* A real OOP system, not JS's anonymous function-based bastard.
* Don't sacrifice rank-and-file features for cutesy FP or meta-programming. I'm not necessarily against those, just don't screw up the regular parts to make FP/meta easier or shorter if a trade-off arises. Take care of business before you go Lisp-y or hacky.
* Maps and objects are the same thing. It's one of the few things JS almost got right.
* One-based indexing for string dissection. It makes the string functions much cleaner than zero-based.
Table-ized A.I.
Here is the php5 version
<?php
$airlinesPartnersNetwork = file('airlines.txt');
Actually, that's the php4 version. You haven't used any features 5 brought to the language. Specifically, 5 was a massive leap forward in terms of OOP.
A more PHP5-esque implementation would probably use the SplFileObject class.
But no, you're right, what the internet needs is more examples of how to use the language badly. I'm sure I could come up with a dated, not-recommended way of opening a file in $arbitraryLanguage too.
Sounds like they a great developers. They realized they had goofed and instead of trying to ram crap down everyone's throats they went away and fixed it.
const int one = 65536; (Silvermoon, Texture.cs)
SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
And it will stay that way for the foreseeable future, as fixing things would require to come up with a new language. This would be a little bit like VB6 to VB.net transition. VB6 not even had a grammar. And I do not mean they did not publish a grammar, MS did not have one. When they developed VB.net they had to come up with one. Therefore, not everything could be realized in the new language.
To make PHP a language which can be used without harm, it needs strong typing. Strong and static typing helps people to avoid mistakes. You can see what happens when you allow to much dynamic typing, like in Groovy, which can compile, but then at execution fail randomly because one type case was not considered. This also may happen when some other class and code is changed.
And the second thing is library cleanup.
how slow it was
Contrary to popular belief, most applications doing real useful work wait the same time for the database, regardless of the language. Maybe a "hello world" is not a good example.
I'm not judging PHP here, just questioning the perspective of your metric.
Ii understand. My metric is pretty real-world based, that is, does it make me money? And the answer is "yes".
I'm willing to overlook or ignore a lot of other metrics when it comes to putting food on my table or supporting my family.
Sometimes "good enough" is good enough. For me, PHP is certainly "good enough". None of its bugs, warts, or annoyances (of which there are plenty) make me lose one minute of sleep.
Just cruising through this digital world at 33 1/3 rpm...
The tag was made, but tags can change. no official release statement has been made yet.
I just wanted to thank you for those other links. I enjoyed reading the various opinions about PHP and its problems, and that was well worth the negative score I got for my comment.
That is, of course, aside from the fact that the "freedom" offered by PHP is similar to the freedom you have to wear a ski mask in a bank.
And this is bad exactly why?
You can always try running this on your code first : https://github.com/wimg/PHPCompatibility
Aren't readers going to be confused by your PHP 7 book if they never got to read what happened in your PHP 6 book?
Agreed (minus the personal attack)
PHP, much like Perl, gives you the flexibility to shoot yourself in the foot if you so desire (or don't know any better).
That's not PHP's fault. Just because other languages and compilers treat the programmer as a helpless child does not mean those languages are better at getting work done. They're just designed around the reality that the vast majority of programmers today are extremely naïve and underqualified. It's like putting a blade guard on a manual can opener, just in case some new and improved idiot ever tries to put their dick in it.
-Billco, Fnarg.com
Funny, I seem to have no difficulty getting paid to write PHP. Can't say the same for Python, Ruby and whatever else the kids are into these days.
If it has lost its position as the predominant web language, then I guess the vast majority of hosting companies are wrong, and so are their tens of millions of clients. You really ought to tell those poor people, AC.
-Billco, Fnarg.com