Revision 5351516d3e9b77fe4b0225c0b52883a718c4c0be authored by Andrew Brown on 12 November 2019, 14:40:39 UTC, committed by Taylor Otwell on 12 November 2019, 14:40:39 UTC
for attributes that are cast to any type of Object, the strict equivalency (`===`) will never return `true`, because even though the values may be equal, the Object there reference will be different.

this changes checks if the cast type is either `object` or `collection`, both with return Objects, and uses loose equivalency to compare them.

even though date casting also returns an Object, we don't need to handle that since it's handled in the previous conditional.

the test represents a scenario that occurs when using JSON fields in MySQL. MySQL returns the value with spaces between the elements, but `json_encode` returns a string **without** spaces between the elements.
1 parent de01f03
History
File Mode Size
Capsule
Concerns
Connectors
Console
Eloquent
Events
Migrations
Query
Schema
ConfigurationUrlParser.php -rw-r--r-- 192 bytes
Connection.php -rwxr-xr-x 30.9 KB
ConnectionInterface.php -rwxr-xr-x 3.7 KB
ConnectionResolver.php -rwxr-xr-x 1.9 KB
ConnectionResolverInterface.php -rwxr-xr-x 575 bytes
DatabaseManager.php -rwxr-xr-x 9.5 KB
DatabaseServiceProvider.php -rwxr-xr-x 2.8 KB
DetectsConcurrencyErrors.php -rw-r--r-- 1.1 KB
DetectsLostConnections.php -rw-r--r-- 1.4 KB
Grammar.php -rwxr-xr-x 5.2 KB
LICENSE.md -rw-r--r-- 1.0 KB
MigrationServiceProvider.php -rwxr-xr-x 6.0 KB
MySqlConnection.php -rwxr-xr-x 2.1 KB
PostgresConnection.php -rwxr-xr-x 1.7 KB
QueryException.php -rw-r--r-- 1.6 KB
README.md -rwxr-xr-x 2.2 KB
SQLiteConnection.php -rwxr-xr-x 2.7 KB
Seeder.php -rwxr-xr-x 3.0 KB
SqlServerConnection.php -rwxr-xr-x 3.1 KB
composer.json -rw-r--r-- 1.4 KB

README.md

back to top