1--TEST-- 2Using string offset as object 3--FILE-- 4<?php 5 6$str = "x"; 7try { 8 $str[0]->bar = "xyz"; 9} catch (Error $e) { 10 echo $e->getMessage(), "\n"; 11} 12try { 13 $str[0]->bar[1] = "bang"; 14} catch (Error $e) { 15 echo $e->getMessage(), "\n"; 16} 17try { 18 $str[0]->bar += 1; 19} catch (Error $e) { 20 echo $e->getMessage(), "\n"; 21} 22try { 23 $str[0]->bar = &$b; 24} catch (Error $e) { 25 echo $e->getMessage(), "\n"; 26} 27try { 28 ++$str[0]->bar; 29} catch (Error $e) { 30 echo $e->getMessage(), "\n"; 31} 32try { 33 --$str[0]->bar; 34} catch (Error $e) { 35 echo $e->getMessage(), "\n"; 36} 37try { 38 $str[0]->bar++; 39} catch (Error $e) { 40 echo $e->getMessage(), "\n"; 41} 42try { 43 $str[0]->bar--; 44} catch (Error $e) { 45 echo $e->getMessage(), "\n"; 46} 47try { 48 unset($str[0]->bar); 49} catch (Error $e) { 50 echo $e->getMessage(), "\n"; 51} 52 53?> 54--EXPECT-- 55Cannot use string offset as an object 56Cannot use string offset as an object 57Cannot use string offset as an object 58Cannot use string offset as an object 59Cannot use string offset as an object 60Cannot use string offset as an object 61Cannot use string offset as an object 62Cannot use string offset as an object 63Cannot use string offset as an object 64