Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
To reproduce "PHP Fatal error: Cannot create references to/from string offsets nor overloaded objects"
<?php
$widgets = array();
$widgets['a'] = 'hello';
print($widgets['a'][0]); // show 'h'
print("\n");
$o = & $widgets['a'][0]; // Show "Cannot create references to/from string offsets"
//print($o);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment