ZF-4463: Object of class stdClass could not be converted to string in Zend\Validate\Abstract.php

Description

Passing an object as an argument to isValid method causes "Catchable fatal error" fired in Zend_Validate_Abstract class on line 205.

Example: $validateBools = new Zend_Validate_InArray(array( true, false, 'true', 'false', '1', '0', 't', 'f'), true); var_dump($validateBools->isValid(new stdClass()));

Result: Catchable fatal error: Object of class stdClass could not be converted to string in Zend/Validate/Abstract.php on line 205

Expected Result: bool(false)

Comments

Fixed with r13114

It seems it's not actually an issue.

stdClass objects can't be converted to strings. Try:


$obj = new stdClass();
echo (string)$obj;

Fix causes another problem - [ZF-5232].

Fixed