Skip to content

Incorrect type error for version_compare()'s return value #427

Description

@ADmad

Verified on latest main

  • I have confirmed this bug still occurs when built from the latest main branch.

PHPantom version / commit

0.10.0

Installation method

Pre-built binary from GitHub Releases

Operating system

Linux x86_64

Editor

Zed

Bug description

Return type of version_compare() is always boolean when the $operator argument is provided.

Steps to reproduce

<?php
function foo(): bool
{
    return version_compare('a', 'b', '>=');
}

### Error output or panic trace

```text
Return type int|bool is incompatible with declared return type bool

.phpantom.toml

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions