> > There could be OOP-style alternatives too, e.g. Rust has a PathBuf struct > with methods that are used to build paths. > However if we were to choose this route then we need to be aware that > interoperability with existing filesystem functions would be much harder > because they all work directly with strings at the moment. >
I think we really could use such an API. I would have liked a more OOP-style approach, because it can impactfully "consolidate" various functions into one. I really like NodeJS Path class (https://nodejs.org/api/path.html), which I think have done a really nice job at making it simple while being quite versatile even for remote system paths. In PHP land, the now-abandoned path-util (https://packagist.org/packages/webmozart/path-util) library also had an intuitive API. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php