3 ms·
PHPDoc is supported by most IDE's. Using this you can specify parameter types without using the actual type system. Visibility and typing features are good. Vi
by SilkRoadie 10y ago
PHPDoc is supported by most IDE's. Using this you can specify parameter types without using the actual type system.
Visibility and typing features are good. Visibility helps to design and write better code. The typing features are also welcomed in my view. I would rather a request completely fails because a variable is the wrong type rather than PHP's type coercion leading to an unexpected result with no errors or warnings.
That said, I use PHP for my day job. I see no reason to start new projects in it. I never use it in my side projects. Introduction of the single pipe operator to represent OR instead of a double pipe operator is baffling in my opinion.
7.1 does more work to improve consistency and error handling which is definitely welcomed. The problem is there is much legacy crap in PHP. It only exists for web applications and there are a growing number of languages which do this better.
- nkozyra 10y ago> Introduction of the single pipe operator to represent OR instead of a double pipe operator is baffling in my opinion. I kind of understand it since it's not a traditional OR operation and intends to keep and associate the matching values, but maybe something like catch (Exception $e in (Exceptions...)) would make it clearer. Either way, it's so close to feeling like an OR operation that I feel like it will be a lot of debugging when you forget this.