object of class could not be converted to string code example

object of class could not be converted to string

2

2 Examples

0
"$object" // Works fine (if $object is a string or implements the `__toString()` magic method)
"$object->field" // Works fine (if $object is not null and "field" is a stringable field of $object)
"$object->field->partial" // Doesn't work
"{$object->field->partial}" // Works
"${object->field->partial}" // Also works, variant syntax
by on

0
$password->sha512();

$result = mysql_query("SELECT * FROM `administrators` WHERE username='$username' and password='$password'");
by on

Other Code Examples