4 ms·
Is Php becoming popular again?
by s3nnyy 8y ago
Is Php becoming popular again?
- tjpnz 8y agoNo but if your job requires you use it it's nice that there are people out there trying to make the experience more tolerable.
- s3nnyy 8y agoAren't the new versions of PHP quite good?
- furicane 8y agoThey are, quite good and the performance keeps improving with every new version. We're expecting another huge performance boost with version 7.4
- AdrianB1 8y agoJust curious: in what scenarios did you see performance problems with PHP? In all my projects performance was more than adequate, even with 5.6 that was a few times slower than 7.x. All my current projects are 7.2, at some point I will get on 7.4 but not because I need more performance, just for bug fixes and security updates in the supported period.
- tjpnz 8y agoThey are but if you're coming from Python/Ruby or even newer Java releases you will still go through a period of depression.
- la_fayette 8y agoCan you go more in detail about what is depressing in PHP compared to Python/Ruby or even Java? There are differences between the languages as such, e.g. PHP has traits, Python has Operator overloading, etc. From a tooling perspective I cannot tell that there is any big differences.
- yyx 8y agoLittle things like semicolons and no "else" in for loop
- duckerude 8y agoI'm used to Python. PHP has a ton of weird flaws that seem like outright mistakes rather than unfortunate trade-offs. It really grates. spl_object_hash returns a unique id, rather than a hash. So why the name? Probably because it's formatted as a masked hex value. I had already started writing code to deal with hash collisions when I found out. The `self` and `static` keywords for accessing the current class do roughly the same thing, except `self` is static and `static` is dynamic. That's not very nice. You can't define consts on traits. If you google it, you find a reddit thread where multiple people offer creative theories of why consts on traits would violate OOP principles, and a bug report where you find out that it's because the implementation is too naive to deal with collisions. Sequential and associative arrays are the same data type, even though in practice you always use them either one way or the other. That interacts really badly with JSON (is an empty array supposed to become [] or {}?) and makes code harder to understand. Anonymous functions are called closures, but they aren't closures, unless you manually declare which variables from the surrounding scope you want to access and that you want the access to be referential. Weak typing is still around in enough places to make me paranoid. `in_array('3', ['03'])` is true (and `in_array($x, [true, false])` is true for absolutely any $x). You have to pass an extra boolean argument for strict typing, which is not nearly as easy to spot as a == operator. Relatedly, arrays can only have string or int keys, with mandatory weak typing. A string that's sufficiently int-like is converted automatically. So this code throws a type error when it reaches 3, even though it was a string when it was entered into the array: <?php declare(strict_types=1); function foo(string $s) { } $arr = ['x' => 1, ' ' => 2, '3' => 3]; foreach ($arr as $key => $value) { foo($key); } DateTime::ISO8601 does not implement ISO-8601, and is only kept around for backward compatibility with broken programs. You have to use DateTime::ATOM. There's a lot more like this. PHP is much better than it used to be, and it's very much possible to write good PHP programs, but I find it painful to use.
- rawoke083600 8y ago
- ehnto 8y agoIt's still extremely prolific, it's just not "cool". There are some very talented programmers working in PHP land.
- euph0ria 8y agoIt's always been popular and many of the big successful products are written in PHP. We see more and more startups doing PHP as well. I think a lot of devs have discovered that the new PHP versions let you have a very fast work flow.
- ksec 8y agoWell not exactly, but lots of company and businesses finally realise 95% of what they need could be done on PHP with ease. Not only it is cheaper as the talent pool is huge, it is also getting faster with lots of development still coming from community and Facebook.