Skip to content

Comparison operators not working in PHP 8.3 #77

@jakespencer

Description

@jakespencer

Code

<?php

var_dump(new \Decimal\Decimal(0) == 0);
var_dump(new \Decimal\Decimal(0) > 0);

Expected Output

bool(true)
bool(false)

Actual Output

PHP Notice:  Object of class Decimal\Decimal could not be converted to int in /app/issue.php on line 3

Notice: Object of class Decimal\Decimal could not be converted to int in /app/issue.php on line 3
bool(false)
PHP Notice:  Object of class Decimal\Decimal could not be converted to int in /app/issue.php on line 4

Notice: Object of class Decimal\Decimal could not be converted to int in /app/issue.php on line 4
bool(true)

Versions

php version: 8.3.0
decimal version: 1.4.0
libmpdec version: 2.5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions