Skip to content

using enums with Cairo/Context not working anymore under php 7.1 #34

@swen100

Description

@swen100

Hi Elizabeth,

I wanted to try out cairo under php 7.1, but suddenly i got an error. Setting the Fillrule, Antialias (or any other enum) under php 7.0.x works fine, but under 7.1 it raises an TypeError :(

<?php

$surface = new \Cairo\Surface\Image(
    \Cairo\Surface\ImageFormat::ARGB32, 1, 1
);

$context = new \Cairo\Context($surface);

// var_dump( \Cairo\FillRule::EVEN_ODD );

try {
    $context->setFillRule( \Cairo\FillRule::EVEN_ODD );
    $context->setAntialias( \Cairo\Antialias::SUBPIXEL );
} catch (\TypeError $e) {
    echo $e->getMessage(), "\n";
}

gives me:
"Value 1 provided is not a const in enum Cairo\FillRule"

Please, can u take a look at it? I would be very appriciate.

Swen

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