« first day (4948 days earlier)   

5:21 AM
So, I found a PHP book at a Japanese bookstore that's styled like a manga and... by skimming through it, it seems pretty good. It touches on SOLID, DI, TDD and other stuff...
I, of course, bought it.
I was giddy to see stuff like match statement and constructor property promotion
 
 
2 hours later…
7:30 AM
@LeviMorrison It's actually fewer than I expected, but of course this doesn't going the cases where the error handling was rewritten to avoid the NULL check entirely, e.g. by duplicating code, like you remarked for the array_find PR. And I'm also not sure if Coccinelle accurately identified all locations or whether it choked on some Macro-based syntax:
@@
zend_string *s;
@@

  if (s != NULL) {
* zend_string_release(s);
  }
@bwoebi free()-style functions are the exception for me, due to the common pattern of NULL-ing the freed pointer and also for goto-based error handling that requires less code duplication than copying them into each place where a function may return like PHP does not usually.
For HAProxy we even have a ha_free() function that takes a pointer to the pointer and includes the NULL-setting to keep the code even cleaner :-D
 

« first day (4948 days earlier)