> Am 08.09.2015 um 00:41 schrieb François Laupretre <franc...@php.net>:
> 
> Hi,
> 
> I have written a follow-up to my previous 'zstrict' PR. It is now focused on 
> a simple mechanism to detect API violations :
> 
> https://github.com/php/php-src/pull/1508
> 
> This version just implements the mechanism and applies it to the zend_string 
> val/len/h elements. More details in the PR.
> 
> Please comment first. Then, when we're OK on the feature, we may talk about 
> the target version.
> 
> Regards
> 
> François

While I don't disagree with the idea of making accidental direct access harder, 
I see a particular disadvantage for debugging.

Nobody will like to write "p 
fbc->op_array.filename->zstrict_field_zend_string_val" (I hope I got it right?) 
just to figure out where the targeted op_array is located. [At least lldb only 
shows one character of the value when just printing the zend_string, due to the 
struct hack...]
Now you may say macro? Well, honestly, I don't usually use macros (as .gdbinit 
isn't compatible with lldb and lldb is more stable than gdb on OS X)

While it brings a minor guarantee that the ZSTR_*() API is really used, it 
makes debugging much harder; so I prefer to not merge this patch.

Thanks for your efforts here though!

Bob
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to