Archive for the ‘PHP’ Category

DOMDocument class behaves strange sometimes. It could omit some entities like “ and some valid UTF-8 characters (it also may do so for other encodings). This probably could be fixed by using own DTD, but there is a simple way too. Each HTML entity has its binary code, so DOMDocument will export your entities correctly if you replace the entities with the appropriate codes. I have a small list of them.

I faced a problem with one of my projects some time ago. Deep debug helped to understand that the issue is not in the code, but in PHP core.

PHP 5.2.5 has a problem with array_merge_recursive function. It was eliminating NULL values. I even found a bug filed in PHP bugtracker.

It’s just the interesting fact, so be careful 😉