[Phpmyadmin-devel] PEAR::PHP_Compat
Marc Delisle
Marc.Delisle at cegepsherbrooke.qc.ca
Fri Dec 9 07:06:10 CET 2005
Sebastian Mendel a écrit :
> Hi,
>
>
> how about using PHP_Compat ?
>
> for example in register_globals()
>
> we could just do
>
> <?php
> require_once 'PHP/Compat.php';
>
> PHP_Compat::loadFunction('array_walk_recursive');
> array_walk_recursive( $_SERVER, 'strip_tags' );
> array_walk_recursive( $_ENV, 'strip_tags' );
> ?>
>
> this will improve speed on systems with PHP having this functions natively.
>
> i think there are more places where tis would be a benefit
>
>
Is this to improve the speed instead for this code? Maybe not worthwhile
since it's not executed in many cases.
function array_strip_tags(&$item) {
if (is_array($item)) {
array_walk($item, 'array_strip_tags');
} else {
strip_tags($item);
}
}
array_walk( $_SERVER, 'array_strip_tags' );
array_walk( $_ENV, 'array_strip_tags' );
More information about the Developers
mailing list