# isFloat throws AssertionError

**URL:** <https://discourse.laminas.dev/t/isfloat-throws-assertionerror/3522>\
**Category:** Components & MVC\
**Tags:** laminas-i18n\
**Created:** [November 6, 2023, 6:46pm UTC](https://discourse.laminas.dev/t/isfloat-throws-assertionerror/3522 "2023-11-06T18:46:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![williamgall](https://avatars.discourse-cdn.com/v4/letter/w/b77776/32.png) [@williamgall](https://discourse.laminas.dev/u/williamgall)\
**Post date:** [November 6, 2023, 6:46pm UTC](https://discourse.laminas.dev/t/isfloat-throws-assertionerror/3522/1 "2023-11-06T18:46:28Z")

</div>

After updating my applications dependencies this morning i started getting this error when a validator chain contains isFLoat

AssertionError

File:

```
/var/www/eap/vendor/laminas/laminas-i18n/src/Validator/IsFloat.php:242

```

Message:

```
assert($lastStringGroup !== '')

```

my validator and filter chain are set in the getInputFilterSpecification of my form like so:

```auto
 [
    'name' => 'min_gpa',
    'validators' => [
        [
            'name' => 'NotEmpty',
        ],
        [
            'name' => 'IsFloat',
            
        ],
    ],
    'filters' => [
        ['name' => StripTags::class],
        ['name' => StringTrim::class],
    ],
],

```

Before today if it was empty it would say “a value is required”. now i get the exception.

Any help would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![froschdesign](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/froschdesign/32/38_2.png) [@froschdesign](https://discourse.laminas.dev/u/froschdesign)\
**Post date:** [November 7, 2023, 8:55am UTC](https://discourse.laminas.dev/t/isfloat-throws-assertionerror/3522/2 "2023-11-07T08:55:08Z")

</div>

Can you give an example value that can be used to reproduce the problem?

---

<div class="post-metadata">

**Author:** ![williamgall](https://avatars.discourse-cdn.com/v4/letter/w/b77776/32.png) [@williamgall](https://discourse.laminas.dev/u/williamgall)\
**Post date:** [November 7, 2023, 12:46pm UTC](https://discourse.laminas.dev/t/isfloat-throws-assertionerror/3522/3 "2023-11-07T12:46:53Z")

</div>

If the field min\_gpa is blank it used to return the Value is required. Now if its blank it throws the Assertion Error. It also Doesn’t matter if i put the NotEmpty before or after the isFloat.

---

<div class="post-metadata">

**Author:** ![froschdesign](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/froschdesign/32/38_2.png) [@froschdesign](https://discourse.laminas.dev/u/froschdesign)\
**Post date:** [November 8, 2023, 8:59am UTC](https://discourse.laminas.dev/t/isfloat-throws-assertionerror/3522/4 "2023-11-08T08:59:23Z")

</div>

My mistake, I had overlooked the fact that it was an empty string.

Please perform an update via Composer:

> **[Release 2.24.1 · laminas/laminas-i18n](https://github.com/laminas/laminas-i18n/releases/tag/2.24.1)**
>
> Release Notes for 2.24.1
> 2.24.x bugfix release (patch)
> 2.24.1
> 
> Total issues resolved: 0
> Total pull requests resolved: 1
> Total contributors: 1
> 
> Bug
> 
> 110: IsFloat validator should return a standard e...

---

<div class="post-metadata">

**Author:** ![williamgall](https://avatars.discourse-cdn.com/v4/letter/w/b77776/32.png) [@williamgall](https://discourse.laminas.dev/u/williamgall)\
**Post date:** [November 9, 2023, 1:22pm UTC](https://discourse.laminas.dev/t/isfloat-throws-assertionerror/3522/5 "2023-11-09T13:22:27Z")

</div>

the patch fixed the issue thank you.
