Source: https://web.fe.up.pt/~ee92193/documentacao/phpoo2.pdf