1
0
mirror of https://github.com/dg/dibi.git synced 2025-02-23 10:26:21 +01:00
php-dibi/tests/dibi/HashMap.phpt
Miloslav Hůla 0c09ad97ca HasmMap: fixed empty property name access
Introduced by 3891625cd1a1cb063486b3d62f3d2846699c906a

PostgreSQL uses '::' syntax for type casting. Before this fix, HashMap returned ':\xff:' during SQL translation/substitution.
2017-08-05 13:33:36 +02:00

15 lines
226 B
PHP

<?php
declare(strict_types=1);
use Tester\Assert;
require __DIR__ . '/bootstrap.php';
$hash = new Dibi\HashMap(function ($v) {
return "b-$v-e";
});
Assert::same('b-X-e', $hash->{'X'});
Assert::same('b--e', $hash->{''});