PHP 5.6.0 Released
An anonymous reader writes The PHP team has announced the release of PHP 5.6.0. New features include constant scalar expressions, exponentiation using the ** operator, function and constant importing with the use keyword, support for file uploads larger than 2 GB, and phpdbg as an interactive integrated debugger SAPI. The team also notes important changes affecting compatibility. For example: "Array keys won't be overwritten when defining an array as a property of a class via an array literal," json_decode() is now more strict at parsing JSON syntax, and GMP resources are now objects. Here is the migration guide, the full change log, and the downloads page.
It does not have to be useful when it has been given a monopoly over the entire industry.
Troll is not a replacement for I disagree.
you so edgy much!
Have they come up with another way to calculate the number of days between any given day and Easter yet? I've been waiting for years for a third function to be added to easter_days and easter_date.. a sort of holy trinity, if you will.
But more seriously, though. Most of these new features are straight up things that python already does.
Const expressions? Since at least 2.0.
** syntax since forever.
integrated debuggers since 2.5ish
file size restrictions since never?
I mean... these are really kinda bad things to just now be getting to.
you just use the baby_jesus_butthole function
or was it jesus_baby_butthole? fuck ima need to check the manual
Student Suspended Over Suspected Use of PHP
The entire industry of really crappy web apps.
I know. They have been adding standard default programming language features for years now. The last time I worked with it a year or two ago I was struck by how you could not even `getArray()[3];`, you needed to `$tmp = getArray(); $tmp = $tmp[3];`. It is a potentially decent generic language with some really retarded areas, that does not seem to be out of the beta phase of its development yet.
Troll is not a replacement for I disagree.
And the function overloading ?????
holy shit, I thought you were joking.
Copyright (c) 1990 - 2014 Dice. All rights reserved. Use of this comment is subject to certain Terms and Conditions.
Yes, it's actually really common.
I started looking into myself recently, since it's basically like a tweaky syntax of Perl (to me, anyhow) but with a simpler web output.
Still seems pretty lame though.
An operating system should be like a light switch... simple, effective, easy to use, and designed for everyone.
How has PHP been given a monopoly on the entire industry? There are other languages out there and many of them are used quite a bit. PHP may or may not be the most popular (I honestly have no stats to tell either way), but even if it was vastly more popular than any other web programming language, it would be far from a monopoly.
My sci-fi novel, Ghost Thief, is now available from Amazon.com.
I wonder if I can get Kickstarter funding for a Pseudocode compiler?
The only question is, should I write it in Javascript or PHP?
Probably because people continue to code like its another language they're used to.
Some things it doesn't do well. Some things it does extremely well.
It's not relevant. It's still useful for people using PHP regardless of other languages.
For what it's worth getArray()[3] was working two years ago (it's been working since PHP 5.4)
How has PHP been given a monopoly on the entire industry?
They made it so easy that any monkey that can "program" html can "program" PHP. Then they made it so easy that any monkey that can run apache can run mod_php.
Meanwhile everyone else was trying to figure out tomcatjakartaxmlrailspassengerwsgi.
Great, what got deprecated? [goes to RTFA]
... and yet the parent still gets modded up. That should tell you something about relationship between what PHP is perceived as being and what it actually is.
Someone flopped a steamer in the gene pool.
PHP is a horrible programming language, but I know why people like PHP applications -- the ability to install an application on a LAMP stack by just untarring a single archive into the deployment directory is priceless.
Last time I tried to install a Python web application, I had to give the installer root privileges to install a bunch of junk in some system-wide module directory. No thanks.
Last time I tried to install a Ruby web application, I ran into a bunch of snafus related to newer versions of Ruby not being backwards compatible with older code, and discovered that the "right" way to do it was to install a whole new package management system that wasn't in sync with my OS's own package manager. No thanks to that, either.
There are other similar expressions that are still not working, though. If you read their todo list for the next major release, cleaning up the parser to allow for arbitrary expressions like that is a major work item. Apparently, they don't even have an AST.
... but, hey, we've got this major feature: you can now multiply two constants, and the result is also a constant! It's almost like C had in, what, 1985? Except that you don't actually need it because this is a dynamic weakly typed language, but who cares. PHP! PHP!
it's the cook that prepares the food. It's not the camera, it's the photographer that shoots the picture. It's not the racing car, it's the driver that wins the race. It's not the programming language, it's the programmer that creates the application.
All you whiners can bash PHP like you want. But a PHP website will still beat your Perl website if the PHP programmer is better than you. So, unless your coding skills are 100% perfect, you better start looking at your own flaws instead of wasting time at whining about a programming language that simply isn't your pick of choice. Please, it's time to grow up.
It doesn't have to be like this. All we need to do is make sure we keep talking.
Yes, and servers do not get updated instantly. Large corporations in particular are always a few years behind, and if you are writing code that will be hosted on a server you do not own yourself it needs to comply to their latest version of PHP, not the bleeding edge of php development.
Troll is not a replacement for I disagree.
Because that is what main players have adopted. If you are programming your own software, on your own hardware, you could write the entire thing in assembly. If you are programming for your companies servers, or "The Cloud" Good luck with the other alternatives.
Troll is not a replacement for I disagree.
It doesn't have a monopoly as such, but it's very hard to avoid. Many - maybe even most - of the major web apps you're likely to be contracted to change/extend are written in PHP for some reason. There appears to be no mainstream alternative to, say, Wordpress/Drupal/et al that's written in something more solid like Java or C#.
You are not alone. This is not normal. None of this is normal.
https://www.flickr.com/photos/...
Reading slashdot one-liner: (irm http://rss.slashdot.org/Slashdot/slashdot).rdf.item | fl title,desc*
Here are the lines matching for grep -P 'CVE-\d{4}-\d+':
Fixed bug #67390 (insecure temporary file use in the configure script). (CVE-2014-3981)
Fixed bug #66060 (Heap buffer over-read in DateInterval). (CVE-2013-6712)
Fixed bug #67716 (Segfault in cdf.c). (CVE-2014-3587)
Fixed bug #67705 (extensive backtracking in rule regular expression). (CVE-2014-3538)
Fixed bug #67327 (fileinfo: CDF infinite loop in nelements DoS). (CVE-2014-0238)
Fixed bug #67328 (fileinfo: fileinfo: numerous file_printf calls resulting in performance degradation). (CVE-2014-0237)
Fixed bug #67326 (fileinfo: cdf_read_short_sector insufficient boundary check). (CVE-2014-0207)
Fixed bug #67410 (fileinfo: mconvert incorrect handling of truncated pascal string size). (CVE-2014-3478)
Fixed bug #67411 (fileinfo: cdf_check_stream_offset insufficient boundary check). (CVE-2014-3479)
Fixed bug #67412 (fileinfo: cdf_count_chain insufficient boundary check). (CVE-2014-3480)
Fixed bug #67413 (fileinfo: cdf_read_property_info insufficient boundary check). (CVE-2014-3487)
Fixed bug #66731 (file: infinite recursion). (CVE-2014-1943)
Fixed bug #66820 (out-of-bounds memory access in fileinfo). (CVE-2014-2270)
Fixed bug #66946 (fileinfo: extensive backtracking in awk rule regular expression). (CVE-2013-7345)
Fixed bug #67060 (sapi/fpm: possible privilege escalation due to insecure default configuration). (CVE-2014-0185)
Fixed bug #67730 (Null byte injection possible with imagexxx functions). (CVE-2014-5120)
Fixed bug #66901 (php-gd 'c_color' NULL pointer dereference). (CVE-2014-2497)
Fixed bug #66356 (Heap Overflow Vulnerability in imagecrop()). (CVE-2013-7226)
Fixed bug #66815 (imagecrop(): insufficient fix for NULL defer). (CVE-2013-7327)
Fixed bug #67717 (segfault in dns_get_record). (CVE-2014-3597)
Fixed bug #67432 (Fix potential segfault in dns_get_record()). (CVE-2014-4049)
Fixed bug #67539 (ArrayIterator use-after-free due to object change during sorting). (CVE-2014-4698)
Fixed bug #67538 (SPL Iterators use-after-free). (CVE-2014-4670)
Fixed bug #67492 (unserialize() SPL ArrayObject / SPLObjectStorage Type Confusion). (CVE-2014-3515)
That's not the applications written in PHP, mind you. That's the language system.
... until one day someone gets food poisoned and the restaurant shuts down.
I'm working on a java version. So far I've got about 4000 lines of xml, I think I'll need a few thousand more to configure tomcat, and a couple hundred for mod_jk, then I'll be ready to write my first java class.
An analogy that is both LMFAO hilarious AND absolutely accurate! Post of the day.
PHP is a horrible programming language, but I know why people like PHP applications -- the ability to install an application on a LAMP stack by just untarring a single archive into the deployment directory is priceless.
Last time I tried to install a Python web application, I had to give the installer root privileges to install a bunch of junk in some system-wide module directory. No thanks.
Last time I tried to install a Ruby web application, I ran into a bunch of snafus related to newer versions of Ruby not being backwards compatible with older code, and discovered that the "right" way to do it was to install a whole new package management system that wasn't in sync with my OS's own package manager. No thanks to that, either.
Maybe now you finally understand why every year is still the Year of the Windows Desktop?
Last time I tried to install a Python web application, I had to give the installer root privileges to install a bunch of junk in some system-wide module directory. No thanks.
You're doing it wrong.
it's been working since PHP 5.4
And guess where Red Hat Enterprise Linux stopped. The only things they backport from new versions are the security fixes.
I blame shared hosting providers that include PHP support in the cheapest package but require an upgrade (at additional cost per month) for any other server-side language.
Why didn't you resolve those dependencies as root yourself, the installer presumably shows what it dose when it fails as a non-root, even if it doesn't do this you can work out the name of the required package. It's normal to run a script and find that it uses some library that you don't have already. Ever tried a java web archive? Just plonk that in the tomcat ROOT dir and it installs automatically, you don't even have to run it. That's priceless.
Why UNIX?
"Why don't you just do $X yourself?"
Because my time is valuable, and not having to spend time doing something that could be automated helps me focus on something else more productive. (Nevermind that I'm making this post on Slashdot right now...) Automation can also potentially cut-down on human error.
".. presumably [set of conditions], so you can just work it out .."
That would be nice, and when I can work it out, great. But having to work-out something that could be designed so that I don't HAVE to work it out is wasting my time; see above. Plus, some of my coworkers don't have the expertise to work it out, which can lead to more foul-ups.
"It's normal for $INCONVENIENT_BEHAVIOR to happen."
This is just an excuse. If other deployment ecosystems are able to not allow some inconvenient behavior to happen, then it's not "normal". They can and should do better.
And yes, java web archives are like that, but that person wasn't talking about java web archives. There are some very popular platforms out there which are a pain in the ass to install.
That's because PHP doesn't require anything extra except tuning max_execution_time and the memory limits to make it work for everyone. I'd demand extra money if I had to babysit your rails process and kill it when it consumes a gig of ram on a shared host.
I sense your livelihood might be threatened?
This is one of many reasons why PHP wins out over alternatives.
If you really hate PHP, find a better solution. I'm seeing a lot of talk here about Python and Ruby, but both completely fall flat where PHP excels. Let me know when the catch-up.
Required reading for internet skeptics
I'm certainly biased because my company (ServerPilot) sells a service for PHP developers using DigitalOcean and other servers, but it does seem like PHP is making great progress in the past few years both in the language and in terms of a strong developer community. We're very glad to see PHP 5.3 EOL'd recently. To encourage adoption of 5.6, we've already packaged and added support for 5.6.
Which is halfway to Java... too bad oracle bought Java. It's really nice for web servers. :P
*end troll*
tweaky, as in toothless meth addict.
Copyright (c) 1990 - 2014 Dice. All rights reserved. Use of this comment is subject to certain Terms and Conditions.
I code in PHP for my day job. There's almost nothing I can't do in PHP. Millions of people use my PHP code. I also know several other languages, so I have some basis of comparison to say PHP 5.0 kinda sucked as a general purpose programming language, and I can tell you exactly WHY it sucked.
PHP was originally a blog / CMS script written in Perl. It was designed to be a blog, not language for general programming. In fact, it wasn't even supposed to be used by programmers at all. It was designed for webmasters who didn't know Perl and didn't want to learn. Up through version 4, it's roots were painfully obvious. Lerdorf has said "I know nothing about language design ", and he's right. Fortunately, he hired some people who do have a clue for the 5.4 versions, so it's getting better.
also people liked PHP because of it's flexible syntax. it was not as picky as Perl/other languages, therefore you can write it many ways and have bugs yet it wouldn't break..
My first time writing Perl and JavaScript long time ago I realized the languages were picky as fuck. if I wrote something it might not work and break easily, and all code on the page would be broken by one error.
PHP? no problems, it just worked, and it did things in less complex way but was still capable of everything I would ever need to do.
It's true that there probably isn't a thing Perl or Python can do that I cannot do in PHP when it comes to writing web pages and serving or handling web page requests... Is PHP suitable for stand alone applications? I don't know that much, but it was much nicer working with as a novice programmer a decade ago, and I literally fell in love over night with it after spending a month first fussing with Perl and CGI.
Umbraco, Orchard? Both mainstream, both mature and both a worthwhile replacement for Wordpress et al.
... consider this:
How many people and projects use PHP? How many use another PL? How many fixes and updates would be in line for that other PL if it would have the same userbase. ... When did Ruby finally become UTF8 safe again?
Make it work, then make it beautiful.
If any PL incorporates this philosophy, it's PHP.
And AFAICT they're doing pretty well following it, don't you think?
My 2 cents.
We suffer more in our imagination than in reality. - Seneca
Yeah, how about fixing their busted-ass build engine first, especially for Solaris? So far I have had to patch a shitload of things in the configure and Makefile to get it to build.
They add '**' while meanwhile their product does not even build. The stroke of a pure genius.
Umbraco is TOTAL CRAP. I implemented a large bay area metropolitan county agency intranet extranet and resource site in Umbraco and I wanted to stab out my eyes after the process was done. What a complete pile of shite.
Anyone who develops web applications using .NET deserves all the suffering that ensues.
don't hate the language, hate the game player ;)
hear hear +1
I see the mods are still not bothering to read the moderation guidelines after all these years. /. jumped the shark when Rob left. I think it's time I take the hint and bail myself.
I think it's time for some *real* flamebait -
An operating system should be like a light switch... simple, effective, easy to use, and designed for everyone.
Every time I update PHP on my Windows dev box, I have to re-arrange the order of the extensions in the config file to get PHP to start. Apparently, if you use any extensions that aren't enabled in a vanilla install, the default order of the extensions results in dependency issues. The helpful, paraphrased error message I get is something like, "PHP can't load this extension".
Yes, I know I'm talking about the Windows version, but installing PHP still isn't as simple as just unzipping an archive.
Then again, I've learned not to trust anything in PHP that is designed to make it portable across OSes. I used to use PHP_EOL to determine which newline style to use in my text files. On more than one occasion, PHP_EOL was broken and produced UN*X newlines.
Mainstream? Never heard of either of them.
Using Slashdot's search feature: Wordpress brings up too many hits to count. Umbraco? Zero. Orchard? Less than one page none of which appear to have any relation to the CMS project.
So I can reasonably suggest I'm not in a minority here in never hearing about any of them.
You are not alone. This is not normal. None of this is normal.
In fairness Java hasn't really been like that for years. Not that I blame anyone for holding grudges.
You are not alone. This is not normal. None of this is normal.