On 07/02/2022 12:05, Craig Francis wrote:
And specifically with NULL, strings in C are a "one-dimensional array of characters terminated by a null character", so you could say that NULL is very similar to an empty string - maybe that helps address the "pretend its a string" objection?
In this case we're talking about the difference between a char* that points to a 1 byte buffer containing '\0' and a char* that itself points to NULL. Trying to perform string operations on a null pointer in C would equally blow up.
With regards to your framework comment, any framework worth its salt will also have the option to provide a default value other than null when the value is not provided.
It is the responsibility of the user to make use of this functionality to provide the correct type for what the soon-to-be-called function is expecting.
Mark Randall -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php