Php Check If Variable Is String Mutable In Python