19562faabc
This was leading to people getting (int)&some_null_variant as the result of strlen. I think this came about when we implemented the 5.4 strlen semantics (we stopped returning 5 for strlen(array()), etc.)
35 linhas
476 B
PHP
35 linhas
476 B
PHP
<?php
|
|
|
|
function none() {}
|
|
set_error_handler('none');
|
|
|
|
class Foo {
|
|
}
|
|
|
|
function asdf($pattern) {
|
|
$len = strlen($pattern);
|
|
$len--;
|
|
echo $len;
|
|
echo "\n";
|
|
}
|
|
|
|
function main() {
|
|
$foo = new Foo();
|
|
for ($i=0; $i<100; $i++) {
|
|
asdf(new Foo());
|
|
asdf(array());
|
|
}
|
|
}
|
|
main();
|
|
main();
|
|
|
|
function main2() {
|
|
echo "foo: " .strlen($x)."\n";
|
|
echo "foo: " .strlen(true)."\n";
|
|
echo "foo: " .strlen(NULL)."\n";
|
|
echo "foo: " .strlen(false)."\n";
|
|
}
|
|
main2();
|
|
|
|
echo "done\n";
|