source: src/router/php7/Zend/tests/string_offset_errors.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 3 months ago

update php

File size: 404 bytes
Line 
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
Note: See TracBrowser for help on using the repository browser.