Compare length: clean up generated code php