One of the reasons why this hasn’t been implemented yet in Program O (aside from the reasons mentioned previously) is that utilization of things like sets and maps will require a major refactoring of the code throughout the entire Program O script, and a fundamental redesign of it’s core code. This is pretty much a larger undertaking than I’m able to take on at present.
That said, however, if you’re highly proficient with Object Oriented Programming in both PHP AND Java, you might consider contributing to Program O’s version 3 on GitHub, which is partially a port of Program AB from Java to PHP. The idea isn’t to do a complete port of the entire script, but only of the core algorithms that handle processing the AIML files. I’ve been working on this on and off ever since Rich Wallace and Pandorabots released the source code for Program AB several years ago, but I’m not all that skilled in Java, so I haven’t made a whole lot of progress, and frankly could use the help.