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!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

PHP 5.5.0 Released

Soulskill posted about a year ago | from the onward-and-upward dept.

PHP 219

New submitter irventu writes "The long-awaited PHP 5.5.0 has finally been released, bringing many new features and integrating Zend's recently open-sourced OPcache. With the new Laravel PHP framework winning RoRs and CodeIgnitor converts by the thousands, Google recently announcing support for PHP in its App Engine and the current PHP renaissance is well underway. This is great news for the web's most popular scripting language." The full list of new features is available at the Change Log, and the source code is at the download page.

cancel ×

219 comments

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

first (-1)

Anonymous Coward | about a year ago | (#44069943)

first

PHP 6.0 without the stupid? (5, Insightful)

Anonymous Coward | about a year ago | (#44069969)

I'm still waiting for a PHP 6.0 that's an actual rewrite without all the stupid. With every new version, I just see more features get tacked on ("Objects").

It's wonderfully backward compatible because nothing really gets removed in newer versoins, but it would be nice if the language could be made more pleasant to use.

Re:PHP 6.0 without the stupid? (5, Informative)

Anonymous Coward | about a year ago | (#44070041)

The thing that bothers me most is the inconsistency in function names or argument order. When I'm using PHP, I have to constantly keep looking the functions up to make sure its doing what I expect.

Re:PHP 6.0 without the stupid? (1, Redundant)

Krojack (575051) | about a year ago | (#44070157)

Oh hellz yeah. Glad I'm not the only one this annoys.

Re:PHP 6.0 without the stupid? (4, Funny)

gbjbaanb (229885) | about a year ago | (#44070315)

so do I.. but then, I'm old and I have to do that for everything. Maybe its not the language after all.. just saying :-)

Re:PHP 6.0 without the stupid? (1)

ackthpt (218170) | about a year ago | (#44071373)

so do I.. but then, I'm old and I have to do that for everything. Maybe its not the language after all.. just saying :-)

I'm not old, well, super old, but I've always found that to be a good practice anyway. Too often I'm switching between 4 or 5 languages, all of which do something differently (why the heck can't we have uniform names for routines across langauges?!? Yeah, I know, big dream and horses got out of the barn years ago.)

Re:PHP 6.0 without the stupid? (1)

Anonymous Coward | about a year ago | (#44070607)

So you would convert and sing it's praises if they changed that then right?

Re: PHP 6.0 without the stupid? (4, Insightful)

thetoadwarrior (1268702) | about a year ago | (#44070671)

This is one of the biggest problems. It's a horrible language to look at. The carelessness carries through the community too. You simply can't trust third party to be anything but amateur. But who can blame PHP devs when the core language is cack and the documentation is laughable.

Re: PHP 6.0 without the stupid? (2)

gorzek (647352) | about a year ago | (#44070767)

What I've found to be truly bizarre is that a lot of the official documentation makes no sense, in and of itself. It's vague and difficult to interpret. You normally have to scroll down to the comments to see how people actually use it, and it's only at that point that the function in question begins to make any sense. The documentation itself is just too barebones to be adequate.

Python's practice of including simple examples with the documentation of virtually every command and function and feature is incredibly handy.

Re: PHP 6.0 without the stupid? (0)

jones_supa (887896) | about a year ago | (#44070917)

Python's practice of including simple examples with the documentation of virtually every command and function and feature is incredibly handy.

PowerShell is also a great example of a program with lots of good examples [ggpht.com] included in the documentation.

Re: PHP 6.0 without the stupid? (4, Insightful)

Bert64 (520050) | about a year ago | (#44070837)

Part of the problem with PHP is that it's designed to be simple to pick up... Many people start by just adding one or two simple PHP tags to an existing HTML file and go from there.

No need to learn a development environment, no need to create archives or packages, quite literally anyone can create their first "dynamic" webpage by adding one line of php to an existing html file, many people do something really simple like just show the current time etc.

This accessibility has a price, because php is accessible to people with little or no experience of writing code, then lots of such people use it and this often results in very poor code. It's perfectly possible to write very clean code with PHP, you just have to look for it amongst all the thousands of novice programmers turning out junk.

Re: PHP 6.0 without the stupid? (0)

thetoadwarrior (1268702) | about a year ago | (#44070971)

I would agree and that's fine but maybe people shouldn't try to do bigger things with it. Bash script is a mighty fine tool but I would right a big application in it. I think PHP is the same. It is easy to play with and learn but really you need to move on eventually.

Re: PHP 6.0 without the stupid? (2, Insightful)

Dracos (107777) | about a year ago | (#44070905)

Hey, don't blame all of us for Wordpress.

Re: PHP 6.0 without the stupid? (4, Informative)

garyebickford (222422) | about a year ago | (#44071517)

Ha. As a programmer in at least two handfuls of languages over 40 years from IBM 1130 ASM, FORTRAN, ALGOL 68, Pascal, Basic (ick), APL, etc., and long time programmer in PHP, I am presently in the process of hacking up someone else's Perl.

Nobody who writes in Perl can have anything to say about the structure, style or consistency of PHP. PHP may have grown like topsy and it could certainly use some revision of function argument order, but it at least uses a syntax that is remotely similar to other common imperative languages - java, c, etc. From my first look at Perl in 1995 I always thought Perl looked like sneezing, and now I'm working with it, my first impression was correct. (Although in fairness I use PCRE in PHP quite a lot!)

This is my most recent 'fave' quote from perlsyn - on 'when', which is part of Perl's attempt to rethink (or something) the switch/case pattern [perl.org] :

Exactly what the EXPR argument to when does is hard to describe precisely, but in general, it tries to guess what you want done. Sometimes it is interpreted as $_ ~~ EXPR, and sometimes it does not. It also behaves differently when lexically enclosed by a given block than it does when dynamically enclosed by a foreach loop. The rules are far too difficult to understand to be described here. See Experimental Details on given and when later on.

Pathologically Eclectic Rubbish Lister [perl.org] indeed!

Since I'm on a role here, I will complain about one thing in Python, though I've only programmed a bit in Python. Python's much vaunted 'indent' based nesting is a mistake, because it only uses one invisible marker (which may be instantiated by several symbols - spaces and tabs, at least) to do this. All other common languages I can think of use different markers for begin and end, which acts as a kind of 'double entry bookkeeping' for the parser. Without a closing marker, Python's parser has no way to catch errors in leading spaces.

A similar type of error results from C's syntax, which was unfortunately adopted in PHP - in allowing action inside a conditional "if ($foo = 1 + $bar)", the poor parser has no way to know if one really means 'compare' or 'assign'. This is the cause of innumerable bugs in both languages. This could be fixed by requiring assignments inside a conditional to be surrounded by block markers: "if ({$foo = 1 + $bar})".

But I like all 'scripted' languages better for my purposes (entirely applications, no device drivers or kernel work) than C and other 2nd generation languages. I've had exactly one segfault working with PHP, in nearly 20 years.

Re:PHP 6.0 without the stupid? (2)

countach74 (2484150) | about a year ago | (#44071061)

Yeah no kidding. Another big gripe of mine is how most of the things that you'd like to try/catch doesn't throw an exception, but some sort of "notice" or "warning", which you cannot respond to. I've managed to work around this by implementing custom error handlers, but that brings its own problems when other peoples' code expects the default behavior. What's worse is the stuff that throws warnings/notices are things that are very basic: accessing an array element that doesn't exist, opening a file without proper permissions (or doesn't exist), etc. Argh, the whole language is garbage and the community that generally uses it only adds to the problem. But alas, I am forced to work in it.

Note: To those who haven't yet ventured out beyond PHP for the web, you will likely be pleasantly surprised how much more productive you can be in a sane language.

Re:PHP 6.0 without the stupid? (0)

Anonymous Coward | about a year ago | (#44071319)

I may be alone in this, but I prefer named parameters anyway. Having a fixed parameter order is so 1960s.

Re:PHP 6.0 without the stupid? (0)

Anonymous Coward | about a year ago | (#44071495)

You can redefine the functions w/ your own.

Re:PHP 6.0 without the stupid? (-1, Flamebait)

Anonymous Coward | about a year ago | (#44070045)

PHP without stupid?

Doesn't exist.

Re:PHP 6.0 without the stupid? (2, Funny)

Anonymous Coward | about a year ago | (#44070161)

That would be Perl.

Re:PHP 6.0 without the stupid? (0)

Anonymous Coward | about a year ago | (#44070391)

Spoken like a true PHP developer.

Perl too complex :(

Re:PHP 6.0 without the stupid? (1)

Anonymous Coward | about a year ago | (#44070567)

That would be Perl.

True, but it's more accurate to say it trades the stupid for insanity.

Glorious, glorious insanity.

Re:PHP 6.0 without the stupid? (5, Funny)

squiggleslash (241428) | about a year ago | (#44070199)

what_have youGot AGAINST $_THEWAY PHP works($dummy, WORKS_TODAY)? I think it's==great, wait, sorry I mean "I think it's===great." - I accidentally passed in null and that last condition gave me a bunch of false positives.

I'm hoping PHP6 will finally give programmers the ==== and ===== operators we've been waiting for.

Re:PHP 6.0 without the stupid? (4, Informative)

i_ate_god (899684) | about a year ago | (#44070319)

== and === are common in dynamically typed languages

assert 1 == true //works
assert 0 == false //works
assert 1 === true // fails
assert 0 === false // fails

Re:PHP 6.0 without the stupid? (4, Insightful)

kbolino (920292) | about a year ago | (#44070453)

Indeed, but the problem is type coercion and not dynamic typing. You can have a dynamically typed language that does not coerce unlike types to make life "easier".

Re:PHP 6.0 without the stupid? (0)

Anonymous Coward | about a year ago | (#44070909)

But the whole point of dynamic typing is so the coder can shovel together bunches of crap without worrying about what exactly what kind of crap it is. If you require explicit type coercion, you break the shovel.

Re:PHP 6.0 without the stupid? (4, Insightful)

squiggleslash (241428) | about a year ago | (#44071059)

While that's true, the complaint isn't that PHP has a dynamic typing system and has some operators that reflect that, it's that the coercion and comparison rules are... not exactly easy to predict. Not to mention the fact === works the way you'd expect == to work, with == performing non-intuitive coercion to try to find a way to make different things the same.

assert(""==false);
assert(0==false);
assert("0"==false);
assert(null==false);

All of these will succeed.

* Intuitively to a non-PHP programmer, only the second one should.
* A PHP programmer with experience will, on the other hand, note that given "echo 1==2" products no output, only the first should be guaranteed to succeed with the second one maybe kinda succeeding.

The others? Dubious at best. The third should always fail, because "0" != "false" and "0" != "" (but PHP is doing the wrong coercion so it instead converts the string to a boolean rather than vice-versa), the fourth treats null in a way that almost makes SQL look logical.

Ironically, your observation makes my joke more accurate than originally intended. Given the behavior of == is not what's needed in a dynamically typed, softly typed, language, and === provides only one of the legitimate comparison operators necessary for such a language, we do, actually, need an ==== operator in PHP. Scary, huh?

Re:PHP 6.0 without the stupid? (1)

pinkeen (1804300) | about a year ago | (#44071679)

You forgot about this:
assert("hello" == 0); will succeed, but
assert("1" == 0); and assert("1hello" == 0); will fail.

Starting to see a pattern here?

Re:PHP 6.0 without the stupid? (2)

squiggleslash (241428) | about a year ago | (#44071951)

Did some experimenting after that and I just found a great one:

assert("false"==true);

Yes, it passes.

Re:PHP 6.0 without the stupid? (1)

magic maverick (2615475) | about a year ago | (#44071959)

It's a language designed for the web. When you submit a form, everything is a string (or a file), there are no ints or floats. So, the language has to work around this issue, and being loose-typed, and having two comparison operators that work they way they do, is part of what makes PHP easy to use for the web.

Cheers.

Re:PHP 6.0 without the stupid? (0)

larry bagina (561269) | about a year ago | (#44070349)

I'm waiting for the 8=mm==D~~~ operator.

Re:PHP 6.0 without the stupid? (0)

Anonymous Coward | about a year ago | (#44070399)

Once your voice starts to change, Little Larry, the operator will make itself apparent.

Re:PHP 6.0 without the stupid? (0)

Anonymous Coward | about a year ago | (#44070745)

Dude, just use wank(). It's in the API.

Re:PHP 6.0 without the stupid? (1)

TheSpoom (715771) | about a year ago | (#44070495)

Honestly I find == good enough for normal usage in PHP. Javascript is another matter.

Re:PHP 6.0 without the stupid? (1)

Samantha Wright (1324923) | about a year ago | (#44070699)

So you've never searched a string for a token?

Re:PHP 6.0 without the stupid? (1)

TheSpoom (715771) | about a year ago | (#44071311)

strpos and friends are one of a few exceptions, to which developers are prominently alerted in the documentation.

Re:PHP 6.0 without the stupid? (3)

Megane (129182) | about a year ago | (#44070209)

A PHP that isn't a fractal of bad design? [veekun.com] Unpossible.

I can’t even say what’s wrong with PHP, because— okay. Imagine you have uh, a toolbox. A set of tools. Looks okay, standard stuff in there. You pull out a screwdriver, and you see it’s one of those weird tri-headed things. Okay, well, that’s not very useful to you, but you guess it comes in handy sometimes. You pull out the hammer, but to your dismay, it has the claw part on both sides. Still serviceable though, I mean, you can hit nails with the middle of the head holding it sideways.

Re:PHP 6.0 without the stupid? (5, Insightful)

gmack (197796) | about a year ago | (#44070301)

Because then some people would have to stop updating? The place I work has code dating back 10 or 11 years and the programmers already have to go through the code each update to see what got dropped and even then there will be demands for the upgrade to be rolled back or "delayed" (moved to a point in the future that never happens because they never have time for it).

It's not just in house stuff that doesn't update either, Check out large Open source projects and see how many of them generate warnings related to deprecated functions.

If you want a language that has no cruft there are languages you can switch to but not many people use them for the reasons stated a above.

Re:PHP 6.0 without the stupid? (1)

ccguy (1116865) | about a year ago | (#44070373)

I'm still waiting for a PHP 6.0 that's an actual rewrite without all the stupid.

Here you are (just run on shell):

tar cvfz php-6.0.0-stupidless.tar --files-from /dev/null

You're welcome.

Re:PHP 6.0 without the stupid? (1)

greg1104 (461138) | about a year ago | (#44070849)

Perl had a good sized install base and a healthy community, and then they tried this with Perl 6.0. Can't imagine it would go any better for PHP.

Re:PHP 6.0 without the stupid? (2, Interesting)

Anonymous Coward | about a year ago | (#44070965)

I'm still waiting for a PHP 6.0 that's an actual rewrite without all the stupid.

And I'm still waiting for all the PHP haters to fork it and create a new version and "do it right." The language is open source, you know.

Evidently none of the self-proclaimed "experts" in programming language design is willing to fix PHP.

Re:PHP 6.0 without the stupid? (0)

Anonymous Coward | about a year ago | (#44071353)

Why should they polish a turd, when there's plenty of non-turds available?

Re:PHP 6.0 without the stupid? (0)

Anonymous Coward | about a year ago | (#44071685)

Because none of them are even close to replacing the turd? What good are alternatives when your boss gives you no choice?

Beware, though... just creating an improved version of something is no guarantee that people will use it. See Ido [wikipedia.org] for a classic example of splitterism.

Re:PHP 6.0 without the stupid? (1)

gmuslera (3436) | about a year ago | (#44071069)

The problem is the "small" amount of legacy code. Even with the big amount of deprecated features, a lot of unconsistent (to be generous) things is still there. And if there is not a smooth transition, will be hard that a mass migration happens. Even if the goal is to get a good, consistent language, with good object orientation for version 6, think how much time is taking for Perl 6.

Bugs & Maintainers (4, Informative)

TheNinjaroach (878876) | about a year ago | (#44069995)

I participated in beta release testing for 5.5 and I'm frustrated that it still has old bugs [php.net] that cause segfaults that continue to go ignored by the maintainers. I even supplied the patch and submitted a Github pull request, but the maintainers continue to ignore it.

It's no fun having to keep our own custom patchsets for PHP just to keep it running properly.

Re:Bugs & Maintainers (2)

chris200x9 (2591231) | about a year ago | (#44070083)

Fork it?

Re:Bugs & Maintainers (5, Funny)

Grashnak (1003791) | about a year ago | (#44070117)

Fork it?

Shame on you for harming future generations of girl coders! I must tweet your picture and publicly shame you!!!!

Re:Bugs & Maintainers (0)

Anonymous Coward | about a year ago | (#44070121)

You must be doing something incredibly niche or wrong. I've been using PHP for years and have yet to hit a snag where the language just feel apart. Like any language, it has its limits and you must work within those limits for it to function properly.

Re:Bugs & Maintainers (0)

Anonymous Coward | about a year ago | (#44070859)

There's an example of how to reproduce the problem.

How's that sort of usage incredibly niche or wrong?

Slashvertisment (0)

Anonymous Coward | about a year ago | (#44070107)

For Laravel?

Why u no Symfony?

Citation needed (4, Insightful)

benjymouse (756774) | about a year ago | (#44070109)

With the new Laravel PHP framework winning RoRs and CodeIgnitor converts by the thousands

Citation needed. Why does the summary contain this blurb which is not even relevant to the story. Me suspects that the submitter could be an advocate who just ceased on an opportunity to tell slashdot about his favorite PHP framework.

Re:Citation needed (2)

dkleinsc (563838) | about a year ago | (#44070129)

just ceased on an opportunity

I don't think that means what you think it means.

Re:Citation needed (0)

Anonymous Coward | about a year ago | (#44070183)

You wanted to say "siezed".

I like to compare PHP to English: It's spoken by a lot of people but the spelling is horribly irregular.

Re:Citation needed (2)

dkleinsc (563838) | about a year ago | (#44070217)

No, he wanted to say "seized". But I blame Noah Webster: Before he came along, people spelled words any way they dam wel pleezed.

Pretty simple (0)

Anonymous Coward | about a year ago | (#44070343)

It's pretty simple. There are people who learned most of their written language from written word, and there are people who learned most of their written language from spoken word. The person above is the latter.

Re:Citation needed (1)

Anonymous Coward | about a year ago | (#44071093)

> But I blame Noah Webster: Before he came along, people spelled words any way they dam wel pleezed.

That's the epitamy of hoodspa.

Re:Citation needed (0)

Anonymous Coward | about a year ago | (#44071271)

No, he wanted to say "seized". But I blame Noah Webster: Before he came along, people spelled words any way they dam wel pleezed.

Horsepuckey. Dictionaries were being published centuries before Noah Webster.

I suppose you also think Alan Shepard was the first man in space?

Re:Citation needed (0)

Anonymous Coward | about a year ago | (#44070247)

seized. HTH.

(I can't tell whether the post I'm replying to is ironic or whether the remark is sarcastic.)

Re:Citation needed (0)

Anonymous Coward | about a year ago | (#44071741)

"Laravel: RoR for people who wanted an even less well-engineered standard library with their framework's implementation language!"

Seriously - the ORM docs, for instance, look like somebody just took ActiveRecord and shit PHP punctation marks all over it.

Not even trying to be statically safe (4, Interesting)

Anonymous Coward | about a year ago | (#44070135)

You only need a peek to see this Laravel dubbed "PHP renaissance" does not even try to be statically safe. It's littered with pitfalls like writing your validators with strings, such as: "array('name' => array('required', 'min:5')), ...".

(It is possible to write statically typed validators, with clean syntax (depending on language) and you end up not loosing stuff like auto-completion, semantic checking by IDE etc. See for instance latest Scala PlayFramework and it's JSON validation, it is relatively easy to use, and syntax is surprisingly succinct taken the fact it's extremely type-safe.)

Re:Not even trying to be statically safe (0)

Anonymous Coward | about a year ago | (#44070205)

Don't waste your breath. Anyone that still prefers dynamic typing should be summarily ignored.

PHP renaisaunce (1, Offtopic)

Chrisq (894406) | about a year ago | (#44070145)

I guess that's when everyone gathers around dressed in renaissance costumes, drink warm beer, speak in mock-British accents, and reminisce on the times when knights were bold and PHP was cool

Re:PHP renaisaunce (1)

wonkey_monkey (2592601) | about a year ago | (#44070449)

Here, esquilax.

Re:PHP renaisaunce (1)

mjwalshe (1680392) | about a year ago | (#44071631)

no that was when we Perl developers described PHP as Perl for COBOL programmers who had difficulty making the switch to perl

Really? (4, Insightful)

LizardKing (5245) | about a year ago | (#44070153)

With the new Laravel PHP framework winning RoRs and CodeIgnitor converts by the thousands

Citation please.

Re:Really? (2, Interesting)

Anonymous Coward | about a year ago | (#44070207)

Yeah, I'd like a citation, too. I'm a RoR developer and had never heard of Laravel. Looking at the syntax in the Laravel quick-start brings back bad memories, though. PHP just isn't very good at DSLs.

Re:Really? (1)

jones_supa (887896) | about a year ago | (#44070345)

Citation please.

"With self-discipline most anything is possible." ~ Theodore Roosevelt

*ducks*

Re:Really? (4, Funny)

Chris Mattern (191822) | about a year ago | (#44070375)

Citation please.

Okay. How's this? [wikimedia.org]

Re:Really? (1)

columbus (444812) | about a year ago | (#44071857)

Damn, I wish I had mod points. That was good for a chuckle. Thanks.

Insanity (0)

Anonymous Coward | about a year ago | (#44070303)

Why the hell would anyone choose so insane technology for new applications written from scratch? We should let PHP die in peace.

What PHP needs now... (3, Interesting)

MikeRT (947531) | about a year ago | (#44070393)

Is for someone to write a new standard API that can sit in parallel to their old one that gives us sanity like string manipulation functions with real names and consistent parameters. You know stuff like:

$x = string::indexOf($source, $needle);

and

$x = string::replaceAll($source, $needle, $regularExpression);

Re:What PHP needs now... (0)

Anonymous Coward | about a year ago | (#44071413)

So what you're proposing is... yet another framework?

Re:What PHP needs now... (2)

Parker Lewis (999165) | about a year ago | (#44071453)

How about the obvious on OO?

$x = $source->indexOf($needle);

and

$x = $source->replaceAll($needle, $regularExpression);

?

Re:What PHP needs now... (0)

Anonymous Coward | about a year ago | (#44071549)

You can create your own functions in PHP.

Yeah, I'm sure (4, Insightful)

Trailer Trash (60756) | about a year ago | (#44070421)

With the new Laravel PHP framework winning RoRs and CodeIgnitor converts by the thousands...

CodeIgnitor? Maybe. RoR? Um, no. Or, perhaps, in your dreams.

As an RoR developer who left PHP years ago I assure you - we aren't just waiting for a really good PHP framework that's an RoR knockoff. Part of the greatness of Rails is Ruby, and looking through the Laravel docs just confirms that. It looks like Laravel is about as nice as you can get on PHP, but ultimately it's still PHP underneath (and on top).

Rails is a meta-language built on top of Ruby. Just can't do that in PHP.

And that's not even getting into the ugliness of PHP's cruft that's been built up over the years.

Re:Yeah, I'm sure (2)

ducomputergeek (595742) | about a year ago | (#44071885)

There are RoR developers left? Seriously? I've not heard much about RoR after the $500k I made circa 2009/2010 coming in and cleaning up the mess on a few projects. Ironically enough it often involved rewriting projects mostly in PHP, but others in C# or Java, and even sometimes even with Perl. Granted most of the problem was non-developers reading how RoR does all this stuff automagically for them, they don't have to think or know, and turning out a blog in 15 minutes some how makes them a "developer".

Truth be told, I still prefer Perl for a great many web-based tasks. Granted I spent the first 6 years of my career as a system admin who could code enough to make it work. I still use Perl today, especially for a lot of unsexy backend tasks. Hell I have scripts written circa 2001 that still work. Granted a lot have to do with log parsing, backups, *iux base load monitoring and other unsexy stuff, but they still work.

I remember starting a project circa 2007. I was the oldest of the developers, really I was the server/networking guru of the team, there in my late twenties, the others were "hotshots" under the age of 25. They spent a week debating which PHP framework they should use to build an API. I got pissed, went home that weekend, and wrote version 1 in Perl on a Sunday Afternoon, granted with lots of help from CPAN. Long story short, two weeks later we turned out a working API in Perl. In 2009 we added JSON support in a couple days and as far as I know that API is still in production, still being used to process 100,000 transactions an hour.

A public thank you to the PHP team (5, Insightful)

Boss, Pointy Haired (537010) | about a year ago | (#44070423)

Yes it has its flaws, yes you sometimes don't know whether you're looking for needles in haystacks or haystacks in needles, but it's not like they're not aware of that, and it's not really a big deal either in these days of syntax and function aware editors and instant online reference, and it has provided me and i'm sure many thousands of other people with a career not just in contract coding but also in being used almost exclusively on our own websites.

Thanks guys!

Re:A public thank you to the PHP team (0)

Anonymous Coward | about a year ago | (#44070529)

Agreed. I've been using PHP on and off for over ten years and I'm quite happy with the language. It makes a lot of tasks easy and the syntax is close enough to C/C++ that I don't have to re-learn the style when I switch back and forth. Really happy to see the project continuing to do good things.

Re:A public thank you to the PHP team (0)

VGPowerlord (621254) | about a year ago | (#44070591)

It doesn't surprise me that Dilbert's office uses PHP.

Re:A public thank you to the PHP team (-1)

Anonymous Coward | about a year ago | (#44071087)

Hear hear! PHP is a great language for what it was designed to do: running websites. Sure it has its flaws but most languages do, and people who dislike PHP either don't know how to use it properly or don't have the right tools.

Re:A public thank you to the PHP team (0)

Anonymous Coward | about a year ago | (#44071641)

...as opposed to the people think it's a "great language", who are usually tools themselves...

Why not make dollar signs optional? (-1)

Anonymous Coward | about a year ago | (#44070435)

I've never understood why they can't make the $ optional for variables that are used outside of strings.

All those $s are like 1000s of little speed bumps everywhere, slowing me down as I try to read the code. They're infuriating because I know that a vast majority of them are not needed, as proven by many other languages.

Re:Why not make dollar signs optional? (1, Flamebait)

drunkennewfiemidget (712572) | about a year ago | (#44070525)

All of the complete and utter shit that is the language called PHP and that is your argument against it?

Yeesh.

Re:Why not make dollar signs optional? (0)

Anonymous Coward | about a year ago | (#44071697)

All of the complete and utter shit that is the language called PHP and that is your argument against it?

To be honest, that's the one thing that has the most frequent impact on me -- yes.

There's a lot of other things wrong with the language, but I would have to say that the ever-present unnecessary noise of the dollar signs is the one that impacts me on a continual basis.

Re:Why not make dollar signs optional? (2)

TheSpoom (715771) | about a year ago | (#44070537)

Yes, why NOT rewrite the entire language tokenizer for vague reasons of potentially avoiding a single keystroke?

Re:Why not make dollar signs optional? (0)

Anonymous Coward | about a year ago | (#44071791)

Yes, why NOT rewrite the entire language tokenizer for vague reasons of potentially avoiding a single keystroke?

It's not a rewrite of the entire language. I would be a relatively small, backward-compatible change. (The $ would still be required inside of a string.)

And it's avoiding a single keystroke OVER AND OVER AND OVER on every single variable. I find PHP to significantly more tiring to type in because of it.

And it's solving a readability problem by eliminating continual, unnecessary noise. Very few other language require dollar signs -- there's a reason for that.

Re:Why not make dollar signs optional? (1)

Great Big Bird (1751616) | about a year ago | (#44070673)

You know a vast majority of them are not needed? Have you ever written a parser? I could see these things helping a lexer a great deal.

Re:Why not make dollar signs optional? (1)

akanouras (1431981) | about a year ago | (#44070877)

The CPython folks constantly moan about parser complexity, and even they managed it.

Re:Why not make dollar signs optional? (1)

putaro (235078) | about a year ago | (#44070901)

Yah, they were really great in BASIC!

Re:Why not make dollar signs optional? (0)

Anonymous Coward | about a year ago | (#44071483)

There are a lot of languages with similar syntax that handle variables without special markers quite well. It's not like writing parsers is some arcane craft, it's a long ago researched topic in CS and covered nicely in first chapters of any compiler construction textbook.

Well, it may be an arcane craft for PHP authors - I mean, function_returning_an_object()[index] was a parser error until not so long ago and you had to do temp = function_etc(); ... temp[index];

Tells a lot about PHP "design", just like it getting try...finally in this version almost 20 years after first version (and with team getting bugged about it for most of this time).

Re:Why not make dollar signs optional? (0)

Anonymous Coward | about a year ago | (#44071911)

You know a vast majority of them are not needed? Have you ever written a parser?

Yes, about 8 of them over my career. (I used to work on compilers, specializing in parsers.) I've analyzed this enough to know that the dollar signs are unneeded, if used outside of strings. The parsing solutions would be the standard ones used in other languages -- for example, if the identifier is followed by a "(" then it's a function call. The symbol table knows the difference between a constant and a variable, so the protection of constants can still be supported. Etc., etc.

Laravel, more of the same... (1)

Aethedor (973725) | about a year ago | (#44070585)

Taken a quick view at Laravel, it's again a framework like one in a dozen.

All such PHP projects can be divided into to groups: frameworks and CMS-es. A big problem with all those PHP frameworks is that you have to write stuff like user administration, authentication, static pages from the database, etc yourself. In my opinion, in many cases the MVC architecture is not implemented in a clean way and it's often too complex to translate an URL to an actual file on disk.

A big problem with most CMS-es (like Wordpress, Joomla and TYPO3) is that it's one big chunk of code. There is no clear separate framework layer. It's quite a torture to add or change functionality by writing code. And don't even get me started about security!

That's why I wrote the Banshee PHP framework [banshee-php.org] . Clear MVC implementation, easy routing, strong focus on security and clear separation between framework layer and CMS. Clear the controller, model, view and css directory and what's left is the framework. Although I call it a framework, it's more of a framework / CMS hybrid.

It is not my intention to spam about my framework, but I realize this post can be seen as such. Sorry for that. I only want PHP developers to know there is more than those minimalist frameworks or bloated CMS-es.

yuo fai7 it (-1)

Anonymous Coward | about a year ago | (#44070621)

then disaapeared [goat.cx]

Guilty pleasures (5, Interesting)

EmperorOfCanada (1332175) | about a year ago | (#44070645)

I have two guilty pleasures: Watching the show COPS, and programming in PHP.

I dream about getting away from PHP and occasionally dip my toes in other waters (Python, Java, and even C++) but always come back to PHP. I won't go to Ruby for as many websites start with Ruby and then abandon it for many other languages. People blah blah about MVC but often what I am doing is just too damn simple to need such added complexity. I might need a program that I occasionally run to view a list of spam flagged submissions; it is done in 10 minutes in PHP. I don't use any frameworks and am diligent enough to keep things running through prepared statements and whatnot. With opcode caching and memory caching of data PHP is very very fast.

It is not so much that PHP is the best at anything it is that it isn't really terrible at anything I care about. Almost every other language is terrible at at least one thing that I do care about.

Personally I think that PHP gets its bad rap because it is a very easy transition from HTML. So you have basically non programmers starting to sprinkle PHP into their HTML and oddly enough an untrained programmer's first efforts end up being crap. Then because PHP covers all the web server basics these programmers potentially never venture beyond PHP and there is nothing better for making a bad programmer than a one language programmer. (Not someone who primarily programs in one language but one who only ever learned the one language) So these same programmers keep expanding the scope of their terrible code.

So if anyone can suggest a programming language to replace PHP I would love to know (and all JVM languages are off my list).

Re:Guilty pleasures (0)

Anonymous Coward | about a year ago | (#44070843)

>Personally I think that PHP gets its bad rap because it is a very easy transition from HTML.

No. PHP gets a well deserved rap for being fucking retarded.

array_map($arr, $func)
array_walk($func, $arr)

Or maybe I have it backwards? Don't forget such great functions as escape_string_no_we_mean_it_this_time_why_are_you_laughing_v2

>and all JVM languages are off my list
Well, I can see why you would have trouble with ruby, python, java, or c++. Perhaps you should leave coding to people who aren't idiots?

If it's a connection method, it's the real deal (1)

tepples (727027) | about a year ago | (#44071489)

escape_string_no_we_mean_it_this_time_why_are_you_laughing_v2

My rule of thumb is that if the escape function is a method of a database connection object, such as the $conn->escape_string() of MySQLi, it's the real deal. But most of the time, I just use prepared statements, reserving manual escaping for things like the right side of operator IN [pineight.com] that would need a large, variable number of placeholders.

Re:Guilty pleasures (5, Informative)

Samantha Wright (1324923) | about a year ago | (#44070865)

There are a lot of very real technical reasons why people don't like PHP. The syntax and naming of its function library is inconsistent, the type coercion is irregular, and it's inconsistent about warnings vs. errors—it tends to keep executing code even when it shouldn't, potentially leading to unwanted behaviour during development if a variable isn't set or something. Reddit has a fairly active board devoted to the various problems [reddit.com] that can occur, not all of them avoidable.

One of the most peculiar details in all of this is that PHP's original author (and, I think, but don't quote me on this, a portion of the development staff) considers himself a non-programmer; that PHP was just thrown together to simplify work. That would be okay, but it's led to a lot of security holes, bugs, and irreversible bad choices over the years, like having to use === in string parsing because false is returned by strpos() if it doesn't find anything (and false == 0). No other language requires this particular quirk.

I don't blame you for not liking Ruby. While it's a much cleaner language, it's got some very peculiar syntactical features that make a lot of people scratch their heads—most notably, there are circumstances under which return doesn't work normally [stackoverflow.com] , which can be very frustrating. However, there are some very creative uses of familiar syntax that, for example, make strings really easy to work with; haystack['needle'] = 'thread' is the same as $haystack = str_replace('needle', 'thread', $haystack) in PHP. I haven't used it personally, but I think the major reason Ruby projects get abandoned so much is because the people writing code in it are not experienced programmers.

Running down the list a little and hopping over JVM stuff, the other decent web languages you may want to consider are Perl and Python. Both have extremely well-developed libraries and are good with strings, so it's mostly just a question of picking "esoteric and terse" vs. "newbie-friendly and easily maintained." Decent JVM languages include JWT, Scala, and Clojure (with noir [chris-granger.com] ; check out that sexy beast), although JWT is probably overkill for anything smaller than Gmail.

Re:Guilty pleasures (1)

garyebickford (222422) | about a year ago | (#44071589)

I just replied elsewhere about my recent experience with Perl - Perl makes PHP look like a paragon of consistency and well-designed code. But I do like Perl regular expressions - as implemented in PHP! :D

Python's use of a single, invisible marker for blocks - the indent - is a mistake that causes a lot of bugs. Blocks need different begin and end markers to allow the parser to know what goes where.

Re:Guilty pleasures (2)

Bigbutt (65939) | about a year ago | (#44071655)

Actually I'm in the same boat. PHP works fine for all the little things I do and even a few big things. I've tried poking at Ruby a little and wasn't interested enough to pursue it. While I've done C programming in the past (80's and 90's), and perl (90's and 00's), most of my more recent work is scripting in general; shell scripting, some perl stuff, and loads of PHP+MySQL+JavaScript.

I have asked the same question in past PHP rant threads but with no response.

[John]

The PHP Renaissance is here... (0)

Anonymous Coward | about a year ago | (#44071727)

The PHP Renaissance is here and it looks just like PHP from five years ago. The router in Laravel interacts directly with the models for setting up request vars? Doesn't anyone else think that's idiotic? Shouldn't the router focus predominantly on routing? Shouldn't you drive state into the controller? Or does Laravel just follow the typical PHP approach to making everything in your app fat for the sake of keeping the developers dumb?

If this is a PHP renaissance I'll keep using Ruby, or pretty much anything else.

Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>