in reply to Re: (jeffa) Re: PHP vs Perl code compare
in thread PHP vs Perl code compare

It doesn't quite have the same flexibility as perl's anonymous subs but there is an equivalent in PHP
<?php $f = create_function('$s', 'echo "got: $s";'); $f("a string"); ?> __output__ got: a string
So we have an anonymous function but unfortunately it is isn't totally orthogonal with normal functions in PHP.
HTH

_________
broquaint

Replies are listed 'Best First'.
Re^3: (jeffa) Re: PHP vs Perl code compare
by fruiture (Curate) on Oct 28, 2002 at 13:44 UTC

    Aha. Well, although i can only see this as quite ugly (especially compared to Perl), it is in fact an anonymous function. Thanks

    --
    http://fruiture.de