1--TEST--
2Some string offset errors
3--FILE--
4<?php
5
6function &test() : string {
7    $str = "foo";
8    return $str[0];
9}
10
11try {
12    test();
13} catch (Error $e) {
14    echo $e->getMessage(), "\n";
15}
16
17try {
18    $str = "foo";
19    $str[0] =& $str[1];
20} catch (Error $e) {
21    echo $e->getMessage(), "\n";
22}
23
24?>
25--EXPECT--
26Cannot return string offsets by reference
27Cannot create references to/from string offsets
28