Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

We are sorry to see you leave - Beta is different and we value the time you took to try it out. Before you decide to go, please take a look at some value-adds for Beta and learn more about it. Thank you for reading Slashdot, and for making the site better!

PHP 5.6.0 Released

timothy posted about 3 months ago | from the still-hard-to-pronounce dept.

PHP 118

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.

Sorry! There are no comments related to the filter you selected.

Now almost as useful as python was 5 years ago! (-1, Flamebait)

i kan reed (749298) | about 3 months ago | (#47777577)

n/t.

Re:Now almost as useful as python was 5 years ago! (2)

wisnoskij (1206448) | about 3 months ago | (#47777671)

It does not have to be useful when it has been given a monopoly over the entire industry.

Re:Now almost as useful as python was 5 years ago! (1, Informative)

i kan reed (749298) | about 3 months ago | (#47777733)

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.

Re:Now almost as useful as python was 5 years ago! (1, Interesting)

wisnoskij (1206448) | about 3 months ago | (#47777801)

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.

Re: Now almost as useful as python was 5 years ago (0)

Anonymous Coward | about 3 months ago | (#47778091)

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.

Re:Now almost as useful as python was 5 years ago! (3, Informative)

Anonymous Coward | about 3 months ago | (#47778159)

For what it's worth getArray()[3] was working two years ago (it's been working since PHP 5.4)

Re:Now almost as useful as python was 5 years ago! (1)

pspahn (1175617) | about 3 months ago | (#47778261)

... 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.

Re:Now almost as useful as python was 5 years ago! (1)

shutdown -p now (807394) | about 3 months ago | (#47778277)

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.

Re:Now almost as useful as python was 5 years ago! (1)

wisnoskij (1206448) | about 3 months ago | (#47778461)

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.

Outdated PHP in RHEL (1)

tepples (727027) | about 3 months ago | (#47779429)

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.

Re:Now almost as useful as python was 5 years ago! (5, Insightful)

Jmstuckman (561420) | about 3 months ago | (#47778267)

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.

Re:Now almost as useful as python was 5 years ago! (1)

Anonymous Coward | about 3 months ago | (#47779309)

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?

Re:Now almost as useful as python was 5 years ago! (0)

Anonymous Coward | about 3 months ago | (#47779327)

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.

Re:Now almost as useful as python was 5 years ago! (1)

eneville (745111) | about 3 months ago | (#47779495)

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.

Re:Now almost as useful as python was 5 years ago! (0)

Anonymous Coward | about 3 months ago | (#47779679)

"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.

Re:Now almost as useful as python was 5 years ago! (-1)

Anonymous Coward | about 3 months ago | (#47782021)

this is not why people like PHP at all. they like it because a long time ago, you had to basically code everything by hand from scratch and doing things were often difficult because of this. example:

Perl was one of the most common cgi languages back in the day. If you used it, you had to write the entire app by scratch and there were no built in database functions, protocol handlers, or data format interpreters, or nothing. Everything was done at a low level like, read this many bytes, parse it, know the protocol and write the protocol, connect with an open socket to do it, do it all by hand, write grueling math by yourself to do complex things, and your app took waaaay longer to write because of it and you had to be proficient at everything you did yourself.

Then PHP came along. It included: handling all the underlying protocol shit for you so you didn't have to write a way to connect to a protocol or receive data from it and store and access it. It included built in ways to read and write many formats. It included a direct function to email that didn't require you writing a SMTP server yourself or connecting to a SMTP server and issuing all the protocol yourself, etc. It handled all database storage and retrieval of information itself so you could easily store and access data w/o knowing the protocols yourself, and mostly without having to write the code to do it yourself.

Everything in PHP just works and the most basic things are included in the language all done for you. You can even do image manipulation, decompress and compress, encrypt shit, split, explode, and manipulate data/text easier, etc.. PHP saves time and energy so everyone switched to it..

Sure it's even easier to install because you don't have to rely on someone elses function library that isn't included with the default install of Perl anymore, as you said..

but you can also put custom written PHP libraries and packages into any file and include it w/o needing to install it in the main PHP binary or through plugins, etc.

Re:Now almost as useful as python was 5 years ago! (0)

Anonymous Coward | about 3 months ago | (#47782049)

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.

Re:Now almost as useful as python was 5 years ago! (0)

Anonymous Coward | about 3 months ago | (#47777797)

The entire industry of really crappy web apps.

Re:Now almost as useful as python was 5 years ago! (1)

Jason Levine (196982) | about 3 months ago | (#47778063)

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.

Re:Now almost as useful as python was 5 years ago! (0)

Anonymous Coward | about 3 months ago | (#47778181)

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.

Re:Now almost as useful as python was 5 years ago! (1)

wisnoskij (1206448) | about 3 months ago | (#47778569)

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.

Re:Now almost as useful as python was 5 years ago! (1)

squiggleslash (241428) | about 3 months ago | (#47778857)

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#.

Re:Now almost as useful as python was 5 years ago! (0)

Anonymous Coward | about 3 months ago | (#47779081)

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.

Re:Now almost as useful as python was 5 years ago! (1)

narcc (412956) | about 3 months ago | (#47779981)

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.

Re:Now almost as useful as python was 5 years ago! (1)

Richard_at_work (517087) | about 3 months ago | (#47782475)

Umbraco, Orchard? Both mainstream, both mature and both a worthwhile replacement for Wordpress et al.

Re:Now almost as useful as python was 5 years ago! (0)

tepples (727027) | about 3 months ago | (#47779479)

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.

Re:Now almost as useful as python was 5 years ago! (2, Insightful)

Anonymous Coward | about 3 months ago | (#47779821)

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.

Re:Now almost as useful as python was 5 years ago! (0)

Anonymous Coward | about 3 months ago | (#47777679)

you so edgy much!

Re:Now almost as useful as python was 5 years ago! (-1, Troll)

Anonymous Coward | about 3 months ago | (#47777717)

I'd argue that it's still slightly less useful than Python was 25 years ago.

Re:Now almost as useful as python was 5 years ago! (0)

Anonymous Coward | about 3 months ago | (#47778101)

It's not relevant. It's still useful for people using PHP regardless of other languages.

It's powerful, but.. (5, Funny)

Joe Gillian (3683399) | about 3 months ago | (#47777705)

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.

Yes it's easy, with this code: (1)

Anonymous Coward | about 3 months ago | (#47777745)

you just use the baby_jesus_butthole function

or was it jesus_baby_butthole? fuck ima need to check the manual

Re:Yes it's easy, with this code: (4, Funny)

Qzukk (229616) | about 3 months ago | (#47777817)

It's baby_jesus_real_butthole(first_half_of_needle, haystack, last_half_of_needle), duh. But don't blame php for that, that's the name of the function straight from libjesus [mysql.com] .

Re:Yes it's easy, with this code: (1)

Anonymous Coward | about 3 months ago | (#47777863)

Ahh understood, because without baby_jesus_real_butthole , hit butthole could be prone to SQL injections.

Sanitize your buttholes.

Re:Yes it's easy, with this code: (0)

Anonymous Coward | about 3 months ago | (#47778645)

Sanitize buttholes? Nope, sanitize buthole inputs!

It's powerful, but.. (2)

slashdice (3722985) | about 3 months ago | (#47777825)

holy shit, I thought you were joking.

Re:It's powerful, but.. (0)

Anonymous Coward | about 3 months ago | (#47777853)

I know right! lol

Re:It's powerful, but.. (1)

Joe Gillian (3683399) | about 3 months ago | (#47777919)

Nope! I don't code at all, but I had friends who coded pretty heavily in PHP and tried to learn it once. I spent a few hours one day looking at the list of functions included with PHP, and sure enough those two are in the official PHP documentation. To this day, I have no idea why they needed two built-in functions to determine when Easter was, or who it was they were expecting would use them... or why Easter, of all days.

Re:It's powerful, but.. (2)

tendrousbeastie (961038) | about 3 months ago | (#47778017)

I assume it is an ironic joke.

Historically calculating the date of Easter was a hugely difficult and complicated task for medieval scholastic monks - one that involved a huge amount of time and controversy.

Re:It's powerful, but.. (3, Insightful)

pspahn (1175617) | about 3 months ago | (#47778051)

Can you really not figure it out?

First off, would it be quite easy for you to tell me off the top of your head what the date of Easter will be in 2021? How about just next year? The date it falls on it fairly complicated and not exactly simple to write an algorithm for.

Ok, but who will use it? I guess it comes as a surprise that it is a fairly important holiday for religious reasons and that a number of other holidays' dates are intertwined with Easter.

If you really see no practical application for that, well I guess you're just not trying hard enough.

Re:It's powerful, but.. (2)

slashdice (3722985) | about 3 months ago | (#47778575)

the point is, they're built-in functions. Not a library or package, but part of the core language. What other language has a function (let alone two functions) to tell you when easter is?

Re:It's powerful, but.. (1)

pspahn (1175617) | about 3 months ago | (#47778971)

Sure, why not part of the core language? Think about it ...

Out of all the holidays that I'm thinking of off the top of my head, Easter is the one that stands out as being of significant importance as well as being rather awkward to figure when it occurs. If you couple this with the fact that PHP is a web language (an environment where knowing when Easter is can come in rather handy) I think it makes perfect sense.

I suppose if you're griping because there is no core method `ramadan_date` or `chinese_new_year_date`, then that makes sense.

Re:It's powerful, but.. (0)

Anonymous Coward | about 3 months ago | (#47780857)

Out of all the holidays that I'm thinking of off the top of my head, Easter is the one that stands out as being of significant importance....

That is only for western world and the western world is not the only world on this earth! Easter is nothing in many eastern world except for some people in the particular religion.

Re:It's powerful, but.. (1)

Anonymous Coward | about 3 months ago | (#47781051)

Why would you expect holidays to be part of the core package to begin with? The idea of that being where it belongs is stupid as hell.

Re:It's powerful, but.. (0)

Anonymous Coward | about 3 months ago | (#47779487)

The date it falls on it fairly complicated and not exactly simple to write an algorithm for.

The algorithm is simple: Easter Sunday is the first Sunday after the first full moon after the spring (northern hemisphere) equinox.

It does get a bit tricky if the full moon is near the equinox, then you have to figure exact timing, but otherwise you can round to a day. But it's a straightforward astronomical calculation.

Re:It's powerful, but.. (1)

Jason Levine (196982) | about 3 months ago | (#47778123)

I actually like coding in PHP. You can create some really nice applications using it. Then again, you can create really nice applications with just about any server side language if you know what you are doing.

My main beef with PHP is the inconsistency with built-in function names. If you want to replace within a string, you use "str_replace", if you want to split a string into an array, you use "str_split". However, if you want to get part of the string, you use "substr". And if you want to compare two strings, you use "strcmp". If they could get some consistency there, it would vastly improve the language.

Re:It's powerful, but.. (0)

Anonymous Coward | about 3 months ago | (#47781677)

Hint: create your own first class variable wrapper functions: $sr, $ss, $sf and $sc

Re:It's powerful, but.. (1)

Bloke down the pub (861787) | about 3 months ago | (#47778767)

Maybe because it's a public holiday in some countries. Enterprisey stuff likes to know things like that.

As to there being two, I understand that the benighted heathens of the Byzantine persuasion calculate it differently to the bead-jigglers in Rome.

Then again, it's PHP so all bets are off.

Re:It's powerful, but.. (0)

Anonymous Coward | about 3 months ago | (#47778919)

The Zend engine was originally written by an Israeli, so they're clearly concessions to the Christians for all the unexpected T_PAAMAYIM_NEKUDOTAYIM.

Re:It's powerful, but.. (1)

CastrTroy (595695) | about 3 months ago | (#47777857)

It would be trivial to program your own function to do the same. Pseudocode shown below

function daysToEaster($aDate) {
var $nextEaster;

if(aDate <= easter_date(year($aDate))
$nextEaster = easter_date(year($aDate));
else
$nextEaster = easter_date(year($aDate) + 1);

return floor($nextEaster - $aDate/(60*60*24));
}

Pseudocode (0)

Anonymous Coward | about 3 months ago | (#47778085)

I wonder if I can get Kickstarter funding for a Pseudocode compiler?

The only question is, should I write it in Javascript or PHP?

Re:Pseudocode (1)

CastrTroy (595695) | about 3 months ago | (#47778843)

It already exists. It's called the VB.Net compiler. I swear that VB was designed to look like pseudocode. I use it at work, and actually find the readability of it quite good.

Re:Pseudocode (0)

Anonymous Coward | about 3 months ago | (#47778939)

COBOL is super readable.

Writability is a concern, though. Fucked if I could write two lines of MULTIPLY X BY Y GIVING Z before killing myself.

Re: It's powerful, but.. (1)

master_kaos (1027308) | about 3 months ago | (#47779559)

Omg I am a professional php developer I didn't even know these functions existed, I thought you were joking and had to look it up. Don't think I would ever have a use for them

Re:It's powerful, but.. (1)

hholzgra (6914) | about 3 months ago | (#47780291)

easter_days() plus fixed offset will get you a given years Ascension Day (easter_days+39, Withsunday (+49) etc.

strictly speaking easter_date() is indeed redundant as you could as well use easter_days()+0, but its there as convenience function ...

but as far as I remember the main reason for having both was that the C library the calendar extension relies on has both, too ...

You can get into trouble for using PHP (1)

Anonymous Coward | about 3 months ago | (#47777751)

Re:You can get into trouble for using PHP (1)

RiscIt (95258) | about 3 months ago | (#47777977)

+1 point for linking to the ghost town that is bbspot.

Re:You can get into trouble for using PHP (1)

Monkey (16966) | about 3 months ago | (#47779905)

Yeah, I was surprised to see that the site still exists.

Re:You can get into trouble for using PHP (2)

Jason Levine (196982) | about 3 months ago | (#47778045)

For a split second, I was going to voice my outrage over such a thing happening before my brain kicked in and I remembered that BBSpot is a humor website.

In my defense, though, when a teen can be arrested for writing a story in which he uses a gun to kill his neighbor's pet dinosaur [nydailynews.com] , the humor/satire stories can be hard to separate from the true stories.

overloading (0)

Anonymous Coward | about 3 months ago | (#47777819)

And the function overloading ?????

Re:overloading (1)

i kan reed (749298) | about 3 months ago | (#47777841)

That's not likely in a weakly typed language. Because the only overloads can be number of args.

People still use this shit? (-1)

Anonymous Coward | about 3 months ago | (#47777887)

Seriously?

Re:People still use this shit? (0)

WinterSolstice (223271) | about 3 months ago | (#47777951)

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.

Re:People still use this shit? (1)

slashdice (3722985) | about 3 months ago | (#47781201)

tweaky, as in toothless meth addict.

PHP 5.6.0 released... (-1)

Anonymous Coward | about 3 months ago | (#47777983)

... and nothing of value was gained!

Same old... (-1, Flamebait)

RandomPsychology (932636) | about 3 months ago | (#47778001)

PHP is like old, moldy spaghetti that is reheated over and over, new sauce poured on top, and served to the same customers after they send it back to the kitchen again and again for being horrible.

Re:Same old... (1)

xushi (740195) | about 3 months ago | (#47779047)

... until one day someone gets food poisoned and the restaurant shuts down.

LMFAO (0)

Anonymous Coward | about 3 months ago | (#47779105)

An analogy that is both LMFAO hilarious AND absolutely accurate! Post of the day.

My only question (1)

Anonymous Coward | about 3 months ago | (#47778203)

Great, what got deprecated? [goes to RTFA]

Still no Unicode? (1)

shutdown -p now (807394) | about 3 months ago | (#47778295)

... 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!

Re:Still no Unicode? (1)

tepples (727027) | about 3 months ago | (#47779547)

How are mbstring and iconv not Unicode? Is it just that a byte order mark inserted by Windows Notepad will cause headers to be sent?

Re:Still no Unicode? (1)

shutdown -p now (807394) | about 3 months ago | (#47779665)

iconv lets you convert things, but what are you going to convert it to? UTF-8? Sure, and how many libraries (including core PHP ones) are UTF-8 aware? Most won't use mbstring, they'll just treat strings as arrays of bytes, and you're really lucky if they don't assume byte = char anywhere.

Treating strings as 8-bit clean works well in some cases, but fails pathetically in so many others. Yet that is the game that PHP is trying to play.

It's not the knife... (5, Insightful)

Aethedor (973725) | about 3 months ago | (#47778353)

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.

Re:It's not the knife... (4, Insightful)

Ignacio (1465) | about 3 months ago | (#47778639)

"... if the PHP programmer is better than you."

For every good-to-excellent PHP programmer there is a small army of mediocre-to-bad PHP programmers. You get chefs that deep-fry rubber boots, photographers that can't tell the lens from the viewfinder, and drivers that can't put a car in gear without breaking something.

But it also doesn't help when the programming language tells them that someone somewhere likes to eat overcooked footwear, or hands them a camera which is a featureless cube with two identical holes on either side, or takes away the gear shift and replaces it with a button labelled "Crash".

Re:It's not the knife... (0)

Aethedor (973725) | about 3 months ago | (#47778733)

Thank you for proving my point.

If you don't like PHP, that's fine. But please, stop wasting other people's time with your whining about it. Really, nobody cares!

Re:It's not the knife... (2)

Ignacio (1465) | about 3 months ago | (#47779111)

"Other" people's time? As far as I can tell, the only other person's time I'm wasting is yours. Want to go ballooning this weekend? We don't even need to bring fuel.

Re:It's not the knife... (-1)

cyborg_monkey (150790) | about 3 months ago | (#47779267)

Oh shut your filthy cunt-hole.

Re:It's not the knife... (0)

Anonymous Coward | about 3 months ago | (#47778855)

I have a love-hate relationship with php. if you actually know all the edge cases and places you need to avoid its great! If you don't or don't realize that you don't you'll get bit and might not realize it until its running in production.

Re:It's not the knife... (1)

TheDarkMaster (1292526) | about 3 months ago | (#47778883)

PHP is a very bad knife, and even a good cook can do a better (or easier) work when he have good knifes.

Re:It's not the knife... (1)

Aethedor (973725) | about 3 months ago | (#47778927)

It's not a bad knife. It's just that *you* think that it's a bad knife. I think it's a fine knife. I'm not saying perfect, but no knife is. I know its good sides, I know its bad sides, which allows me to handle it well. The things I create with it are really up any challenge.

But tell me, how's your cooking?

Re:It's not the knife... (1)

TheDarkMaster (1292526) | about 3 months ago | (#47779077)

So I "think" that is a bad knife (from my experience using it on a big government system) and you thinks is a good knife[citation needed], so what? Is ony your opinion against mine, and I seriously doubt that your opinion carries more weight than mine only because you want so.

Re:It's not the knife... (0)

Anonymous Coward | about 3 months ago | (#47780915)

Holy heck! Nobody uses PHP for government system! You should use Java or .NET for it to get payment of millions of dollars since they can handle that!

Re: It's not the knife... (1)

Aethedor (973725) | about 3 months ago | (#47781859)

You're missing my point. I'm only saying: if you don't like it, don't use it. But don't bug other people with oppinion, because it's irrelevant to the .

It used to be a spoon. Okay, a blog/CMS (1)

raymorris (2726007) | about 3 months ago | (#47781525)

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.

Re:It's not the knife... (0)

Anonymous Coward | about 3 months ago | (#47778987)

PHP is a very bad knife

"That's not a knife, that's a spoon!"

Re:It's not the knife... (0)

Anonymous Coward | about 3 months ago | (#47779123)

I think it's funny that people constantly complain about C being dangerous because it's easy to make mistakes with pointers.
But when you point out that PHP makes it easy to make all kinds of mistakes and is missing simple syntactic features, people start going on about how good programmers can program in any language.
At least for C we have the excuse that working with pointers actually useful for writing low level stuff.

Re:It's not the knife... (0)

Anonymous Coward | about 3 months ago | (#47778957)

Sure, but a language where you use (int) to cast, but that has no knowledge of the type int is still ridiculous.

Re:It's not the knife... (1)

dgatwood (11270) | about 3 months ago | (#47779393)

Nah, that's part of its charm. PHP is C with dollar signs.... :-)

Re:It's not the knife... (0)

Anonymous Coward | about 3 months ago | (#47781599)

Sure it does.

is_int(1); // true
is_int("1") // false

Also you can also use intval("1") to cast if you don't like (int)

Re:It's not the knife... (0)

Anonymous Coward | about 3 months ago | (#47778997)

Nope, it IS the knife...

PHP: Fractal of Bad Design [eev.ee]

Asking a developer to use PHP is like asking a carpenter to frame a house using only a pile of twigs and a spoon. You can ask. You can pay for the work. The end product is not going to be very good. However, using PHP, one might end up with a good enough rinky-dink website for a rinky-dink company - and there's your use case for PHP

I sense your livelihood might be threatened? (0)

Anonymous Coward | about 3 months ago | (#47779823)

I sense your livelihood might be threatened?

Re:It's not the knife... (2)

websitebroke (996163) | about 3 months ago | (#47781215)

You know, I read that article, and I walked away from it thinking the guy just really doesn't understand what exactly a scripting language is for, and how they work. For example, he was so incensed at the === operator, contending that == in PHP is useless. But it's quite useful. If you're testing for "truthy" values such as true, 1, or a character string, you use ==. If you need an actual boolean, use ===.

Re:It's not the knife... (0)

Anonymous Coward | about 3 months ago | (#47779125)

"It's not the knife... it's the cook that prepares the food."

Try preparing a good dish with a blunt knife. Trust me, a fresh fish is not something you'd want to prepare with that, no matter how good of a cook you are.

"It's not the camera, it's the photographer that shoots the picture."

Try taking a picture with a shitty-ass 1995 0.1MP brandless usb webcam.

"It's not the racing car, it's the driver that wins the race."

Really? So can Montoya still win the race with a Lada Forma?

"It's not the programming language, it's the programmer that creates the application."

Even if written with QBASIC for this day and age?

Seriously, you only look fucking dumb saying this shit pretending to look smarter...

Re:It's not the knife... (1)

hcs_$reboot (1536101) | about 3 months ago | (#47780521)

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.

Yes but a good cook will do better with a good knife, a good photog will be better with a good camera, and a good programmer will perform better with a well designed language.

Re:It's not the knife... (1)

sithlord2 (261932) | about 3 months ago | (#47782809)

Sure, but a programming language should not work AGAINST the programmer, and this is exactly what PHP does.

Take a look at this page, and no, it's not an anti-php rant, but an overview of actual facts about PHP:

http://eev.ee/blog/2012/04/09/... [eev.ee]

I made a few PHP projects myself, but since I discovered Python and Django Framework, I would never go back to PHP again.

24 CVE fixes in one language system release (3, Interesting)

mr_mischief (456295) | about 3 months ago | (#47779017)

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.

Re:24 CVE fixes in one language system release (1)

tepples (727027) | about 3 months ago | (#47779575)

How many CVE fixes do you get in your typical web browser, or should I say client-side JavaScript language system?

PHP making great progress (2, Informative)

justin samuel (961189) | about 3 months ago | (#47780239)

I'm certainly biased because my company (ServerPilot [serverpilot.io] ) 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.

So it's half-way to python.. (0)

Anonymous Coward | about 3 months ago | (#47781165)

Which is halfway to Java... too bad oracle bought Java. It's really nice for web servers.
*end troll* :P

Load More Comments
Slashdot Login

Need an Account?

Forgot your password?