Slashdot Mirror


PHP 5.5.0 Released

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.

219 comments

  1. PHP 6.0 without the stupid? by Anonymous Coward · · Score: 5, Insightful

    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.

    1. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 5, Informative

      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.

    2. Re:PHP 6.0 without the stupid? by Krojack · · Score: 1, Redundant

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

    3. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 2, Funny

      That would be Perl.

    4. Re:PHP 6.0 without the stupid? by squiggleslash · · Score: 5, Funny

      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.

      --
      You are not alone. This is not normal. None of this is normal.
    5. Re:PHP 6.0 without the stupid? by Megane · · Score: 3
      A PHP that isn't a fractal of bad design? 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.

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
    6. Re:PHP 6.0 without the stupid? by gmack · · Score: 5, Insightful

      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.

    7. Re:PHP 6.0 without the stupid? by gbjbaanb · · Score: 4, Funny

      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 :-)

    8. Re:PHP 6.0 without the stupid? by i_ate_god · · Score: 4, Informative

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

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

      --
      I'm god, but it's a bit of a drag really...
    9. Re:PHP 6.0 without the stupid? by larry+bagina · · Score: 0

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

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    10. Re:PHP 6.0 without the stupid? by ccguy · · Score: 1

      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.

    11. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

      Spoken like a true PHP developer.

      Perl too complex :(

    12. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

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

    13. Re:PHP 6.0 without the stupid? by kbolino · · Score: 4, Insightful

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

    14. Re:PHP 6.0 without the stupid? by TheSpoom · · Score: 1

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

      --
      It's better to vote for what you want and not get it than to vote for what you don't want and get it.
      - E. Debs
    15. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 1

      That would be Perl.

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

      Glorious, glorious insanity.

    16. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 1

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

    17. Re:PHP 6.0 without the stupid? by Samantha+Wright · · Score: 4, Informative
      --
      Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
    18. Re: PHP 6.0 without the stupid? by thetoadwarrior · · Score: 4, Insightful

      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.

    19. Re:PHP 6.0 without the stupid? by Samantha+Wright · · Score: 1

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

      --
      Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
    20. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

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

    21. Re: PHP 6.0 without the stupid? by gorzek · · Score: 2

      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.

    22. Re: PHP 6.0 without the stupid? by Bert64 · · Score: 4, Insightful

      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.

      --
      http://spamdecoy.net - free throwaway anonymous email - avoid spam!
    23. Re:PHP 6.0 without the stupid? by greg1104 · · Score: 1

      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.

    24. Re: PHP 6.0 without the stupid? by Dracos · · Score: 2, Insightful

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

    25. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

      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.

    26. Re: PHP 6.0 without the stupid? by jones_supa · · Score: 0

      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 included in the documentation.

    27. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 2, Interesting

      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.

    28. Re: PHP 6.0 without the stupid? by thetoadwarrior · · Score: 0

      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.

    29. Re:PHP 6.0 without the stupid? by squiggleslash · · Score: 4, Insightful

      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?

      --
      You are not alone. This is not normal. None of this is normal.
    30. Re:PHP 6.0 without the stupid? by countach74 · · Score: 2

      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.

    31. Re:PHP 6.0 without the stupid? by gmuslera · · Score: 1

      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.

    32. Re:PHP 6.0 without the stupid? by TheSpoom · · Score: 1

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

      --
      It's better to vote for what you want and not get it than to vote for what you don't want and get it.
      - E. Debs
    33. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

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

    34. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

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

    35. Re:PHP 6.0 without the stupid? by ackthpt · · Score: 1

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

      --

      A feeling of having made the same mistake before: Deja Foobar
    36. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

      You can redefine the functions w/ your own.

    37. Re: PHP 6.0 without the stupid? by garyebickford · · Score: 4, Informative

      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:

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

      --
      It's easier to be a result of the past, but more fun to be a cause of the future! http://www.spacefinancegroup.com/
    38. Re:PHP 6.0 without the stupid? by pinkeen · · Score: 1

      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?

    39. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

      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 for a classic example of splitterism.

    40. Re:PHP 6.0 without the stupid? by squiggleslash · · Score: 2

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

      assert("false"==true);

      Yes, it passes.

      --
      You are not alone. This is not normal. None of this is normal.
    41. Re:PHP 6.0 without the stupid? by magic+maverick+ · · Score: 1

      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.

      --
      HELP MY ACCOUNT HAS BEEN HACKED BY AN ILLIBERAL ART STUDENT SET TO DESTROY THE INTERWEBZ!
    42. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

      Don't forget

      assert("string" == 0);
      assert(0 == false);
      assert(false != "string");
       
      assert(true != "0");
      assert(true == "00");
      assert(0 == "00");
      assert(0 != true);

      That's right, equality is not transitive.

      Or how about this?

      assert("1e1" == "10");
      assert((int) "1e1" == 1);

      PHPs weak typing is such a giant mess, I'm not even sure that equality is symmetric.

    43. Re:PHP 6.0 without the stupid? by squiggleslash · · Score: 1

      You're missing the point I was making. I wasn't criticizing it for doing coercion, I was criticizing it for doing the wrong coercion, with the result that the "==" operator's behavior is difficult to predict.

      If you read the GP, you'll see I was responding to that point.

      --
      You are not alone. This is not normal. None of this is normal.
    44. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

      Better than that, check out - all of these are still true in 5.5:

      "0x2ahello" == 42
      "0x2a" == "42"
      "0x2ahello" != "42hello"
      "042" == "42"
      "042" != 042
      "042" == 0529998008135

    45. Re:PHP 6.0 without the stupid? by pinkeen · · Score: 1

      "But it's documented" ®

    46. Re: PHP 6.0 without the stupid? by PCM2 · · Score: 1

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

      I don't understand. I'm not a parser, but to my eye that means "assign." If you wanted to compare, you would do "if ($foo == 1 + $bar)", no?

      --
      Breakfast served all day!
    47. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

      Time to invent "use strict". I heard someone tried something similar with another fubar of a language recently.

    48. Re: PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

      Scope by indentation. How retarded is that?

    49. Re: PHP 6.0 without the stupid? by garyebickford · · Score: 1

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

      I don't understand. I'm not a parser, but to my eye that means "assign." If you wanted to compare, you would do "if ($foo == 1 + $bar)", no?

      Ah, but in C, and thereby in several other languages that have adopted C syntax, the result of the assignment becomes the value of the conditional, so "if ($foo=1+$bar)" means, 'add one to $bar, assign it to $foo, then evaluate the conditional based on the value of $foo'. Maybe that's what I meant to write, but maybe I just mistyped. So thus arises an ambiguity - did we mean assign and then evaluate, or just compare? And thus bugs are born. It is quite easy to accidentally put '=' when we mean '=='. But the parser does not know whether we goofed.

      This is why I would like to see the syntax changed to require any assignment inside a conditional to be enclosed in a block. This removes any ambiguity - "if ($foo=1+$bar)" would be a syntax error. For assignment we would write "if ({$foo=1+$bar})", and for comparison we would write "if ($foo==1+$bar)".

      --
      It's easier to be a result of the past, but more fun to be a cause of the future! http://www.spacefinancegroup.com/
    50. Re:PHP 6.0 without the stupid? by magic+maverick+ · · Score: 1

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

      When a form is submitted, there is no bare 0, there is only "0", so PHP treating "0" as if it where 0 in certain cases is certainly understandable. It may not be obvious or intuitive to you, but there is certainly a good reason for it.

      See also: PHP type comparison tables

      A comment on that page says:

      just remember the following are always FALSE:
      null, false, "", 0, "0", array()

      Hardly complicated.

      --
      HELP MY ACCOUNT HAS BEEN HACKED BY AN ILLIBERAL ART STUDENT SET TO DESTROY THE INTERWEBZ!
    51. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

      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.

      You may disable error reporting if you don't care about your variables/arrays and can't be bothered to check the file permissions before accessing it.

      All my code is E_STRICT compatible and I expect the same from my employees. No exceptions!

    52. Re: PHP 6.0 without the stupid? by OhSoLaMeow · · Score: 1

      Scope by indentation. How retarded is that?

      You haven't played with TCL, have you?

      --
      They can take my LifeAlert pendant when they pry it from my cold dead fingers.
    53. Re:PHP 6.0 without the stupid? by squiggleslash · · Score: 1

      but there is certainly a good reason for it.

      No, there isn't. There's a bad reason for it. It would be a good reason only if you would expect all data comparisons to be with form elements, and for those form elements to be that limited range of textual responses. Notably "false" and "off" are not false, according to ==. Remember that == is not a "Use this for some form fields when you're doing comparisons" operator, it's the one people are expected to use by default, with "===" being added to the language long after PHP became popular.

      I'd also invite you to take a look at the other examples that people are responding to the posts with. This isn't confined to the examples I gave, those were just some obvious examples from the top of my head.

      --
      You are not alone. This is not normal. None of this is normal.
    54. Re:PHP 6.0 without the stupid? by mypalmike · · Score: 1

      "Hardly complicated."

      s/Hardly/It's/

      --
      There are 0x40000000 types of people: those who understand 32-bit IEEE 754 floating point, and those who don't.
    55. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

      You may disable error reporting if you don't care about your variables/arrays and can't be bothered to check the file permissions before accessing it.

      You don't check the file permissions, you try to open the file and handle any error that occurs, except that PHP makes that unnecessarily hard. If you try to check the file permissions yourself, you create a race condition, and you don't have any protection at all against non-permission-related errors (and even if you try to check for other kinds, you'll never be able to anticipate every possible error that could occur on every OS your code might run on).

    56. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

      What good are alternatives when your boss gives you no choice?

      If your boss is enough of an idiot to insist on PHP, what makes you think that (s)he would accept an incompatible fork of PHP any more than an entirely different language?

    57. Re:PHP 6.0 without the stupid? by wisnoskij · · Score: 1

      is_null and isset for example. I hate these functions. From what I understand someone thought it was a good idea to copy some C function names, which I think just makes the inconsistency worse.

      --
      Troll is not a replacement for I disagree.
    58. Re:PHP 6.0 without the stupid? by countach74 · · Score: 1

      I don't want to disable error reporting. I want to respond to errors and not get stuck writing a bunch of garbage if statements just to see if every condition I can think of is covered before accessing a file or an item in an array. It's not that I "don't care about my variables/arrays", it's that I would appreciate them behing handled properly.

      In Python, I can do (sort of, can't format correctly here):

      try:
      f = open('/path/to/file', 'r')
      except IOError, e:
      # Oh no, I can't do that... handle accordingly
      else:
      # It worked.

      In PHP, to accomplish the same thing, I have to do something more along the lines of:

      if (is_file('/path/to/file') && is_readable('/path/to/file') && any_other_conditions_that_must_be_checked) {
      // It worked
      }
      else {
      // It didn't work
      }

      File access always seems to bring with it unforeseen errors and as such I will not try to cover all of them here, as they are... unforeseen. Oh, also, Python (and I'm sure other languages as well) provides an excellent method of safely handling file access (or other things that *must* clean up, regardless of errors) via the with statement. PHP, of course, can't be bothered to implement things that are actually useful syntactically. All the PHP devs can ever seem to do is create more functions, all of which lack any standardization in naming or parameters, as discussed above. In short, programming anything beyond a very simple site in PHP is something that only two types of people find enjoyable: masochists and those ignorant of what a real language is like.

    59. Re:PHP 6.0 without the stupid? by pmontra · · Score: 2

      I read the Laravel page and it's great to see how closely they managed to mimic Ruby and Rails (I used "and" on purpose). However it also exposes the limits of the language.

      This PHP

      $tasks = User::find(1)->tasks;
      $author = Task::find(5)->user()->username;
      $task = new Task([ title: 'Go to store.' ]);
      User::find(1)->tasks()->insert($task);

      would be this Ruby

      tasks = User.find(1).tasks
      author = Task.find(5).user.username
      task = new Task({title: 'Go to store.'}) # but the {} are idiomatically removed in this case because there are no ambiguities
      User.find(1).tasks.insert(task)

      Count the keyboard hits and shift saved. Think about the signal to noise ratio of the two pieces of code.

      Ruby has its share of oddities but PHP is an easy target for critics. Using $ for variables was a terrible decision, worse than Ruby's @ and @@ for instance and class variables. Using -> to access methods and attributes was a bad trade with the ability to use . for string concatenation. Mandatory () for function call and around if (conditions) are useless as well as the semicolon at the end of lines. Compilers and interpreters can be made smart enough to understand when a statement is complete without forcing the programmer to do part of their job. And think of the mandatory $this->. Argh!

      Yeah, let's hope for a wised up PHP x.0. A first step has been allowing [ ] in place of array( )

    60. Re:PHP 6.0 without the stupid? by pmontra · · Score: 1

      No, it's not. Dynamic typing let's you save a lot of time because when you use one of those languages there is rarely need to explicitly state the type of a variable and everything keeps working just fine. Furthermore, thinking of Ruby, if you try to mix different types without an explicit coercion it reminds you that you are doing a mistake and kills your program. I don't know why but it never happened in production. Only in development mode. It's tests, which one should do anyway, or just that we don't mix different types unless into very specific situations like printing output as String?

      Then after a couple of years you go back to Java and you don't understand why all of a sudden you have to write all those String, int, BigComplexType annotations before variable names. I was raised with them but I discovered that they add very little value. I'm not sure (there must be some theorem to prove or disprove my claim) but a compiler could statically analyze a program without type annotations and tell us if it can run safely, but dynamically generated code need an runtime for doing that.

    61. Re: PHP 6.0 without the stupid? by datavirtue · · Score: 2

      Powershell was created for people who have absolutely no idea what they are doing. Sysadmins. As a developer it looks like fucking Greek to me.

      --
      I object to power without constructive purpose. --Spock
    62. Re: PHP 6.0 without the stupid? by datavirtue · · Score: 1

      Indeed it is extremely simple to pick up and therefor fills a person with joy at the power they have acquired. The joy quickly fades when you realize what you have to go through to build a real application. I'm interested in Laravel.

      --
      I object to power without constructive purpose. --Spock
    63. Re: PHP 6.0 without the stupid? by jones_supa · · Score: 0

      I think it's one of the coolest parts that has seen improvement in Windows lately. It's great that we're getting a better command line to Windows too.

    64. Re: PHP 6.0 without the stupid? by datavirtue · · Score: 1

      Yeah, Python. I got excited about it becasue the web was a-buzz with Python love. Installed it, started playing, about puked, uninstalled it. Fuck the white-space shit. Are brackets really annoying that many people? Is there a reason to break away from C-block formatting?

      --
      I object to power without constructive purpose. --Spock
    65. Re:PHP 6.0 without the stupid? by datavirtue · · Score: 1

      shouldn't that be redefined to fap()? It is shorter, less typing.

      --
      I object to power without constructive purpose. --Spock
    66. Re: PHP 6.0 without the stupid? by t0mislav · · Score: 1

      I totally agree with you. I started with PHP only because it was so easy to start. Tried RoR before PHP, but I lost at the begining. Didn't knew what to install, what now, what then, where am I. Then I give up and wrote first php line.

    67. Re: PHP 6.0 without the stupid? by an_orphan · · Score: 1

      Hate for python whitespace is a sure sign of a superficial appreciation for its tradeoffs. It doesn't say anything bad about the language, it just shows you haven't actually used it for anything and are willing to make egregious statements based on unfamiliarity and ignorance. Why learn a language if it's not a bit unfamiliar in the first place? (disclaimer, haven't used python since 2010)

    68. Re:PHP 6.0 without the stupid? by an_orphan · · Score: 1

      You can redefine the functions w/ your own.

      This is a road fraught with peril, likely because the people that implemented the original functions are the same ones that made crappy language choices that prevent new functions from being used effectively, so it's possible to both paper over issues, conveniently in the short term, and simultaneously creating more issues in the long-term.

    69. Re:PHP 6.0 without the stupid? by jsdcnet · · Score: 1

      You need a better IDE. I use Netbeans and Sublime Text (mostly ST these days) and as soon as I start typing the function name, both editors give me a completion popup with placeholders for the parameters.

      --
      no longer working for cnet
    70. Re:PHP 6.0 without the stupid? by jsdcnet · · Score: 1

      $fp = @fopen('/path/to/file', 'r'); if ($fp) { ... it worked } else { ... it didn't. }

      --
      no longer working for cnet
    71. Re:PHP 6.0 without the stupid? by countach74 · · Score: 1

      Amazing I always forget about @ in PHP. Still, it's not nearly as good a solution as if exceptions were used universally. It's just one more thing you have to "just know" about a very large number of things to be proficient with PHP (does it use exceptions or not?) Not to mention, it makes it makes it that much more cumbersome when you have to catch that yourself and then throw an exception so that it can travel up the chain.

    72. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

      Nothing really removed? O_o
      Check 5.4 changelog.

    73. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

      $fp = @fopen('/path/to/file', 'r');
      if ($fp) { ... it worked
      }
      else { ... it didn't.
      }

      So you've gone from having to individually check for every error condition you can think of (and hope you use the same logic as the OS open call) to not being able to tell what went wrong at all.

    74. Re: PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

      Part of the problem with PHP is that it's designed to be simple to pick up...

      Part..

      Well.. all of the problems with PHP can be explained with that it's supposed to be convenient to generate HTML from.
      PHP, CSS, Javascript.. how many languages can you name that are invented just to deal with the fact that HTML is incredible inept to do what it is supposed to.

    75. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

      There is a vast difference between, "good enough for normal usage" and "never searched a string for a token".

    76. Re:PHP 6.0 without the stupid? by Samantha+Wright · · Score: 1

      You're saying you don't search strings for tokens in normal usage? Now you're weirding me out. What the heck do you plan on doing with PHP?

      --
      Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
    77. Re:PHP 6.0 without the stupid? by Samantha+Wright · · Score: 1

      They could've just gone with -1 as a return value and had no problems; it's not like PHP stops you from doing substr($foo, false)—in fact, it casts false to 0 and returns the whole string.

      But that's just the thing: there are so many documentation-requiring exceptions of various kinds that you can't program without keeping the documentation open. I've written pretty large applications in PHP (including a full interpreter for a scripting language) and there's a true paucity of consistency. No other language has this problem, except perhaps INTERCAL.

      --
      Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
    78. Re:PHP 6.0 without the stupid? by Beeftopia · · Score: 1

      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.

      Cruft is there for a reason.

      What the computer does is complicated. We use the written high level language to generate the instructions that the computer actually executes to "do something." The instructions are what "do something." Someone might stare in puzzlement at why some seemingly irrelevant value is bit-shifted right 8 bits. No reference in the code to it. BUT... there might be some library function that needs it. Or something. A well-worn code base is typically a well-tested and reliable code base.

      I'm not saying one should never re-architect a kludge to modern programming paradigms. However, one must be very judicious in reworking something that's been working well for a long time for a lot of users.

    79. Re: PHP 6.0 without the stupid? by larry+bagina · · Score: 1

      clang and gcc give warnings on = assignment in a conditional unless you double-parenthesis it.

      if ((a = b)) ...

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    80. Re:PHP 6.0 without the stupid? by Spykk · · Score: 1

      Most typed languages consider anything that isn't 0 to be true. Try something similar in C and you will get the same result.

    81. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

      try:
      f = open('/path/to/file', 'r')
      except IOError, e:
      # Oh no, I can't do that... handle accordingly
      else:
      # It worked.

      Here's a great example of why Python's use of whitespace is screwed up beyond words. I can get PHP's indentation to come back just by pasting it into Vim; lots of luck trying to do that with Python.

      There's a lot to be said for redundancy. Natural languages use it, and you probably don't think much about when you speak. Another example of useful redundancy is in the UTF-8 encoding. A garbled bit somewhere in a UTF-8 string results in only one character's getting corrupted: a function which understands UTF-8 can resynchronize without error with the codepoints on either side of the bad character. If the string in question contains natural-language text, a reader of that language is usually able to figure out what was meant without any guessing. It's redundancy to the rescue.

      Actually I don't get all worried about opening files in PHP. Yes, I use is_file() and is_readable(). I *could* use the @ message-husher in this case if I wanted, but I generally don't.

      (I do have to say, though, that some functions are more painful because they have no way to do any needed pre-testing to avoid messages being printed. A case in point: you pretty much have to use @ before calls to things like socket_select() if you're using non-blocking sockets.)

      Finally, about the funky function naming and argument ordering. The PHP API builds on many disparate libraries from several programming languages. The biggest bunch are the ones that look like libc functions, but there there are PHP functions that follow the ones in many other libraries also. Lots of times I can look for normal man pages to see what the arguments to PHP functions are.

      (In some cases PHP goes its own way. Take it from me that it is much easier to code for PHP's Perl-Compatible Regular Expressions API than it is to write the C code to use libpcre directly: preg_match() is a sight easier to use than pcre_compile/pcre_fullinfo/pcre_exec.)

      Given these many outside influences on PHP's API, I notice how comparable it is to the English language. English picks up useful words from all over the place and very often keeps the spellings the words had in their original languages.

    82. Re: PHP 6.0 without the stupid? by garyebickford · · Score: 1

      Cool. I haven't written significant C in 10 years, so wasn't aware that gcc did that. Although IMHO it would be semantically better to use {} instead of () as the inside symbols, since {} identifies blocks elsewhere.

      Will it ever become part of standard C?

      --
      It's easier to be a result of the past, but more fun to be a cause of the future! http://www.spacefinancegroup.com/
    83. Re: PHP 6.0 without the stupid? by Rob_Bryerton · · Score: 0

      Powershell was created for people who have absolutely no idea what they are doing. Sysadmins. As a developer it looks like fucking Greek to me.

      Even though you can teach a dog a few tricks, it's doesn't necessarily mean that he is intelligent. But if you were able to ask him, I'd bet he'd have a pretty high opinion of his level of intelligence...

    84. Re:PHP 6.0 without the stupid? by Jesus_666 · · Score: 1
      Well, that and the parser. PHP's parser tends to choke on some unexpected things. For example this, which was thankfully fixed in 5.4 (but unfortunately lots of places still insist on using 5.3 so you still need to wathc out for it):

      class A {
      public $x = 6;
      function y() { return array("foo"); }
      }

      $a = new A(); echo $a->x; // prints "6"
      echo (new A())->x; // syntax error, unexpected T_OBJECT_OPERATOR

      $b = $a->y(); echo $b[0]; // prints "foo"
      echo $a->y()[0]; // syntax error, unexpected '['

      --
      USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
    85. Re: PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

      It's perfectly possible to write very clean code with PHP

      I am a very long time PHP coder (among other things like my beloved Haskell and other actual programming languages), and:

      NO, you ABSOLUTELY can't. At all. Ever.

      The language itself doesn't even offer the features to do so. And the interpreter is a freakin' insane joke. Just the bare strings "feature" alone, combined with how constants are used, deserves prime grade murder time for its creators!

      And don't even get me started on the ridiculous attempts at class-based OOP that make JavaScript look like an elegant work of art.

      Still not convinced?

    86. Re:PHP 6.0 without the stupid? by squiggleslash · · Score: 1

      No you wouldn't. If you did if("false") then yes, solely because you're passing in a non-null parameter (no attempt is made to examine the string - remember that if("") will have different results in PHP and C with the former treating "" as false, and latter seeing a non-null), but sprintf(buffer, true); if(strcmp("false", buffer")) will fail.

      --
      You are not alone. This is not normal. None of this is normal.
    87. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

      Or how about "($a ? $b : $c)->foo()", still not working in 5.4 and no mention of a fix in 5.5.

    88. Re: PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

      Except for that stupidly asinine aversion to using STRINGS... Who the fuck anti-brained that?!

    89. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

      actually good using ->
      if in javascript "2"+2; What should output. kinda confusing.
      ORM is for oop folks. While business developer could not afford like this because each time database is changed,your have to
      update your model /data structure class.The time compiling the class to native sql is still waste or time to me.Query can easily change fast and that why
      we need native sql instead orm.

      ruby and rails is framework .So you couldn't compare directly with php.

      semicolon in the end of line important to me. because i easily can find where the end. I writing not hundred of code but thousand each form. You might said if work with python or rail might be shorter . but in the end still come a lot because of business logic validation.

      Either using [] or () is not matter to me.unless it don't work.To me php array is great. no need to knew hash/link list or so whatever object term.

    90. Re:PHP 6.0 without the stupid? by Millennium · · Score: 1

      That's strong typing, not static typing. There's a difference.

    91. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

      Only until it gets redefined to "my_real_fap()"

    92. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

      Sometimes the boss doesn't have a choice either. It may be fixed IT policy up to the CTO level, and good luck getting that changed in some organizations. Sometimes the boss has budget constraints, or backward compatibility requirements, or as you say, is just an idiot who is arrogant enough to think he knows better than you how to do your job.

      The practical reality is that most working programmers don't get to choose their tools. If you're in a position to do so, bully for you. The job market still stinks, though, and if I can get work doing PHP that's better than twiddling my thumbs or hearing "we'll let you know..." from more enlightened employers.

    93. Re: PHP 6.0 without the stupid? by itsdapead · · Score: 1

      Hate for python whitespace is a sure sign of a superficial appreciation for its tradeoffs.

      It doesn't say anything bad about the language, it just shows you haven't actually used it for anything and are willing to make egregious statements based on unfamiliarity and ignorance.

      ...says someone who's never moved their C/C++/PHP/Java/Javascript/HTML code from one text editor to another that handles tabs/linefeeds or auto-indentation differently - or even cut/pasted code from files with different indentation styles - and seen all the beautiful indentation get mangled. Significant whitespace is Just. Dumb. for the sake of removing a bit of redundancy. Maybe, just maybe, there's a reason why Pascal, VB, Java, Javascript, C, C++, C#, FORTH, Postscript, Perl, HTML, SQL etc. (and probably loads of others that I've never tried) don't do it. You can forgive FORTRAN because it was designed to be entered on punched cards. Years before Python there used to be a joke article circulating around explaining how Unix was an April Fool's joke by Richie & co, and one of the examples was the use of significant whitespace in Makefiles.

      Why learn a language if it's not a bit unfamiliar in the first place?

      Er, because it offers some powerful new features? Being 'unfamiliar' should be a means to that end. Thing is, both Python and Perl feel like they are designed to be different for the hell of it. Perl got away with it by having brilliant regex support, until other languages caught up.

      A year or so back I did decide to give Python a proper go and try a "real project" with it - replacing the kludgey PHP utility I use to sync my iTunes music with vanilla MP3 players. Steeled myself to stop worrying and love significant whitespace. Went looking for the XML/XPATH/DOM library (the iTunes library metadata is stored in XML) and found... half-a-dozen independently written and half-finished XML libraries, none of which did XML + XPATH, and a lot of blog discussions about what would be a "pythonesque" way of doing XML.

      So I went back to PHP and just used the DOM XML library that's been there for years and basically gives you more-or-less 1:1 bindings for the standard DOM API, that you'd recognise from Java, Javascript, C/C++ or any book on XML...

      PHP may be a fugly language but it is chock-full or useful libraries written by people who wanted to get the job done for people who wanted to get the job done. Perhaps the fugliness helps to scare off the paradigm evangelists.

      --
      In a survey of 100 programmers, 111111 thought that duck-typing was a good idea.
    94. Re: PHP 6.0 without the stupid? by petermgreen · · Score: 1

      It's not so much generating html, you can do that just as easilly in many other languages.

      The hook with php and similar tools (asp, jsp) is that you can put a little bit of php *inside* a html (or other text based format) document whereas with a more conventional programming language you'd have to either write code to read the html from a file and make substitutions or convert your html into a massive series of print statements. That massively lowers the barrier for people who want to add a little bit of interactivity to their website or move the menus into a common file rather than repeating them in every page.

      It's marginally useful even in more complex web applications because it lets you make the "view" essentially a html document and yet pass it paramters with the data it is supposed to include but it probablly doesn't make up for php's other defficiencies there..

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    95. Re: PHP 6.0 without the stupid? by petermgreen · · Score: 1

      I don't understand. I'm not a parser, but to my eye that means "assign." If you wanted to compare, you would do "if ($foo == 1 + $bar)", no?

      That is what it means to php and other languages that borrow heavilly from c. The fact that it means that to your eyes is probablly a result of you having programmed in c based languages for many years. Other languages do other things, Pascal uses = for comparison and := for assignment, Basic uses = for both and decides which to do based whether you are writing a statement or a parameter. So it's an easy mistake to make and a difficult one to spot. Especially for people who move between languages that borrow from C and languages that don't.

      It wouldn't be so bad if it was actually an error to try and do an assignment in a conditional and to try (and for that matter to do a comparision in a statement on it's own) but in C based languages assignments evalulate to the value of what is being assigned and C and php both have very loose typing*. The result is that when you forget the second equals sign you get a program that doesn't give any errors but doesn't do what you expect either.

      As another poster has pointed out modern C compilers have now put a warning in place for this common mistake but interpreted languages like php don't really have the luxury of doing that.

      * Java is an example of a language that borrows sytax from C but whose strong typing makes this much less of an issue it's pretty unusual to be comparing booleans for equality and trying to do an assignment of any other type in a conditional will result in type errors.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    96. Re:PHP 6.0 without the stupid? by Anonymous Coward · · Score: 0

      You are a glorious example of what's wrong with PHP programmers.

    97. Re: PHP 6.0 without the stupid? by an_orphan · · Score: 1

      yea, I don't really miss the 'one right way to do anything' attitude. I wouldn't really say python's a paradigm, it's sort of just a highly-opinionated and dynamic OO language and community. Ruby tries to be friendlier, but I don't use that either. The whitespace thing.. I guess it can be inconvenient. I just always use spaces. I have felt the pain (in java) of badly formatted and mixed-formatted code being weird in different editors, but I use a lisp full-time now, which means I'm willing to trudge through syntax unfamiliarity for the sake of some benefits. I prefer the regularity, though you can't control how other people format their code or what editors they use. If it's code that I'm working on, I make sure it's indented properly.

  2. Bugs & Maintainers by TheNinjaroach · · Score: 4, Informative

    I participated in beta release testing for 5.5 and I'm frustrated that it still has old bugs 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.

    --
    I went to eat some animal crackers and the box said, "Do not eat if seal is broken." I opened the box and sure enough..
    1. Re:Bugs & Maintainers by chris200x9 · · Score: 2

      Fork it?

    2. Re:Bugs & Maintainers by Grashnak · · Score: 5, Funny

      Fork it?

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

      --
      Life needs more saving throws.
    3. Re:Bugs & Maintainers by Anonymous Coward · · Score: 0

      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.

    4. Re:Bugs & Maintainers by Anonymous Coward · · Score: 0

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

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

    5. Re:Bugs & Maintainers by Anonymous Coward · · Score: 0

      I know about "the incident" but fail to see how this was funny -- A guy.

    6. Re:Bugs & Maintainers by Grashnak · · Score: 1

      I'm not sure anyone here can help you with that. Have you considered seeking a sense of humour transplant?

      --
      Life needs more saving throws.
  3. Slashvertisment by Anonymous Coward · · Score: 0

    For Laravel?

    Why u no Symfony?

  4. Citation needed by benjymouse · · Score: 4, Insightful

    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.

    --
    Reading slashdot one-liner: (irm http://rss.slashdot.org/Slashdot/slashdot).rdf.item | fl title,desc*
    1. Re:Citation needed by dkleinsc · · Score: 2

      just ceased on an opportunity

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

      --
      I am officially gone from /. Long live http://www.soylentnews.com/
    2. Re:Citation needed by Anonymous Coward · · Score: 0

      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.

    3. Re:Citation needed by dkleinsc · · Score: 2

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

      --
      I am officially gone from /. Long live http://www.soylentnews.com/
    4. Re:Citation needed by Anonymous Coward · · Score: 0

      seized. HTH.

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

    5. Re:Citation needed by Anonymous Coward · · Score: 1

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

      That's the epitamy of hoodspa.

    6. Re:Citation needed by Anonymous Coward · · Score: 0

      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?

    7. Re:Citation needed by Anonymous Coward · · Score: 0

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

  5. Not even trying to be statically safe by Anonymous Coward · · Score: 4, Interesting

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

    1. Re:Not even trying to be statically safe by Anonymous Coward · · Score: 0

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

  6. PHP renaisaunce by Chrisq · · Score: 1, Offtopic

    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

    1. Re:PHP renaisaunce by wonkey_monkey · · Score: 1

      Here, esquilax.

      --
      systemd is Roko's Basilisk.
    2. Re:PHP renaisaunce by mjwalshe · · Score: 1

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

  7. Really? by LizardKing · · Score: 4, Insightful

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

    Citation please.

    1. Re:Really? by Anonymous Coward · · Score: 2, Interesting

      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.

    2. Re:Really? by jones_supa · · Score: 1

      Citation please.

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

      *ducks*

    3. Re:Really? by Chris+Mattern · · Score: 4, Funny

      Citation please.

      Okay. How's this?

    4. Re:Really? by columbus · · Score: 1

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

      --
      friends don't let friends teleport drunk
    5. Re:Really? by Anonymous Coward · · Score: 0

      My dad had a Citation II. I wish it had been a laughing matter.

    6. Re:Really? by Hognoxious · · Score: 1

      Gordon H. Bennet, it looks like someone took Garth's car from Waynes World, cut it behind the doors, found another one and cut it in front of the doors, and then welded the bits with doors together.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    7. Re:Really? by Anonymous Coward · · Score: 2, Funny

      I'm a RoR developer

      And you admit this publicly?

    8. Re:Really? by Waccoon · · Score: 1

      Only this car bears the quality and craftsmanship appropriate for a thread about PHP.

      Unintentional car analogy?

  8. Insanity by Anonymous Coward · · Score: 0

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

  9. Pretty simple by Anonymous Coward · · Score: 0

    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.

  10. What PHP needs now... by MikeRT · · Score: 3, Interesting

    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);

    1. Re:What PHP needs now... by Anonymous Coward · · Score: 0

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

    2. Re:What PHP needs now... by Parker+Lewis · · Score: 2

      How about the obvious on OO?

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

      and

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

      ?

    3. Re:What PHP needs now... by Anonymous Coward · · Score: 0

      You can create your own functions in PHP.

  11. Yeah, I'm sure by Trailer+Trash · · Score: 4, Insightful

    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.

    1. Re:Yeah, I'm sure by ducomputergeek · · Score: 2

      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.

      --
      "The problem with socialism is eventually you run out of other people's money" - Thatcher.
    2. Re:Yeah, I'm sure by Anonymous Coward · · Score: 0

      You should probably use the word "granted" a few more times

    3. Re:Yeah, I'm sure by Anonymous Coward · · Score: 0

      Selling fireproof undies. Real cheap.

    4. Re:Yeah, I'm sure by Anonymous Coward · · Score: 0

      Ruby is the only thing that's good about Ruby on Rails, and Ruby isn't all that great, comparatively speaking.

    5. Re:Yeah, I'm sure by Anonymous Coward · · Score: 0

      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.

      So... you encountered some bad RoR applications, won money from the opportunity, and then doubt the existence of other RoR projects? That's some terrible logic.

      GitHub, for instance, is RoR. So is Basecamp and Groupon. I recently started doing some RoR work, and I admit I fought it at first... but now I kind of love it. Ruby is a fantastic language once you stop trying to make it like $(LANGUAGE_OF_CHOICE). For me, I went through a few phases: first I wanted it to be C, then perl, then python. Now I can find things I like about Ruby more than the others (not to say I'd choose Ruby over all else for everything, I just think it's really well done). Then using RoR logically follows when I want to write a quick Ruby web app.

      Anyway, tldr; don't be so religious for/against technologies. I used to do this and am recovering from it. Some things can be cool, and that doesn't make the things I know best any less cool.

    6. Re:Yeah, I'm sure by Trailer+Trash · · Score: 1

      A lot of folks like yourself - typically without a strong CS background - don't really "get" Ruby and, by proxy, Rails. I understand that and, honestly, it's not a problem. Stick with PHP, the best you could do in Rails is lower the average IQ of Rails programmers.

    7. Re:Yeah, I'm sure by Anonymous Coward · · Score: 0

      Seriously, no matter what PHP framework you are using it's like trying to put lipstick on a pig. When I switched to web development I started off as a Zend (1 & 2) and Symfony2 dev. Now I'm using RoR, Django, and Pyramid 90% of the time. Not because of the style / features of the frameworks but because I find Python and Ruby to be vastly superior languages.

    8. Re:Yeah, I'm sure by Xest · · Score: 1

      But he made FIVE HUNDREDTY K $ so he must know what he's on about!!!11111

      Or maybe he's just as full of shit about that as well.

  12. A public thank you to the PHP team by Boss,+Pointy+Haired · · Score: 5, Insightful

    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!

    1. Re:A public thank you to the PHP team by Anonymous Coward · · Score: 0

      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.

    2. Re:A public thank you to the PHP team by VGPowerlord · · Score: 0

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

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    3. Re:A public thank you to the PHP team by Anonymous Coward · · Score: 0

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

    4. Re:A public thank you to the PHP team by Anonymous Coward · · Score: 0

      Is there some *BSD distro using PHP for its init scripts? I wonder what they were smoking.

  13. Re:Why not make dollar signs optional? by drunkennewfiemidget · · Score: 1, Flamebait

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

    Yeesh.

  14. Re:Why not make dollar signs optional? by TheSpoom · · Score: 2

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

    --
    It's better to vote for what you want and not get it than to vote for what you don't want and get it.
    - E. Debs
  15. Laravel, more of the same... by Aethedor · · Score: 1

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

    --
    It doesn't have to be like this. All we need to do is make sure we keep talking.
  16. Guilty pleasures by EmperorOfCanada · · Score: 5, Interesting

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

    1. Re:Guilty pleasures by Anonymous Coward · · Score: 0

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

    2. Re:Guilty pleasures by Samantha+Wright · · Score: 5, Informative

      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 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, 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; check out that sexy beast), although JWT is probably overkill for anything smaller than Gmail.

      --
      Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
    3. Re:Guilty pleasures by garyebickford · · Score: 1

      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.

      --
      It's easier to be a result of the past, but more fun to be a cause of the future! http://www.spacefinancegroup.com/
    4. Re:Guilty pleasures by Bigbutt · · Score: 2

      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]

      --
      Shit better not happen!
    5. Re:Guilty pleasures by Wdomburg · · Score: 1

      Return works fine; trying to return from something that isn't a method doesn't. The most striking thing about this question is that the submitter never explains what they are doing or why they insist on doing it in a non-idiomatic way. "I'd really prefer to be able to use 'return' in this scenario" is not a compelling argument. What reason did he have for trying to work around a reasonable, well established language paradigm?

      As far as people abandoning Ruby, I'm not sure it is more or less common than other languages. There have been a couple high profile "abandonments", like Twitter, which seem to get paraded out as proof that the language does not scale. There are a number of countervailing points, however; specifically:

      1) Twitter, even back when they first started their migration of critical components from Ruby to Scala, was at a scale unfathomable to most projects. If anything, that a message queue written in pure Ruby backed a site that size at all is an achievement.

      2) Twitter made their switch back back in the days of Ruby 1.8; i.e. back when Ruby was executed by directly traversing the AST, without native threading, and with only a primitive GC implementation. Ruby 1.9 and 2.0 are far more sophisticated and far better performing.

      3) Not only has the original Matz implementation of Ruby improved dramatically, there are several other first class implementations of the language that have different performance and operational characteristics. Using JRuby, for example, buys you a highly advanced VM, a variety of GC options, and the ability to seamlessly integrate Java classes for performance (or integration).

      4) There are quite a few major sites run on Ruby. For example, GitHub.

      Now is it a perfect language? Hardly. Is it suitable for every project? Of course not. But it doesn't deserve to be dismissed out of hand.

    6. Re:Guilty pleasures by EmperorOfCanada · · Score: 1

      Yes I did perl from around 1996 to 2000, then Java around 2000 (It really wasn't meant for web at the time), then .net around 2002 (It wasn't meant for the web at the time either), then PHP around 2004. Since then I have taken cracks at just about everything but lisp and Scala. Still keep going back to PHP.
      Oh and str_replace has fooled me many times so I now use preg_replace. Little harder but much cooler.

    7. Re:Guilty pleasures by SwabTheDeck · · Score: 1

      People blah blah about MVC

      My company has been using the MVC framework CakePHP for quite a few projects over the last few years. It never seems to get any public attention, but it works really well for us and has a lot of nice features.

    8. Re:Guilty pleasures by columbus · · Score: 2

      I like your link to a page containig a picture of a hammer with a claw on both ends.

      I raise you a link to a page describing a pentagonal room. PHP: a fractal of bad design.
      http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/

      I cant believe nobody has linked to that blog posting yet. It's a classic.

      --
      friends don't let friends teleport drunk
    9. Re:Guilty pleasures by wisnoskij · · Score: 1

      I love Perl for its regular expression use. It is so incredibly easy to do so many things after you realise how easy Perl makes RE use. I also think how it handles classes is cute, if not all that usable. But the rest of the language is pretty much crap.

      PHP is quite nice, but does a bunch of stuff a little off and is quite general at everything,

      --
      Troll is not a replacement for I disagree.
    10. Re:Guilty pleasures by wisnoskij · · Score: 1

      "it tends to keep executing code even when it shouldn't" and exit unexpectedly when you do not want it to.
      You could not make a language handle exceptions any worse than PHP.

      --
      Troll is not a replacement for I disagree.
    11. Re:Guilty pleasures by pmontra · · Score: 1

      CakePHP 1 was really difficult to read. I had to work with it and all I remember is that the signal was so obscured by tons of array() and strings with the names of models that the meaning of the code was difficult to understand (I was used to Rails). I remember that Symfony was cleaner, but still not so good. Hopefully CakePHP 2 got better but I never had to work with it so I can't compare it with Rails. Laravel looks like something that can be used, notwistanding the limits of PHP.

    12. Re:Guilty pleasures by EmperorOfCanada · · Score: 1

      Can't do Cake as it is too slow. Google beats your search results if your site isn't uber fast. Thus a site using raw PHP will be on page one while an identical site with Cake will be on page 8. This is one of the reasons I am tempted to make the mega leap to C++ for web apps.

    13. Re:Guilty pleasures by Terrasque · · Score: 1

      So if anyone can suggest a programming language to replace PHP I would love to know.

      My personal favorite is python. It's easy to work with, logical, and really fits the way I think.

      Some resources:
        * Instant python - gives a quick rundown on basic python
        * Ideomatic python - this is more about how one should use the language

      Packages:
        * Bottle micro web framework - small and doesn't have the niceties of the larger python frameworks, but it's great if you just want to get your feet wet, and do something right now
        * VirtualEnv - Creates virtual python environments where you are free to experiment with different packages (and python versions) without affecting anything else.
        * PIP - package manager. Works incredibly well with virtualenv, and have some neat features (like making a list of all packages and versions installed in active VirtualEnv)

      --
      It's The Golden Rule: "He who has the gold makes the rules."
    14. Re:Guilty pleasures by Terrasque · · Score: 1

      Dang. Forgot a really important link!

        * Python Quick Reference - a well-structured python reference, especially listing common variable types and functions attached to them

      --
      It's The Golden Rule: "He who has the gold makes the rules."
    15. Re:Guilty pleasures by Anonymous Coward · · Score: 0

      Because veekun's post is a waaaahmbulance of tedious and pedantic ramblings that will never stimulate reform from some ivory tower programmer. It's not like HE's going to start writing his uber language that avoids all of these 'mistakes.' I probably made several thousand dollars doing PHP consulting in the time it took to write that steaming pile of bitch, moan, cry, sniffle.

    16. Re:Guilty pleasures by Anonymous Coward · · Score: 0

      It's not like HE's going to start writing his uber language that avoids all of these 'mistakes.'

      Why do PHP fuckwits constantly repeat this ridiculous drivel? We don't need to write a new language to replace PHP because there are plenty of infinitely better languages already available.

    17. Re:Guilty pleasures by Anonymous Coward · · Score: 0

      Actually he works at Microsoft working on the C# / .NET toolchain, so is both more successful than you and has been helping build a better language that does avoid all those mistakes and does do things properly.

      Nice try though.

    18. Re:Guilty pleasures by Anonymous Coward · · Score: 0

      Actually he works at Microsoft working on the C# / .NET toolchain, so is both more successful than you

      You can't conclude that, unless you believe that working at Microsoft is the ultimate dream job for any programmer in the world.

  17. Re:Why not make dollar signs optional? by Great+Big+Bird · · Score: 1

    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.

  18. Re:Why not make dollar signs optional? by akanouras · · Score: 1

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

  19. Re:Why not make dollar signs optional? by putaro · · Score: 1

    Yah, they were really great in BASIC!

  20. Re:Why not make dollar signs optional? by Anonymous Coward · · Score: 0

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

  21. If it's a connection method, it's the real deal by tepples · · Score: 1

    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 that would need a large, variable number of placeholders.

    1. Re:If it's a connection method, it's the real deal by Anonymous Coward · · Score: 0

      Who cares? It's still an aberration of PHP. Why drive nails with a screwdriver when you could use a hammer instead?

    2. Re:If it's a connection method, it's the real deal by Anonymous Coward · · Score: 0

      reserving manual escaping for things like the right side of operator IN that would need a large, variable number of placeholders.

      It can lead to the parameters getting out of order relative to the placeholders; the care needed to keep the order straight is close to the care needed to escape all dynamic arguments.

      SQL::String

      Oh, you were using PHP? Sucks to be you.

  22. Re:Why not make dollar signs optional? by Anonymous Coward · · Score: 0

    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.

  23. The PHP Renaissance is here... by Anonymous Coward · · Score: 0

    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.

  24. Re:Why not make dollar signs optional? by Anonymous Coward · · Score: 0

    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.

  25. Re:Why not make dollar signs optional? by Anonymous Coward · · Score: 0

    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.

  26. Hosting plan compatibility by tepples · · Score: 1

    Why drive nails with a screwdriver when you could use a hammer instead?

    Because hosting plans, especially budget shared hosting plans, are more likely to come with a screwdriver than with the particular version of a hammer that your application needs. You could have the best web app in the world written in Perl or Python, but you'll pay more to run it than you might on PHP-only hosting. MySQL is popular for the same reason: ubiquity on entry-level hosting.

    1. Re:Hosting plan compatibility by Anonymous Coward · · Score: 0

      Yes but this is Slashdot where people work on relevant things, not chucklefuck hosting with shit web apps. We can run our own servers.

      the escape nonsense is still terrible even if you work around it.

    2. Re:Hosting plan compatibility by Anonymous Coward · · Score: 0

      20 fucking dollars is too much to host on an actual VPS?

    3. Re: Hosting plan compatibility by scrote-ma-hote · · Score: 1

      $5 - digitalocean.com

  27. "the web's most popular scripting language"?!? by Just+Some+Guy · · Score: 1

    Given that I've seen exactly zero PHP programs running as scripts outside of a webserver environment, I'm calling bullshit on the idea of PHP being a scripting language, let alone "the web's most popular" one.

    --
    Dewey, what part of this looks like authorities should be involved?
    1. Re:"the web's most popular scripting language"?!? by pmontra · · Score: 1

      Actually phpunit runs scripts from the command line but yes, usually they are tests for code that eventually runs in a webserver. Anyway a large and well done PHP project has much more code in models, controllers and libraries that in HTML views so it's not easy to say that it's just a templating language.

      About being the most popular, it probably is. It's either it or Java or some .NET language. Python and Ruby are following at a distance. Given all the free or cheap PHP hosting servers my bet are on PHP. But being popular doesn't mean being good.

    2. Re:"the web's most popular scripting language"?!? by Anonymous Coward · · Score: 0

      I'm one of those people who use php quite a lot in the shell, partly because it's simply easier at this point to write a quick script to do what I want in PHP, than it is to sit down and figure out a way of doing the same thing with BASH.

      Do you also call bullshit on the existance of atoms, simply because you've never actually seen one?

    3. Re:"the web's most popular scripting language"?!? by Anonymous Coward · · Score: 0

      sometime i do quick testing and batching migration data within php.
      Reason.. freakin fast to code.

    4. Re:"the web's most popular scripting language"?!? by lagi · · Score: 1

      At my work place we have a lot of "PHP programs running as scripts", at least 10 a day in crontab. Also our build system is written in PHP.
      Not saying it's the best tool for the job, but it's a job PHP can do.

  28. Re:Why not make dollar signs optional? by mypalmike · · Score: 1


    if token.type == TOKEN_TYPE_STRING {
        if keywords.contains( token.value ) {
            handle_keyword(token);
        } else {
            handle_variable(token);
        }
    }

    --
    There are 0x40000000 types of people: those who understand 32-bit IEEE 754 floating point, and those who don't.
  29. Great, even more versions of php I cannot use. by wisnoskij · · Score: 1

    Being stuck developing on other peoples servers.

    One thing I found very strange was how much it matters. It is surprising how many necessary, basic features have just been added.

    --
    Troll is not a replacement for I disagree.
  30. Re:Why not make dollar signs optional? by Anonymous Coward · · Score: 0

    I would be a relatively small, backward-compatible change.

    You would not be a small backward-compatible change. echo foo; has a meaning in PHP -- it will, with a warning, echo the string 'foo'. Granted, that's stupid as hell, but it means you can't drop '$' in a backwards compatible way.

    The '$' has some advantages. The syntax is consistent with variable expansion in strings. Variable names don't conflict with keywords. Variable names don't conflict with functions (and boy, do the PHP devs ever love adding functions, right into the global namespace.) It stands out when embedded in HTML. It lets you do the terrible '$$a' double dereference. It separates variables from constants, which are replaced with their value at compile time.

  31. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  32. does php suck or do I by sobolwolf · · Score: 1

    Really, the quality of PHP depends on the person writing it. Bad code is bad code in any language, PHP does not cause you to write bad code, the problem is you! PHP is the most popular scripting language, most servers support and more importantly, there is a ton of documentation and examples about. I really can't see why people hate it so much, I guess we are probably looking at some form of Fanboi war, apple vs m$ type bullshit. There are many ways to skin a cat (in regards to programming) with PHP being probably the most inexpensive way to achieve what you need to do on the server side. It is either this or use one of the "cool" languages and pay more... whatever

    1. Re:does php suck or do I by Xest · · Score: 1

      "PHP does not cause you to write bad code"

      Yes it does. It's unnecessarily verbose, it's standard library has inconsistent parameter and naming ordering and it has a number of well documented bugs and quirks that require you to write odd code to work around them.

      It hasn't until recently properly supported threading, and even now it's hardly fair to call it proper threading support so for something like that you need to write ugly hacks.

      All of these things result in sub-par code and all of these things are an unfortunate fact of developing with PHP.

      So no, it's not necessarily the programmer, PHP does indeed actually force you to write bad code.

      People hate it because it's objectively just a very bad language.

  33. Re:Why not make dollar signs optional? by Anonymous Coward · · Score: 0

    Yes, we should go back to writing programming language that are easy for the compiler guys to do.
    Optimization is hard. We should just leave that out too.

  34. Most popular web scripting language? by Anonymous Coward · · Score: 0

    im guessing javascript somehow doesn't qualify? lol

    1. Re:Most popular web scripting language? by itsdapead · · Score: 1

      im guessing javascript somehow doesn't qualify? lol

      How many server-side PHP projects don't rely on a bit of Javascript client-side?

      --
      In a survey of 100 programmers, 111111 thought that duck-typing was a good idea.
  35. MVC is not the solution to PHP by Anonymous Coward · · Score: 0

    The biggest PHP problems mentioned I agree with:

    1. The way errors don't always trigger exceptions is completely wrong and I guess it's because of the way things evolved. It's a pain, and at the moment you have to deal with it. It's not beautiful, but it's not the end of the world either
    2. Type coercion is not natural in many cases but I'm not sure if it just hasn't been thought through, or if it's a natural conclusion of starting with "0" == FALSE, which is *very* handy. Maybe someone else can help answer this

    (Type coercion should be one of the first lessons in PHP, that way it at least sounds familiar if you ever run into the problem).

    Regarding the renaissance thanks to Lavarel, I don't buy it. The article reads almost like a press release.

    This is a pet peeve of mine and the following is quite ranty, but I wrote it to a friend and I thought it might be useful to get some feedback from readers here: why does everyone think that MVC frameworks are the right solution? I really only see two advantages:

    1. It makes you organise your code in a certain way
    2. You don't have to deal with mod_rewrite

    The first point you should already have under control. You don't need a framework to keep things tidy. Why would I rather do regular PHP and keep things tidy myself? Because frameworks have you relearn everything you already know, and included in the extra layer of code there are all these assumptions that the framework authors thought were neat but which you only learn by hitting obstacles.

    And if you really need a better solution than mod_rewrite, write your own, it's easy. And you don't even have to have it read from a configuration file: the mapping can be in source code.

    Am I being narrow-minded? I've worked with Java for a number of years, mostly in web projects (Struts 1) or back-end code (connecting to DBs, services). I spent a summer designing a project to use Struts 2 and Spring (around 2008), and I've written my own MVC for PHP. I've tried CodeIgniter. And all this has just made me abhor MVC frameworks:

    - The ORMs that we've known for decades cannot ever work
    - The huge amounts of configuration files that people think exist because one day a client will request a change and all we'll have to do is change a few lines of configuration (like magic)
    - The complete bewilderment when things go wrong (crappy or no error messages)
    - The code generation
    - Form handling and validations that are never quite right
    - Poor documentation

    Ruby or Python might be better than PHP, but surely MVC frameworks are not the solution.

    Am I missing something?

  36. Re:PHP bad. 'C' Good: printf(1+2+"3+4+5"); by Fancia · · Score: 1

    "The language is as good as the developer using it" is a faulty argument. Read PHP: A Fractal of Bad Design for a good rebuttal.

    --

    Bít, zabít, jen proto, ze su liska!
  37. Comment removed by account_deleted · · Score: 2

    Comment removed based on user account deletion

  38. Re:PHP bad. 'C' Good: printf(1+2+"3+4+5"); by Anonymous Coward · · Score: 0

    haha. i hate testing IA64.quite freakin unstable. sure people nowdays tough their pc is 64bit while it's actually ain't.

  39. Re:PHP bad. 'C' Good: printf(1+2+"3+4+5"); by Anonymous Coward · · Score: 0

    "The language is as good as the developer using it" is a faulty argument. Read PHP: A Fractal of Bad Design for a painful, pedantic and tedious rebuttal.

    TFTFY

  40. how to install php 5.5 ? by LifesABeach · · Score: 1

    I am using the Ubuntu distro, how do I install it?

    1. Re:how to install php 5.5 ? by Anonymous Coward · · Score: 0

      I am using the Ubuntu distro, how do I install it?

      You need to active the following ppa
      https://launchpad.net/~ondrej/+archive/php5-experimental

  41. Re:PHP bad. 'C' Good: printf(1+2+"3+4+5"); by Xest · · Score: 1

    "The language is as good as the developer using it."

    Exactly.

    That's why PHP only has bad developers.

  42. Re:Why not make dollar signs optional? by Xest · · Score: 1

    To be fair, one of the arguments for dynamic languages is less code needs typing because type conversion is handled automatically (some of the time).

    With PHP all that's undone by the fact you're typing unnecessary extra $ signs everywhere and having to use === instead of == half the time. If you've got those extra keystrokes all the time then what exactly is PHP's advantage again? It doesn't have any.

    So there is a fair argument against it even if it was a single keystroke (it's not, it's a shift+keystroke).

  43. Re:Why not make dollar signs optional? by Great+Big+Bird · · Score: 1

    class functor { void operator() { } } n; n(); Is n a variable or a function? how about int n(5); A nice little constructor call. Love the most vexing parse. I believe using a $ would simplify a design, but not still not necessary.

  44. Re:Why not make dollar signs optional? by Great+Big+Bird · · Score: 1

    Is it a variable or is it a function call?

  45. Re:Why not make dollar signs optional? by Great+Big+Bird · · Score: 1

    I am not talking about going back, I am talking about them simplifying a design that already exists. I would not write a compiler personally that needed it.

  46. Re:Why not make dollar signs optional? by Great+Big+Bird · · Score: 1

    I do love the "design" in quotation marks, they actually thought using a left associative ?: is acceptable? I think they are mad.

  47. Re:Why not make dollar signs optional? by Anonymous Coward · · Score: 0

    I like the $ signs, and I don't find them to be any impediment to typing or reading code.

    I learned BASIC back in high school, and when I learned C it always felt strange to me to have "naked" identifiers everywhere, not to mention the confusing dual use of '*' and '&' operators.

    If I were designing my own programming language, I would use this system:

    foo : identifier for variable or object
    @foo : address of foo's contents
    $foo : value of foo's contents