3 ms·
Yes I dislike the use of 'annotations'. Would it not be better to catch the recoverable error that "function foo (integer $a)" gives, then use your error handl
by ukandy 13y ago
Yes I dislike the use of 'annotations'.
Would it not be better to catch the recoverable error that "function foo (integer $a)" gives, then use your error handler to check that $a is an integer?
- p4lindromica 13y agoThis does not satisfy the requirement of low performance implications. Augmented Types works by wrapping zend_compile and adding opcodes to to the compiled PHP to check the types of the arguments. This way Augmented Types can be run once at compile time (yes, PHP is compiled) and ensure type safety of all subsequent invocations.
- wvenable 13y agoThis is sort of a test/development only feature -- so making use of annotations makes sense. Running annotated code on a vanilla PHP install (without this extension) will work perfectly fine. You only get the extra checks with the extension enabled.