Hi Johannes,

These can be easily emulated using PHP like
 if (!function_exists("is_binary")) {
   function is_binary($s) { return is_string($s); }
 }

file_put_contents(FILE_BINARY)

Obviously... I was just thinking about the amount of stuff that would need to be added to that compatibility layer, and how it might affect portability. Not everyone uses PEAR and here we're more or less forcing a dependency on it, with the option being to knit one's own. Also, since many are only now moving from PHP 4, it seems a bit harsh to tell them they're going to have to change their code all over again in a couple of years' time for PHP 6 when they could be doing it all at one hit.

Would a const FILE_BINARY = 0; be enough or would that break the
function in some way (didn't check it)

#define PHP_FILE_TEXT 32
#define PHP_FILE_BINARY 64

And again, yes you can do it in userland code (FILE_TEXT, FILE_BINARY) and it harms nothing.

as long as such an emulation is possible I'd prefer putting them in a
compatibility layer (like PEAR PHP_Compat) using PHP instead of putting
"useless" (mind the quotes ...) functions into PHP.

We'll have to agree to disagree over this...

- Steph


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

Reply via email to