Re: [PHP] Is there Any way to call Non-Existent function in PHP
You could wrap your function calls, maybe. Like function my_Draw_Image() { if(function_exists('Draw_Image')) { return Draw_Image(func_get_args()); } else { // do whatever... } } Haven't tested this at all, but it seems plausible. Might be possible to wrap generic function calls like this using call_user_func() or eval(). Again, I haven't tested it. -Steve On Thursday, January 17, 2002, at 12:07 AM, S. Murali Krishna wrote: Hi! Thanks for your kind response. The solution given by u is fine. But Iam asking just more than that. See whenever I call a function like Draw_Image(); ( In language construct level ) Is there anything to checks this non-existence of Draw_Image() and call some default function. I don't want to manually check if it exist or not. Thanks for Ur Solution. On Wed, 16 Jan 2002, Neil Freeman wrote: You can use function_exists() to check whether a function actually exists: eg: if (function_exists('imap_open')) { echo IMAP functions are available.br\n; } else { echo IMAP functions are not available.br\n; } HTH Neil S. Murali Krishna wrote: Hai ALL Is there any way to capture function call in PHP and redirect to some other function if that function doesn't exists. Perl programmers remind AUTOLOAD method in a package. S.Murali Krishna [EMAIL PROTECTED] = We grow slow trying to be great - E. Stanley Jones - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: php-list- [EMAIL PROTECTED] *** This message was virus checked with: SAVI 3.52 last updated 8th January 2002 *** -- Email: [EMAIL PROTECTED] [EMAIL PROTECTED] S.Murali Krishna [EMAIL PROTECTED] = We grow slow trying to be great - E. Stanley Jones - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Is there Any way to call Non-Existent function in PHP
You can use function_exists() to check whether a function actually exists: eg: if (function_exists('imap_open')) { echo IMAP functions are available.br\n; } else { echo IMAP functions are not available.br\n; } HTH Neil S. Murali Krishna wrote: Hai ALL Is there any way to capture function call in PHP and redirect to some other function if that function doesn't exists. Perl programmers remind AUTOLOAD method in a package. S.Murali Krishna [EMAIL PROTECTED] = We grow slow trying to be great - E. Stanley Jones - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] *** This message was virus checked with: SAVI 3.52 last updated 8th January 2002 *** -- Email: [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [PHP] Is there Any way to call Non-Existent function in PHP
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * On 16-01-02 at 11:21 * S. Murali Krishna said Hai ALL Is there any way to capture function call in PHP and redirect to some other function if that function doesn't exists. Perl programmers remind AUTOLOAD method in a package. You'll have to check the manual but I'm pretty sure there's a func_exist() function that should do the trick. I checked the manual myself but they must have changed the way it works as I couldn't find a damn thing! - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8RVqlHpvrrTa6L5oRAsGGAJ9Ksw7oUt1JNzAQpr5zFsJVcdfoCQCfWMsf UaBUo13DzZ36/zSb1MzPSTQ= =m5BB -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Is there Any way to call Non-Existent function in PHP
Hi! Thanks for your kind response. The solution given by u is fine. But Iam asking just more than that. See whenever I call a function like Draw_Image(); ( In language construct level ) Is there anything to checks this non-existence of Draw_Image() and call some default function. I don't want to manually check if it exist or not. Thanks for Ur Solution. On Wed, 16 Jan 2002, Neil Freeman wrote: You can use function_exists() to check whether a function actually exists: eg: if (function_exists('imap_open')) { echo IMAP functions are available.br\n; } else { echo IMAP functions are not available.br\n; } HTH Neil S. Murali Krishna wrote: Hai ALL Is there any way to capture function call in PHP and redirect to some other function if that function doesn't exists. Perl programmers remind AUTOLOAD method in a package. S.Murali Krishna [EMAIL PROTECTED] = We grow slow trying to be great - E. Stanley Jones - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] *** This message was virus checked with: SAVI 3.52 last updated 8th January 2002 *** -- Email: [EMAIL PROTECTED] [EMAIL PROTECTED] S.Murali Krishna [EMAIL PROTECTED] = We grow slow trying to be great - E. Stanley Jones - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]