use php pack function to handle write_long
Merge pull request #104 from znarf/master

use PHP's pack function to handle write_long