François Laupretre wrote on 22/09/2015 01:11:
Hi,

for those interested, a pull request implementing an exists() construct (on PHP 7) is available for testing and reviewing :

https://github.com/php/php-src/pull/1530

exists() is modelled after isset(), with the difference that every value (including null) returns true. Check the included '.phpt' test file for examples.


I take it you didn't like my suggestion of separate functions for hasitem() and variable_exists() then?

I think there are two very different use cases here, and combining them will just add to the confusion which isset() already seems to cause.

A variable_exists() which took a string (in keeping with class_exists(), function_exists(), etc) would also be more powerful, since you could write things like variable_exists('foo_' . $i)

Regards,
--
Rowan Collins
[IMSoP]

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

Reply via email to