On Wed Apr 20 04:41 PM, D. Dante Lorenso wrote: > > My proposal was called "filled" since it was the opposite of "empty" > which already existed. I extended the function to return the first > non-empty value or null if all values evaluated as empty. > > You could use the function like this: > > $x = filled($_GET['x'], $obj->something, $default, 'default'); > > Like I said, though, I don't think this can be done in the language > because I think they ran out of OPCODES and would have to tear apart > the whole PHP engine to support such a feature. >
That's not the reason, there's 127 / 256 opcodes. So far "filled", "varset", "coallesce", "ifsetor" or any operator would likely have to manipulate opcodes. http://php.net/~helly/ze2-ifsetor-20040901.diff.txt >From what I understand, zeev and andi are strongly opposed to adding a new >opcode. I'm sure they have their reasons. Maybe there's another approach where ~ E_NONE could be passed to zend_error ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */ { if(type & E_NONE) return; } Then modify to zend_vm_gen.php to pass E_NONE if within 'ifsetor'. Either way, there's a solution for it, I think the debate is over how it's implemented. -- Worth reading https://wiki.php.net/rfc/ifsetor#rejected_features -- Why? I think it simply boils down to this: - PHP *developers* want a function for it. Derick -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php