Php Array Merge If Not Empty Python Functional Testing