Live data from Hacker News

PHP 7.3.0 alpha 1 Released

php.net

41–49 of 49 posts

Re: PHP 7.3.0 alpha 1 Released

#41
post #18

I recently revisited some of the earliest web code I ever wrote, which was in PHP 5.5 (about 7 years old, I think). I wasn't surprised by all the mistakes I made, both from being a newbie programmer and from making what I think were fairly easy-to-make PHP mistakes. After all, every tutorial I could find back then used mysql, didn't used real_escape_string, etc. What was surprising was how hard I had to dig now, 7 ye…

> but I don't think I'll ever end up using PHP since it still appears to be very easy to write bad code

I was in the Java world for many years, and found it to be incredibly easy to write 'bad' code. Sure it looked OK, but whenever there was a problem... i would just have people telling me it was 'wrong' and 'bad', but rarely ever any 'good' way to do something, short of entirely rebuilding in someone else's preferred library/framework/stack.

Loads of "well, that never happens to me", "works fine", etc. Was it tomcat? which version? was it one of the 95 dependencies interacting with tomcat in a way no one had ever hit? Oh shit - you're using tomcat? WTF? Glassfish/jetty/jboss are the only 'real' tools to use... etc.

Re: PHP 7.3.0 alpha 1 Released

#43

Earlier quoted context omitted.

http://www.phptherightway.com/ attempts to do just that - can't vouch for its effectiveness, but is a resource that was at least updated for PHP 7... https://github.com/codeguy/php-the-right-way

I always hated the DI fervor in PHP, like it solves all problems. You get such gems from phptherightway as > We can demonstrate the concept with a simple, yet naive example. > Here we have a Database class that requires an adapter to speak to the database. It tries so hard to be java, which seems backward.

Just like when demonstrating object oriented programming with trivial examples, DI suffers the same problem. DI, or Inversion of Control (the thing you want to achieve "through" DI), works best at scale, not with Hello World examples. When you work on a large code base with a large team you need some philosophy and principles to guide you. Decoupling is one of those things. Since Java is often used to build large software projects you will see these techniques being used and we therefore associate these things with Java (i.e. the Java bloat). Over the past few years it seems that PHP has become an "easier" Java and it's therefore only natural that these techniques and approaches are then also applied.

Re: PHP 7.3.0 alpha 1 Released

#44
post #31
post #16

Earlier quoted context omitted.

I'm asking about salary ranges specifically.

I know some php devs from munich in germany which started at 64k per year. Others earn 70k+ per year. In agencies (wordpress i.e.) jobs start at 48k.

Tbf, 70k€ in Munich is like 50k€ nearly anywhere else in Germany.

Re: PHP 7.3.0 alpha 1 Released

#45
post #36
post #18

I recently revisited some of the earliest web code I ever wrote, which was in PHP 5.5 (about 7 years old, I think). I wasn't surprised by all the mistakes I made, both from being a newbie programmer and from making what I think were fairly easy-to-make PHP mistakes. After all, every tutorial I could find back then used mysql, didn't used real_escape_string, etc. What was surprising was how hard I had to dig now, 7 ye…

phpdelusions.net

should have written more, was in a hurry. Even though the url sounds inflammatory, it is actually a really helpful resource on how to do dbaccess correctly.

Re: PHP 7.3.0 alpha 1 Released

#46
post #18

I recently revisited some of the earliest web code I ever wrote, which was in PHP 5.5 (about 7 years old, I think). I wasn't surprised by all the mistakes I made, both from being a newbie programmer and from making what I think were fairly easy-to-make PHP mistakes. After all, every tutorial I could find back then used mysql, didn't used real_escape_string, etc. What was surprising was how hard I had to dig now, 7 ye…

That's right, google search in past year only, btu focus on the php.net docs.

Re: PHP 7.3.0 alpha 1 Released

#48
post #42

What's new in this release? I couldn't figure it out by looking at the page.

The biggest is probably the new pcre jit: . Implemented https://wiki.php.net/rfc/pcre2-migration (Anatol, Dmitry) For me that's 40% faster on typical regex code.

I stand corrected: Their old pcre already had the jit. Max 10% speedups. So it's mostly just some new pcre2 features (new unicode, utf8/ucs-2/ucs-32), which are not that dramatic. It uses now the heap and not the stack for recursion. Safer, but a bit slower.

Re: PHP 7.3.0 alpha 1 Released

#49

Earlier quoted context omitted.

I always hated the DI fervor in PHP, like it solves all problems. You get such gems from phptherightway as > We can demonstrate the concept with a simple, yet naive example. > Here we have a Database class that requires an adapter to speak to the database. It tries so hard to be java, which seems backward.

I can only agree. I wrote a CMS with Zend Framework 2 which is heavy on DI and tries to be like Spring + Hibernate (Doctrine). Apart from being very hard to understand for new devs in the project, it's also very, very slow. The way PHP is evolving is definitely towards the Java world and I think it's the worst decision they could make. Moved to Go 5 years ago, never looking back.

Haven't had to use Zend but at least Symfony DI is really heavy to use with all the services.yamls and the javaisms it introduces.

DI can be heavy or it can be something mostly automagical like in Laravel. That's something I've enjoyed quite a bit. Basically it doesn't that much exist until you start needing special cases.

Quite a big part of the PHP community is gravitating towards Laravel and the new steam it introduced with OOB best practices and "let's try hard to avoid the Java-heaviness". Laravel seems to have quite nice balance between easy for new devs and bunch of powerful concepts when needed. Lots of basic problems solved OOB as well.

Post reply on HN