The abusefilter array test failed because length( ['a', 'b', 'c'] )
returned 12 instead of 6. That was du to it converted the array
to a string with new line seperated values first before measuring
the string length. Changed that behaviour to act like the php count()
function or the python len() function which seems far more useful to me.
The old behaviour can be established using length( string( array ) ).
Change-Id: I16646891837c9743ca5af2dd328077a7225bb5f1
* Use strcspn to scan ahead for long regions of uninteresting text in string handling (performance).
* Remove cruft specific to my system in phpTest.php.
* Remove a test that was in incorrect syntax, and useless without adding variable support.
I've made it more performant and fixed a few bugs by using regexes
instead of PHP loops, where possible, under the assumption that the
PCRE parser is more efficient than the same thing implemented in pure PHP.
Also, I'm now passing the same string around and calculating offsets, which
Tim tells me is far more performant than continually truncating the same string.
All tests still pass, with the exception of string.t, which I've modified
to remove the offending code, which never worked.
* Fix some notices
* Add if-then-else and ternary operator
* Fix ordering of operators
* Skip whitespace.t till test runner will be fixed
* Still lacks dates and correct Unicode string handling
* Re-add, per Brion's request.
* Add an easy PHP tester, to run the tests used for the native parser.
* Update to pass 20 tests out of 27. Still to go:
** Implement dates.
** Fix order of operations.
** Fix backslash parsing.
** Implement if-then-else and ternery operator.