3 ms·
Looks like they're optional anyway so you're free to do things however you like
by derision 7y ago
Looks like they're optional anyway so you're free to do things however you like
- lowercased 7y agoisn't the system still going to have to check if a type exists or not anyway, contributing to the potential speed issue?
- derision 7y agoI'm assuming the check happens at compile time (and therefore cached in the opcache, which you should be using in production anyway)
- lowercased 7y agoi would think you'd still have dynamic check - trying to set a string in to an integer type would happen at runtime - you'd be checking before each set call. I'm not sure you'd be able to catch all the runtime potential issues ahead of time (but I've not kept up with php internals for awhile - perhaps someone's got a good way to do that now?)
- namibj 7y agoWhat I remember from reading master a few months ago: the zend VM can specialize ops already, trading size of the op-implementations against type-check-elision/fusion by GCC/clang. I think eliding redundant type checks at least won't be hard when confined to a single php function.