Derick Rethans wrote:
On Tue, 15 May 2007, Zoe Slattery wrote:

I have some updates that I'd like to make to
ext/tests/standard/array/range.phpt, the updates work fine with
unicode.semantics=off but not with unicode.semantics=on. The problem seems to
be that the warning Notices that are generated are different with unicode on.
This doesn't look like intentional behaviour but I'm guessing it might well be
something that isn't implemented yet.

So, my question is - is it reasonable/helpful to add a test in CVS that I know
will fail if it's in an area that is currently under development?

I would say that it's a good idea to commit those if you are certain that the "unicode" behavior is wrong. In other cases I suggest to write a mail to internals about it.

I've looked at this a bit more and have absolutely no idea whether the behaviour that I get is expected or not, it is certainly different. So, here is a very cutdown test case that shows the difference. Note that it's not intended to do anything sensible - I've just pulled it out of a larger test caes that executes range() with all sorts of input.

This passes fine on PHP6 with unicode.semantics=off.

--TEST--
PHP6 unicode Notices different
--FILE--
<?php
$low_arr = "ABCD";
$high_arr = array(1,2);

echo "\n-- creating an array with low = '$low_arr' and high = '$high_arr' --\n";
var_dump( range( $low_arr, $high_arr ) );

--EXPECTF--

-- creating an array with low = 'ABCD' and high = 'Array' --

Notice: Array to string conversion in %s on line %d
array(1) {
 [0]=>
 string(1) "A"
}
--UEXPECTF--

-- creating an array with low = 'ABCD' and high = 'Array' --

Notice: Array to string conversion in %s on line %d
array(1) {
 [0]=>
 unicode(1) "A"
}

Here is the actual output on PHP6

Notice: Array to string conversion in /home/zoe/TESTS/range/ztest.php on line 5

-- creating an array with low = 'ABCD' and high = 'Array' --

Notice: Array to string conversion in /home/zoe/TESTS/range/ztest.php on line 6
array(1) {
 [0]=>
 unicode(1) "A"
}

So. with unicode.semantics=on an additional Notice is generated which appears to be caused by the echo statment. Any ideas?

regards,
Derick


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to