<?php
var_dump(range([], []));
echo "Range will ignore any byte after the first one\n";
var_dump( range("AA", "BB") );
echo "Range cannot operate on an empty string\n";
var_dump( range("Z", "") ); // Both strings are cast to int, i.e. 0
var_dump( range("", "Z") ); // Both strings are cast to int, i.e. 0
echo "Mixing numeric string and character\n";
var_dump( range("1", "A") ); // The char is cast to an int, i.e. 0
var_dump( range("?", "1") ); // The char is cast to an int, i.e. 0
var_dump( range("3.5", "A") ); // The char is cast to a float, i.e. 0
var_dump( range("?", "3.5") ); // The char is cast to a float, i.e. 0
echo "Fractional step cannot be used on character ranges\n";
var_dump( range("A", "H", 2.6) ); // Because step is fractional it tries to interpret inputs as floats
Fatal error: Uncaught TypeError: range(): Argument #1 ($start) must be of type string|int|float, array given in /in/XqeoP:3
Stack trace:
#0 /in/XqeoP(3): range(Array, Array)
#1 {main}
thrown in /in/XqeoP on line 3
Process exited with code 255.