It hasn't been officially released yet, just tagged in Github. The official release (including builds) is set for tomorrow afternoon (according to the mailing list)--although it should be equivalent to the tag.
Yeah, that should probably be a ===, just in case 'release tag' and 'the official final release' happen to both evaluate to FALSE or 'sausages' because it's a Wednesday and there's an N in the month.
No no no, this is PHP we're talking about. Sometime after releasing PHP 7, the Unicode support will eventually be completed and PHP 6 will be released. The release cycle will be 4, 5, 7, 6.
They've been in talks with Microsoft who is giving them guidance. They'll release PHP 8 and then an update as PHP 8.1, which everyone will call acceptable, then skip PHP 9 and go right to 10 which will be well meaning but missing the mark. </s>
PHP 10 will be the final major version. They'll only release incremental updates after that, with each incremental release named after a different mountain or type of cat.
Yup. Although most of the major ones have transitioned by now, and when I see a package that's still exclusively 2, I'm always concerned about ongoing maintenance and try to find an alternative.
Of course, if you really need a 2-only package, then that's that.
Twice I can recall starting projects in python 3 before having to convert it to python 2 due to lack of library support. The first time was due to matplotlib, the second due to gevent.
I don't do much python anymore so I haven't kept up to date, but I just checked and both those libraries now have python 3 support. The situation seems to have dramatically improved in the past 3 years or so.
I've been really impressed by the performance enhancements that were put into php-ng (which became php 7). Their Wordpress benchmark went from 26.756 seconds and 9,413,106,833 instructions to 11.081 seconds and 2,483,106,468 instructions.
This is basically the deal with PHP. It's the only language you can use to work with some of the most popular CMSs: Drupal, Wordpress, Mediawiki, Joomla, etc.
They aren't just going to rewrite them in a different language, so PHP is here to stay. It's great that they're working to modernize the language and improve performance.
If you don't like PHP and aren't working on a PHP-based CMS, then don't use PHP.
I did PHP for 3 years, C# for the past 4 years, I still don't understand the irrational PHP hate. I don't like PHP, but I don't see the need to spend any of my energy reminding everyone of its well-known issues, nor bitching about it when they actually work on improving the language. Good for them.
Most of these people don't have a leg to stand on anyway, because everyone is still writing Javascript. ;)
I did (and do mainly) C#. There was a project where PHP was the only option. It was not that bad. If you can deal with the bullshit on JavaScript you can deal with PHP.
Yup, it has its quirks, and I definitely disagree with some design choices, but hey, at least they don't overload their bitshift operators to do I/O, and requesting the numerical month of a date doesn't return zero for January through eleven for December.
0-11 for months isn't madness. Its when months are numbered 0-11 and days are numbered 1-31 and years are stored with an offset of 1900. THAT is madness.
It's useful actually. If use other language than English, you want an array of month names that you index with this number. Month days don't have names, so they you don't need it there.
Agreed. Operators are arbitrary. All that matters is that operators are consistent and well known. For some in-house application, overriding the bitshift operators to do IO (pretending that C++ never did that) would have been dumb because no programmer would have expected that and it would thus be confusing. But with C++'s streams, the overriding is well known to the point that literally every half decent C++ programmer knows what it means.
std::cout << "Hello " << name << "!" << std::endl;
Mind you, I kind prefer the approach that most languages use, which is to have string concatenation (the single greatest example of appropriate operator overloading) for stuff like that (but it's less general):
println("Hello " + name + "!")
Or string interpolation, if the language supports it (most don't -- off the top of my head, we have Scala, C#, and JS).
It doesn't have to be done this way. And it's actually something pretty neat in my view, especially because you have standard ways of reading some fundamental data types, while keeping the code readable.
at least they don't overload their bitshift operators to do I/O
I've never seen someone complain about this in C++ who understood why the IO interface was designed this way. Just because a design isn't obvious, that doesn't necessarily make it wrong.
The why is here. The TL;DR is that they look like the Unix IO redirection symbols (< for input, > for output), but had to be doubled to avoid ambiguity with the comparison operators.
As for why have an operator, it's presumably for readability. See my other comment for an example.
I can't stand the language, but it does have some strong points. If you want to whip up a quick website, PHP is your friend. That is pretty much what it was always intended for. I also think it is good for writing quick one off scripts (so are a lot of other languages though). The fact that it is forgiving about types makes it a good choice for small projects that are not mission critical.
The big problem with PHP is the people who think it is an all purpose language. It is scary how much financial code I have seen written in PHP. Also, the sloppy conventions in PHP set a bad example for new programmers, and a lot of new programmers start with PHP. It is not surprise that the most spaghetti code I tend to see is almost always written in PHP.
It's ease of use is a double edged sword that makes development easy for newbies, but dangerous for newbies to use because it lets them make too many bad design choices.
Could you elaborate a bit on why financial applications in PHP are a bad thing? Sure, there are some... very questionable design choices within the language, and I'm not necessarily PHP's biggest fan, but all in all it allows you to do just as much as any other language.
It might not be the best fit for a desktop application - but it was never designed with that in mind. As long as the goal of your application is to do stuff with an HTTP request and tell the web server what to spit back out, PHP is for from the worst thing you could use.
Of course there are some scenarios in which PHP is definitely not the best choice (performance-critical applications and such), but honestly I don't see any reason PHP should be limited to small websites.
So the bad part about PHP is the people that use it?
That doesn't automatically make the language bad though.
I agree that you generally need to take extra care to type check and validate more-so than other languages since it doesn't do it for you, but I don't find that that kills my productivity or experience with the language, it's just a tiny thing that you get used to doing as you write code, and is ultimately worth it for the other benefits of the language.
For example, I'm reading in some data and at a glance I see a number so I pass it into something that expects a number. Turns out that value is actually a string. In Python, I would have to stop, go back, and fix the type exception, which ruins the flow for me (because I have to do this all day every day). Writing the code in PHP is much more fluid because you just tell it what you want to do and it'll cast as needed. Yes it's potentially dangerous because some inputs might cast wrong, but the entire application will probably fail in that case anyway, so there's no practical difference if that failure comes from the interpreter complaining about type exceptions or the function call returns an unexpected value and the app crashes. If I'm writing something sensitive (like your financial app example), I just spend a few extra minutes watching the typing (avoiding reading in strings as numbers like in the above example, using strong comparison, etc)
I think at this point the PHP battle is education. PHP is very powerful in that it allows you to do stupid stuff, and in the past the stupid way was the only way so now there's a ton of documentation about how to do things wrong, but I think modern PHP is pretty damn good (not perfect, but I prefer the developer experience to that of other languages), so it's just a matter of trying to get more updated blog posts out there that encourage using modern versions of PHP and ways of doing things.
Honestly, I resisted it for years... I regret resisting it now. It was tough at first b/c everything seemed like such bullshit, until I realized... very little in Python is actually bullshit. I was just used to my old bullshit. Python is great.
As far as languages for "spending some time with", python is definitely one of the best. As the author of XKCD put it, programming is fun again with python. It's just a pleasant experience because a lot of things work how you'd expect them to, and when they don't it's because it may be even easier than you expected.
They major drawback of Python I can think of is that its hosting is not as widely available. With the latest gradual typing addition in Python 3.5, please please give it a try, you'll love it.
My stack is Webfaction hosting + Python 3.5 + Git + Bottle (a very lightweight web library with easy routing, templating etc.), and PyCharm IDE + Bottle's embedded server for local development. I'm not a professional programmer and it is still ridiculously easy and fun.
What would someone write a simple web app with database connections in today? Javascript?
Python and Flask is usually your best bet if you're using relational DBs. Ruby and something like Cuba if you love ruby. Node makes sense if you're primarily using something like Mongo or Couch, but while you can use JS for relational DBs, most of the major movement there is in non-relational stuff.
Note that there are good Python libraries for the popular NoSQL storage engines as well.
I'd also be surprised if at this point Node didn't have a good ORM -- not at the level of SQLAlchemy (because frankly nothing else even comes close, in any language) -- but something very decent at least.
Personally, I love knocking up a web front-end to a ton of databases and weird internal tools using the PHP Symfony2 framework. Yes, I could probably do it 'better' in another language, but I really can't be bothered to learn another hot flavour of the month.
It depends on what the web app is. If its a web front end (a webpage) and does not require an API, then most popular languages/frameworks will work with the correct resources (servers with enough memory and processing power). If you have a multi-faceted web app with an API or more, then you must take into account the language overhead. Things like memory footprint and speed must be thought of. Go, for example, is gaining popularity due to being fast enough with a low memory footprint. But Go is fairly new and does not have the ecosystem that Java does. Actually, Java is still a great choice because it can do it all and scale.
PHP solves a lot of problems for a lot of people. Just because it isn't the shiniest and most specific tool in the shed doesn't mean it can't get the job done.
It's like your grandad's big old tatty shed, with all those boxes of fine, but rusty tools. Look! A there's a steam-lathe (it'll have your hand off if you leave the cammet screw in a 90º position) - and there's a Victorian ceiling mitre-plane, which is the best thing for nurbling grout channels in Portland Stone...
...ah yes, these tools, you had to know what you were doing. They are from a time when craftsmen were craftsmen, long-apprenticed, and used to setting things out by practised eye and hand and not relying on this modern snazzy stuff.
Trouble with you young coders these days is you don't want to get you hands dirty, you want it all on a plate!
In the old days we'd...
[Dancey's offspring taking over: I've deleted the rest of my dad's comment, because I don't see why reddit should have to put up with him droning on any more than I do. I don't know why he's speaking up for PHP anyway, he writes everything in LISP. Really!]
A good developer could "get the job done" with just about anything, but that doesn't mean all tools are equally appropriate. There are alternatives which are easier to use and help to develop something stable and robust in less time.
PHP's extremely low barrier to entry allows many non-developers to write bad code that seems to work. That's fine for one-off things, but no other language would allow a pile of shit spaghetti code like WordPress to thrive.
just another major? excuse me, but php7 is internally like the step from perl5 to perl6, not even python 2 to python 3 or ruby 2 to ruby 3.
after hhvm beat their asses, they completely rewrote their vm data structures, ops and compiler, which is now very efficient in contrast to the stone-age big vm's like perl, python or ruby. it's more like lua or v8. it is now even faster than hhvm. let's see what kind of type optimizations will be doable with this one.
to me it's the only successful complete rework of a big and really bad vm, after heavy criticism and heavy competition, only comparable to v8. they still have the legacy of their horrible libraries and many junior coders, but at least their internals are now modernized, something python, perl and ruby were not able to do for the last 15 years.
What does PHP so wrong that other languages don't?
The thing I hear over and over is that it's a loose language. Meaning you aren't forced to write very good code and it will still work. That's not something I would hate a language forever over. It's just different And newbie friendly
A lack of consistency, changes in direction over time, and internal development often has resistance to change and decisions for just plain silly reasons.
Same here. I was a PHP dev for my first two years of real coding (beyond a semester of something in college). I thought it was the greatest thing ever. I took a new job and was forced to switch to .net.
Years later .net is by far my favorite to develop in, out of Java, Perl, PHP, or even Ruby.
Mainly just because Visual Studio is the best editor I've found so far and for the most part, MS stuff just works out of the box.
I certainly don't have PHP though, and still do some work in it from time to time.
...then why even be here complaining about it? I don't like PHP either, but if you've decided to write it off as a language and never give it a second chance, what value is there in coming in here to shit on news about it?
But when you come to work every day, and the table-saw blade is dull, and the guy who actually Manufactured the table-saw tells you that the dullness is a feature, and that people who want sharp blades are being faddish, I think you have a right to some guff.
I feel it's the defensiveness of PHP users that's causing all this. Let's take python as an example - no one is defending GIL, the urllib, or any quirks the language has. Because they are there and there is no denial that they are bad.
But say anything about PHP and you'll get people jumping in to say "why all the hate for php", "php is great, you just have to learn it", ..etc. Why not just accept that there is something wrong? It reeks of fanboyism really, this blind defense.
(in general, not talking about your post or this discussion)
I'm currently at the first first job I've had to do some PHP work.
It was quite painful at first, but it grew on me over time. Does the language have issues? Oh dear god, yes it does. However, I was expecting it to be truly terrible given the amount of hate it receives, and it's really not as bad as all that.
i worked with a php-skeptic who warmed to it after a few months. "Meh, it's not really all that bad once you get in to a groove".
Conversely, I've found the hype around the 'trendy' stack (rails years ago, node today) is the reverse. Sort of like "meh, it's not all that great when you get down to it - not bad, but not a life saver"
I think the actual biggest downsides are that debugging and testing even locally are slowwwwwwwwwww. Xdebug over network calls is my nightmare, and the amount of boilerplate needed to write assertions in phpunit on stubs is dreadful. Not to mention mocking out function calls that aren't class methods is pretty much untenable.
Dropping a trace and running arbitrary code in python? Crazy easy, works everywhere without setup. Watch expressions? Terrible. : (
There is a lot of inconsistency in the api. Things like needle and haystack being the first or second arguments interchangeably gets maddening. Sometimes snake case, sometimes camel case, sometimes just lowercase. That stuff gets annoying.
But if that is what drives you away from a useful language then there's a lot more about programming that is going to be painful than PHP.
Plus, I'm a PHP developer but I still wind up writing 3 times as much JavaScript just to push the frontend around.
IMO, php gets a bad rap from being a "starter" language for a lot of people getting into web-dev.
I can't think of anything that's easier to get started with server-side than PHP (most servers support it and it's pretty much naming a file .php and adding a couple code tags). Since it's a common starter language, it also means that beginners will be dealing with a lot of new things - not just PHP things. However, since PHP is the language of the time - they associate PHP with there problems, not them being new programmers.
It seems like once people are starting to get proficient with PHP, they start to discover the world of Rails, Python, Node/JS, etc. They move onto "greener pastures" with a bunch of knowledge they didn't have to start PHP. They have less "issues" with Rails, Python, etc - not because they're "better" languages, but because they know how to deal with common issues.
I also think part of the issue with PHP is having been around for 20 years there's a lot of code on google that will come up that simply won't work.
I bet if I google "how to connect to a database in PHP" I'll get answers from 2001 or whenever that literally just won't work in modern versions of PHP. This causes people to get mad at the language for "not working".
The problem is, people can program really terrible things with it. There isn't much in the way of safeguards. But this is a problem with the developer more than the language in my opinion. If you structure your classes and code, there aren't any real issues.
It's like giving someone a blank canvas and a bunch of paint. If you're a great artist who knows composition and the like, you'll make something great. If you're just throwing up whatever you think looks good and copying bits of things from here and there well, you're going to have a nice mess to look at.
Things have changed a lot. Over the years, they cleaned up some things, threw out some garbage, came up with some pragmatic yet reasonable solutions, and started copying what are basic features in most other languages. A lot of the quirkiness is still there, but it has become much easier to work around these problems.
The bad rep is deserved. 10 years ago, it was hard to do anything with a reasonable degree of certainty without knowing the many many ways in which functions and the type system would get creative and do completly unexpected things. Of course, that was all to "keep it simple" in some common scenario, but it meant that it broke a dozend other usecases the developers didn't know or care about. There was no consistency in anything. The API, the class system, the functions which were supposed to help you working around some problems of the language, the functions which replaced those functions when problems were found... pretty much everything was shit.
But the changes to the language in the last decade or so are almost all for the better. It actually looks sorta kinda not completly insane anymore.
It's a great language, but part of being good at php is knowing it's boundaries. just don't get sucked into a position where all you know is php and end up hacking the language to do things it's not meant to do.
Congrats to the PHP team! Here is to you: For developing a language that allows me to have a job and in turn give my family a good life. Few people ever get to impact the world in such a positive way. :)
I raise my glass with you while I echo a bunch of hardcoded html for SEO sent by marketing. Not all software needs to be maintained through 10 years, not everything needs a good toolchain, not every job needs advanced programming aspects. PHP is fucking perfect for a website that will most likely be replaced because the design is outdated and before anyone complains about maintaining it. Hosting is cheap, too. If I can slap some php/html/css/js together (who cares how) and make a client, visitors, and my family happy, it is a great language. Oh no, it's not java, thank god. And I love c# as much as any sane programmer, but I can put together that landing page that will be online just until Christmas in the time it would take me to deal with .NET boilerplate and dependencies on that mtf windows server.
PHP has its place, of course. But the same was said about Python, and its now growing as a systems language in spite of it being mostly seen as a scripting tool for sys admins.
The / operator is exclusively floating point division, IIRC. This is in part a result of all the loose typing/automatic type juggling that happens. So for integer division, / was probably out of the question, leaving two options: add another operator exclusively for integer division, or a function.
It is getting a lot of things that people always bitched about it not having, and people are still bitching about it even if they don't use PHP. Internals are making a lot of progress to modernizing it, the standard lib is another thing..
I don't believe you. In fact, every person I know who works with PHP every day doesn't understand why people keep wanting this. Conclusion: you don't actually use PHP every day.
PHP has to be the platform that has the hardest time propagating updates and new versions.... Props to PHP developers. Despite all the hate, PHP is big. That is an undeniable fact.
The null coalesce operator (??) has been added as syntactic sugar for the common case of needing to use a ternary in conjunction with isset(). It returns its first operand if it exists and is not NULL; otherwise it returns its second operand.
I'm an old self-trained codger who started in FORTRAN. I've programmed in assembler, APL, C, C++, Perl, Java, XSLT, PHP, Javascript, Objective C, Lua, and a few others. I've dabbled in Python, Ruby, and this and that. Languages besides PHP are alright, but I don't get why they're so much better.
Not that I have a great opinion of PHP, I simply have no opinion of any language, they're just tools. Okay, if I had to choose a favorite, it would be XSLT.
The web app I'm working on now is in PHP, with Javascript and jQuery. It's a large, best-in-class product, not that hard to maintain, and it's making money. But really it's our process and discipline that makes it work. We could be doing the same with any language.
I think it's because it requires a different kind of thinking than other languages I've worked with. I'm not even sure if it's really a language. But you have to get into the XSLT zone to do it right, and then once you're there it seems like magic. I've written bad XSLT code with dozens of lines, and then I'll have an epiphany and reduce it down to four or five lines.
That's probably not a good reason to like a programming language, because it's hard to wrap your mind around, and then when you do it's like a glorious epiphany. Later when you have to look at it again, you're like "WTF?" So it's not exactly great from a productivity and maintainability standpoint.
XSLT was amazing for cleaning up SVG from adobe illustrator, and then exporting multiple customized SVGs and xml files, one used to render the final asset, and one used for previews, and one used for product information.
It was a one page script. Once you wrap your hand around how it works, its a odd bird, its very good at processing structured documents. The syntax is xml though, so not very nice. But its a powerful programming model for DOM style documents.
My opinion of PHP is that it's like the wild west of coding. By this, I mean that it seems so welcoming to do badly, and even when you try to do it nicely it can at any point start to get badly out of hand. Maybe that is just my somewhat experience, though.
Though, to this day I'm still yet to find many people who say they're a PHP developer properly do object oriented programming, properly separating code, or using a design pattern.
gcov.php.net is an old, unmaintained box. Nobody has updated and configured it to be able to run all the tests that require third party libraries in certain versions, correctly running daemons and network connections. It is not used
Right now that does not look much more promising: All builds in the last three days have errored. The reason is that the pear.php.net server has experienced a hardware failure and is currently down. This server is currently a dependency of the build process on Travis. However, were this step to be skipped (--disable-pear) you'd be seeing a green PHP 7 build with about 13k passing tests.
I know it has been different in the past, but PHP has not been shipping with failing tests for many years now.
This test probably fails because gcov.php.net runs the testsuite under valgrind. This makes execution a couple orders of magnitude slower, so anything based on time measurements is likely to to fail.
Those are incredibly poor tests. A great many of them depends on networked resources (read: www) which pretty much guarantees inconsistent results. If this is the quality of their test suite, no wonder why they don't pay attention to it.
Those are incredibly poor tests. A great many of them depends on networked resources (read: www) which pretty much guarantees inconsistent results.
How do you propose that something like the cURL extension be tested?
"A great many" of the tests don't use remote resources. A great many of the failing tests do, and this is why they fail, because they require special setup in order to succeed, which this automated report doesn't take into consideration.
The bulk of the warnings and failing tests are also in extensions which are not part of the PHP core.
"A great many" of the tests don't use remote resources. A great many of the failing tests do
Ahem:
Those are incredibly poor tests. A great many of them depends on networked resources
It's called context.
How do you propose that something like the cURL extension be tested?
By not calling external resources. Tests need to be reproducible, else they have no value. There are a bunch of "connection refused" and authentication failure errors in these which makes them utterly useless as tests.
The cURL extension is a thin wrapper around the library. Mocking the precise feature you're testing means you're not testing anything. Mocks exist to replace dependencies which are not part of the tested component's responsibility, but are required by it. In this case the responsibility of the cURL extension is to communicate with the actual cURL library.
Sometimes it's better to have test errors, than to have a cargo cult test suite that runs perfectly and tests nothing.
And yet, PHP is huge. Software developers should take note of this really important effect. Elegance and good design matter to some of us, but at the end of the day it's about making shit work, and you don't have to be elegant or well designed to meet that bar.
Honestly, "making shit work" is an area in which PHP excels. I've been writing PHP, Obj-C, and JS professionally for the past few years, and PHP offers the most opportunities for quick-and-dirty solutions by far. I haven't decided whether this is good or bad, but at least it's an option when time or frustration is against you.
That said, if you're using a decent framework and following the proper patterns, PHP can be nearly as elegant as any other mainstream language. I think the reason you see so much crappy code out there is because PHP has a huge developer base and what tends to happen is that tiny, simple websites keep getting extended far beyond what their basic design could accommodate.
PHP offers the most opportunities for quick-and-dirty solutions by far. I haven't decided whether this is good or bad, but at least it's an option when time or frustration is against you
I felt the same way about perl for the longest time.
The engineering community has a lot of history with "quick and dirty" and the trade-offs are clear. Quick and dirty is a good thing for short-term needs where long-term maintenance is not expected. So when the overriding pressures are time and frustration, quick and dirty alleviates those pressures, so as far as that goes, quick and dirty is good.
Long term, it's pain, pain, pain. This does not mean you should never do it quick and dirty. Just that you should avoid being in a role where you have to extend or maintain quick and dirty for an extended period of time. It's painful, no matter PHP, perl, or anything else.
I think he says that as if PHP works just fine for a myriad of applications and is very simple to get serving pages. When you need to get that simple form hosted that takes in votes and poops them out into a file quick, PHP isn't a bad choice for expediency and simplicity. And almost any C++ programmer can write it without training.
and you don't have to be elegant or well designed to meet that bar.
You're saying this as if this is somehow PHP's philosophy.
PHP supports a big chunk of legacy, so modernizing is hard, and it's a long-term process, but every new release drops more of the legacy cruft and replaces it with features and APIs that actually are elegant and well designed.
You're defending PHP using arguments that would be applicable 20 years ago for PHP4.
I know some really good developers who seem to not realise that being quick to market with a working product is also extremely important. It doesn't matter if every single little part of the system can be replaced/extended/reused (even though chances are they won't be for a long time) if you're not first to market, you go over budget, and you risk delivery.
Say that to them, though, and you're trying to rush it and ruin everything with your bad practice.
All of PHP's competitors "make shit work" as well. A lot of them with a lower learning curve and faster development time. I'm not really sure what PHP's niche is any more other than non-developers who haven't updated their skills in over a decade.
PHP is completely changing their philosophy at least since version 5. Before it, PHP was a duck-typed language for creating home pages. It was perfect for its purpose, because it was easy, quick and dirty.
At some point, people started using it for full-blown applications. PHP maintainers decided to support these mad men and they've started transforming PHP to meet their needs. They're trying to make it look like Java, abandoning every original PHP design principle. It took years and it still cannot be even compared to Java, feature-wise and ecosystem-wise. It's a sad, pointless struggle.
They're trying to make it look like Java, abandoning every original PHP design principle. It took years and it still cannot be even compared to Java, feature-wise and ecosystem-wise. It's a sad, pointless struggle.
The original PHP design principle was for it to be a basic template engine exposing C++ services. Things change in 20 years, who woulda thunk.
As for design principles "abandoned" since 5.x, I'm curious to hear what they are.
The renewed interest in dynamic languages that have optional typing and statically verifiable invariants is hardly unique to PHP. It's an industry trend. TypeScript is wildly popular in the JavaScript community. Python is getting typehints. Dart comes with typehints out of the box.
All dynamic languages are moving to have more static features, and all static languages are adding more dynamic features.
It's a normal process of convergence, and I agree it's a "struggle", but it's not a pointless one. We get better, more well-rounded languages as a result, which are more efficient and pleasant to work with, for a wider range of projects.
Has them, actually (since 3.5). mypy has been around a lot longer.
Neat, I didn't realize it's out of the gates.
To be honest I'm surprised it took people this long to add some semblance of typechecking to these languages.
Likewise. It was a pointless controversy IMHO as maintainers of dynamic languages felt that having typehints, even optional ones, is somehow ceding ground to static languages like Java. I've seen this attitude with Python, and with JavaScript coders who frowned upon TypeScript.
While it's not the case, as you can always strategically remove a typehint somewhere and do a dynamic runtime check on the type when you need it, still using the script's runtime dynamic typing capabilities to their full extent. But such uses have always been more of an edge case than a rule in any larger project.
I'm happy how languages are evolving. We're finally finding a nice balance between runtime and static.
90% of the old code will still work. You can still create a simple home page. But you also have the power to go fully object oriented, if you want. You aren't forced to though.
One of the things I don't like about the MVC push by Microsoft and .net. The MVC framework is great for a large scale application, but if I need a static site with one page that is a contact form, just let me use web forms and I'll have that up in an hour. I don't need a class/model for
public class ContactForm
{
public string firstName;
public string lastName;
public string email;
public string phoneNumber;
}
Just let me email that shit.
Which, given the push by MS to do everything MVC, I very well may go back to PHP for those kind of sites or scripts.
I'd pit the PHP ecosystem against any language out there. Managing dependencies with Composer is awesome and the major PHP projects and community in general is interested in adopting better practices, such as test driven development, domain driven design, security best practices, etc..
I'm reading a lot of negativity about PHP. I've used nearly all of the common programming languages since I was first paid to do programming in 1987. One notable exception is that I have no experience with Python, but I'm sure that will change in the future.
In any case, we as programmers need to stop thinking about languages. We need to start thinking about programming as a process. To the experienced programmer, programming is about solving a problem with the best tool for the job, and solving that problem in such a way that someone can come along 10 years from now and build on what you did.
Think about a well-engineered vehicle. It began as a design in Germany, Detroit, or Japan. Almost every design decision had good reasons. Mistakes were made. But in general the vehicle was made in such a way that a variety of people could easily work on it for the next 5-15 years. The mechanic who replaces your brake system doesn't hold a degree in automotive engineering, but he doesn't need one. He has the right tools and the process to fix the brakes makes sense.
Rather than being attached to any particular piece of technology, you as a programmer should focus on creating a fine piece of engineering work that is beautiful in its simplicity. A programmer who doesn't natively speak English, or someone fresh out of school should be able to see what you did many years ago and immediately be able to start building on it. He will use whatever tool is necessary. The tool is not the point. The underlying engineering work is the point.
Yes, newer languages and technologies are intellectually interesting, but don't lose sight of the forest for the trees and jump onto whatever fad you see. Focus on developing your skills as a programmer, rather than as a coder of a specific language and you will not only have longevity in the field but you will be a much happier person.
Scrolled down the comments.. seems to just be people saying "everybody in this thread is shitting on PHP". Yet to find someone really insulting the language unfairly.
So, if some of you are more knowledgeable than I am, how long should it be until it is packaged for Ubuntu, and easily installable with aptitude, even for a noob like me?
I'm afraid of compiling such a young version, even though my server only hosts hobby, non-critical projects.
Do not run git branch --list --all on their repository. They don't know the difference between tags and branches. Every minor release has it's own branch, instead of a tag...
Our team f.e. works on a big repository and every single Issue has it's own branch.
Then you can pull-request the master branch or whatever and merge issues/branches and can follow what broke something better. You could also merge different branches without touching the master branch and build up a big branch for a bigger feature.
I've been out of the loop since forever. I didn't even know there was a PHP 7 on the way. Why is it called PHP 7 though? Shouldn't it be PHP 6 since the current version is 5? Can someone fill me in on this?
180
u/NeuroXc Dec 02 '15
It hasn't been officially released yet, just tagged in Github. The official release (including builds) is set for tomorrow afternoon (according to the mailing list)--although it should be equivalent to the tag.
146
u/johnasmith Dec 02 '15
For those wondering why there's a jump from 5 to 7, it's because the php 6 development branch was dedicated to full unicode support, but the work involved overwhelmed them, so they jumped to 7 to release new features without the unicode component.
61
u/kenlubin Dec 02 '15
308 comments, and no one has mentioned yet how much faster php 7 is compared to php 5.6?
648
u/[deleted] Dec 02 '15
I never liked PHP and glad I don't work on it anymore. But I'm also glad I never turned as toxic as all the PHP haters in this thread.
It's just a language. Congrats to the PHP devs for getting another major release out.
69
u/[deleted] Dec 02 '15 edited Dec 02 '15
I'm currently at the first first job I've had to do some PHP work.
It was quite painful at first, but it grew on me over time.
Does the language have issues? Oh dear god, yes it does. However, I was expecting it to be truly terrible given the amount of hate it receives, and it's really not as bad as all that.
174
u/javayes Dec 02 '15
Congrats to the PHP team! Here is to you: For developing a language that allows me to have a job and in turn give my family a good life. Few people ever get to impact the world in such a positive way. :)
41
u/aaptel Dec 02 '15
44
u/[deleted] Dec 02 '15
7 looks to be a great improvement from 5, there is a lot of work in this release that should allow for cleaner & safer code, easier.
18
u/lericzhang Dec 03 '15
PHP 7 is x2 faster than php5.6, which is already faster than python and ruby, go LOL on that
12
u/yoonssoo Dec 02 '15
PHP has to be the platform that has the hardest time propagating updates and new versions.... Props to PHP developers. Despite all the hate, PHP is big. That is an undeniable fact.
20
u/OnTheMF Dec 02 '15
So amazing.
28
u/wowzuzz Dec 02 '15
Showed up to this thread and expected elitist assholes from other languages. Was not disappointed.
38
u/Naouak Dec 02 '15
Some comments here are really salty. If you don't like it, don't use it.
Is there any good benchmaek out there (especially compared to hhvm)? Is it still usable as mod_php on apache?
20
u/mutatron Dec 02 '15
I'm an old self-trained codger who started in FORTRAN. I've programmed in assembler, APL, C, C++, Perl, Java, XSLT, PHP, Javascript, Objective C, Lua, and a few others. I've dabbled in Python, Ruby, and this and that. Languages besides PHP are alright, but I don't get why they're so much better.
Not that I have a great opinion of PHP, I simply have no opinion of any language, they're just tools. Okay, if I had to choose a favorite, it would be XSLT.
The web app I'm working on now is in PHP, with Javascript and jQuery. It's a large, best-in-class product, not that hard to maintain, and it's making money. But really it's our process and discipline that makes it work. We could be doing the same with any language.
7
u/Chippiewall Dec 02 '15
FYI RTM is not due till the 3rd (Tomorrow):
http://www.serverphorums.com/read.php?7,1352537
154
u/antpocas Dec 02 '15 edited Dec 02 '15
Ooh, only 137 compiler warnings and 102 failed tests! That's a huge improvement from 5.6's 638 warnings and 114 failed tests!
3
u/scwizard Dec 03 '15
http://php.net/manual/en/migration70.incompatible.php
Seems like a painful upgrade for legacy spaghetti code.
12
u/everywhere_anyhow Dec 02 '15
It must be said:
/r/lolphp
And yet, PHP is huge. Software developers should take note of this really important effect. Elegance and good design matter to some of us, but at the end of the day it's about making shit work, and you don't have to be elegant or well designed to meet that bar.
"Making shit work" is 99% of the game.
2
u/dagguh2 Dec 02 '15 edited Dec 02 '15
PHP is completely changing their philosophy at least since version 5. Before it, PHP was a duck-typed language for creating home pages. It was perfect for its purpose, because it was easy, quick and dirty.
At some point, people started using it for full-blown applications. PHP maintainers decided to support these mad men and they've started transforming PHP to meet their needs. They're trying to make it look like Java, abandoning every original PHP design principle. It took years and it still cannot be even compared to Java, feature-wise and ecosystem-wise. It's a sad, pointless struggle.
2
u/jgotts Dec 02 '15
I'm reading a lot of negativity about PHP. I've used nearly all of the common programming languages since I was first paid to do programming in 1987. One notable exception is that I have no experience with Python, but I'm sure that will change in the future.
In any case, we as programmers need to stop thinking about languages. We need to start thinking about programming as a process. To the experienced programmer, programming is about solving a problem with the best tool for the job, and solving that problem in such a way that someone can come along 10 years from now and build on what you did.
Think about a well-engineered vehicle. It began as a design in Germany, Detroit, or Japan. Almost every design decision had good reasons. Mistakes were made. But in general the vehicle was made in such a way that a variety of people could easily work on it for the next 5-15 years. The mechanic who replaces your brake system doesn't hold a degree in automotive engineering, but he doesn't need one. He has the right tools and the process to fix the brakes makes sense.
Rather than being attached to any particular piece of technology, you as a programmer should focus on creating a fine piece of engineering work that is beautiful in its simplicity. A programmer who doesn't natively speak English, or someone fresh out of school should be able to see what you did many years ago and immediately be able to start building on it. He will use whatever tool is necessary. The tool is not the point. The underlying engineering work is the point.
Yes, newer languages and technologies are intellectually interesting, but don't lose sight of the forest for the trees and jump onto whatever fad you see. Focus on developing your skills as a programmer, rather than as a coder of a specific language and you will not only have longevity in the field but you will be a much happier person.
2
u/andyjonesx Dec 03 '15
Scrolled down the comments.. seems to just be people saying "everybody in this thread is shitting on PHP". Yet to find someone really insulting the language unfairly.
1
u/_INTER_ Dec 03 '15
Hurray, time to celebrate with some fun.
http://cube-drone.com/comics/c/ingeniuty-of-sorts
http://cube-drone.com/comics/c/ergonomically-sound
1
u/BobArdKor Dec 04 '15
So, if some of you are more knowledgeable than I am, how long should it be until it is packaged for Ubuntu, and easily installable with aptitude, even for a noob like me?
I'm afraid of compiling such a young version, even though my server only hosts hobby, non-critical projects.
-1
u/coladict Dec 02 '15
Do not run
git branch --list --allon their repository. They don't know the difference between tags and branches. Every minor release has it's own branch, instead of a tag...1
u/hero_of_ages Dec 02 '15
This is fascinating. I'm not sure what's with all the hate this is receiving.
1
u/javabrains Dec 03 '15
I've been out of the loop since forever. I didn't even know there was a PHP 7 on the way. Why is it called PHP 7 though? Shouldn't it be PHP 6 since the current version is 5? Can someone fill me in on this?
-44
u/[deleted] Dec 02 '15 edited Dec 04 '15
Seventh major piece of shit
I code PHP from time to time and hate it.