The PHP standard library is constantly changing, and our generated code changes with it, which means that we naturally get out-of-sync with older php versions; this happens in both subtle and not-subtle ways, eg
- ftp_alloc takes a
resource in php 8.1 and an FTP\Connection in 8.2+ -- because we're based on the current docs, we generate code that says "we need an FTP\Connection" -- so this function will crash with a type incompatibility if anybody tried to run it on 8.1
- the fix for this would be to add a manual override for all these functions which accepts
resource|FTP\Connection as input. Going through not just the current docs but also historic versions of docs to see which functions changed parameter types, and manually supporting all of those, seems like a nightmare which would inevitably fail due to human error.
- the current stdlib has a function with a return type of
true, which php 8.1 treats as a syntax error
- we have a hack to replace
true with bool
Given that supporting a wider range of versions becomes exponentially harder, what range do we want to support?
The PHP standard library is constantly changing, and our generated code changes with it, which means that we naturally get out-of-sync with older php versions; this happens in both subtle and not-subtle ways, eg
resourcein php 8.1 and anFTP\Connectionin 8.2+ -- because we're based on the current docs, we generate code that says "we need anFTP\Connection" -- so this function will crash with a type incompatibility if anybody tried to run it on 8.1resource|FTP\Connectionas input. Going through not just the current docs but also historic versions of docs to see which functions changed parameter types, and manually supporting all of those, seems like a nightmare which would inevitably fail due to human error.true, which php 8.1 treats as a syntax errortruewithboolGiven that supporting a wider range of versions becomes exponentially harder, what range do we want to support?