|
Posted by Michael Fesser on 12/04/06 14:55
..oO(Adam Scheinberg)
>On Dec 3, 10:38 pm, "Benjamin" <musiccomposit...@gmail.com> wrote:
>> This sort of function might be nice for you but things like this are
>> really what user functions are for. If PHP kept adding new
>> "personalized" functions to the source, PHP would become really bloated
>> and bulky. If you really want that function, you could create your own
>> extension in C.
>
>Why is this "personalized?" What I said was I see it all over the
>place.
I don't, because such things should only be used while developing, not
in productive code. Additionally printing it out as preformatted HTML
might be the most common way, but not necessarily always the best.
You're better off with writing your own function that does exactly what
you want and need. Write it once, put it in an external file, include it
and you can use it all the time. In my applications for example I use
two of them:
debugPrint() -> returns preformatted HTML
debugLog() -> writes the output to a logfile
I would never expect PHP to already ship with such functions included.
>Chaging the behavior of an existing function does not "add
>bloat" if it does what develpers intended it to do.
Changing it the way you intended would be unnecessary bloat. Currently
print_r() returns raw data, which is perfectly fine for all kinds of
further processing. Changing it to already return a specific formatting
like HTML doesn't really make sense and would limit its uses (IMHO).
Micha
Navigation:
[Reply to this message]
|