mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
b743cd72d0
In this case the user may be a FREE.
Also add the test file that I forgot in
3ce472d1a6
.
64 lines
1.2 KiB
PHP
64 lines
1.2 KiB
PHP
--TEST--
|
|
Using string offset as object
|
|
--FILE--
|
|
<?php
|
|
|
|
$str = "x";
|
|
try {
|
|
$str[0]->bar = "xyz";
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
try {
|
|
$str[0]->bar[1] = "bang";
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
try {
|
|
$str[0]->bar += 1;
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
try {
|
|
$str[0]->bar = &$b;
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
try {
|
|
++$str[0]->bar;
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
try {
|
|
--$str[0]->bar;
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
try {
|
|
$str[0]->bar++;
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
try {
|
|
$str[0]->bar--;
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
try {
|
|
unset($str[0]->bar);
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
Cannot use string offset as an object
|
|
Cannot use string offset as an object
|
|
Cannot use string offset as an object
|
|
Cannot use string offset as an object
|
|
Cannot use string offset as an object
|
|
Cannot use string offset as an object
|
|
Cannot use string offset as an object
|
|
Cannot use string offset as an object
|
|
Cannot use string offset as an object
|