Custom datatypes to PHP