key = Z_STRVAL_P(zoffset);
key_len = Z_STRLEN_P(zoffset);
break;
+ case IS_OBJECT:
+ convert_to_string_ex(&zoffset);
+ key = Z_STRVAL_P(zoffset);
+ key_len = Z_STRLEN_P(zoffset);
+ break;
default:
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The key should be either a string or an integer");
RETURN_FALSE;
);
var_dump(array_column($mismatchedColumns, 'c'));
+echo "\n*** Testing use of object converted to string ***\n";
+class Foo
+{
+ public function __toString()
+ {
+ return 'last_name';
+ }
+}
+$f = new Foo();
+var_dump(array_column($records, $f));
+
echo "Done\n";
?>
--EXPECTF--
[0]=>
string(3) "qux"
}
+
+*** Testing use of object converted to string ***
+array(3) {
+ [0]=>
+ string(3) "Doe"
+ [1]=>
+ string(5) "Smith"
+ [2]=>
+ string(5) "Jones"
+}
Done