I have a question that I have not found any related source, and my question is mostly focused on these group of people: "People of origin from Ibero-American countries, Andorra, the Philippines, Equatorial Guinea or Portugal or Sephardic, who are pursuing a PhD in Spain** Ph."D.* in Spain."*
In many European countries, such as Poland (where I reside) or the Czech Republic (where a person I know resides) your studies as a master or doctoral student (not undergraduate) count as half of the residence time in these countries and in countries like The Netherlands, if you pursue a PhDPh.D. (strictly a PhDPh.D.), your years of residence are counted as full-time residing in that place.
Based on the previous examples, if you pursue a PhDPh.D. in Poland or Czechia for 4 years, it means: "You have lived 2 years and if you learned Polish (B1+) and worked for 3 years more, then you are eligible for the permanent residence card."
And in The Netherlands, if you pursued a 4 years PhDPh.D. (considered as regular work by their law), passed the integration test, worked 1 year more, and learned Dutch (B1+), you are eligible to apply for the permanent residence card.
What is the situation in Spain? Does the doctoral student's time count towards to your citizenship?
The time as a "doctoral student" is not something clear in most of cases and less their legal status (in The Netherlands you get a researcher's visa, not a student's one, for instance). I only found that in Spain if you're a regular student (not a PhDPh.D. one) your time is not counted.
And it's perfectly reasonable, since generally, when you're a regular student either you have a scholarship or you're paying your studies; technically, you tend to be exempt offrom paying taxes and you get some benefits and as a PhDPh.D. researcher, you often pay taxes as a regular worker. And this point of paying taxes is where a key difference comes into play between a regular student and a PhDPh.D. researcher, since taxes are used, for retirement or social benefits like health or social care.
Also, as a PhDPh.D. researcher, you might need to teach a certain amount of hours per semester, work on your research full-time, write and present scientific papers, support other professors, and rarely, you will receive some classes since you're becoming an expert in one specific arearea of the science.
Most of the time, a PhDPh.D. researcher could be seen as a regular workerwork because you have certain responsibilities, pay taxes, get a salary, and most importantly you're creating a unique solution to a problem with more or less clear goals and expected outcomes in a defined period of time (in the corporate world, a project) for a company, government, the university or an organization. An example could be the following one: "To design an algorithm for the detection of breast cancer with Machine Learning in Python."
For all previous reasons, in most of European countries, a "doctoral student" is considered as a researcher inside the universities and the concept of scholarships tend to be uncommon (Canada, the US, Australia, etc. Cannot be taken as the general rule) because even in Marie Curie, which provides many of the EU "PhD"Ph.D. scholarships", for instance, they are considered as jobs, not scholarships as you can see in the image below.