Multibyte function overloading in PHP

download Multibyte function overloading in PHP

If you can't read please download the document

description

Multibyte function overloading in PHP using mbstring.func_overload

Transcript of Multibyte function overloading in PHP

  • 1. Multibyte function overloading in PHP using mbstring.func_overload By Daniel Rhodes of Warp Asylum ( www.warpasylum.co.uk )

2. Mbstring.func_overload

  • Can overloadgroupsof functions mail, string and regex

3. Can get the multibyte functionality without thinking too hard about it 4. A bitmask setting 5. Overloaded functions arelost ... 6. ...but not really! Undocumented but mb_orig_whatever() will exist as a callable functionifmb_whatever() has been overloaded! 7. An example 8. That's all folks!

  • I'll leave you with some things to think about:
  • Might be better when dev'ing an app from scratch to simply call the mb_whatever() functions explicitly

9. Overloading prob better for bootstrapping / bridging legacy apps up to i18n 10. If you need access to the pre-overloaded version of the function, you are possibly doing it wrong 11. mb_orig_whatever() is undocumented for a reason... 12. Questions welcome at [email protected]