Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fail on HHVM #54

Closed
giggsey opened this issue Mar 3, 2015 · 15 comments
Closed

Tests fail on HHVM #54

giggsey opened this issue Mar 3, 2015 · 15 comments

Comments

@giggsey
Copy link
Owner

giggsey commented Mar 3, 2015

From memory, this is an issue with the Regex used.

Need to write a simple testable script with a failing number

@joacub
Copy link

joacub commented Jan 3, 2016

in php7 fail this

@giggsey
Copy link
Owner Author

giggsey commented Jan 3, 2016

@joacub What do you mean?

@joacub
Copy link

joacub commented Jan 3, 2016

Fail macher regex expresion, return 502 error, the error not is manage

@giggsey
Copy link
Owner Author

giggsey commented Jan 3, 2016

@joacub Sorry, but this still doesn't make much sense.

Can you post a code sample that is causing an error, and the full error message you are getting.

@joacub
Copy link

joacub commented Jan 3, 2016

The cose error is :

    private function doMatch($type = 'find')
    {
        $final_pattern = '(?:' . $this->pattern . ')';
        switch ($type) {
            case 'matches':
                $final_pattern = '^' . $final_pattern . '$';
                break;
            case 'lookingAt':
                $final_pattern = '^' . $final_pattern;
                break;
            case 'find':
            default:
                // no changes       
                break;
        }
        $final_pattern = '/' . $final_pattern . '/x';
        return (preg_match($final_pattern, $this->subject, $this->groups, PREG_OFFSET_CAPTURE) == 1) ? true : false;
    }

The php7 not response error, php7 crashed

@giggsey
Copy link
Owner Author

giggsey commented Jan 3, 2016

What functions are you calling that get to this function? What version of PHP are you running?

@joacub
Copy link

joacub commented Jan 3, 2016

The php version is 7.0.1, test with This Number 6161217474 and in us locale

@giggsey
Copy link
Owner Author

giggsey commented Jan 3, 2016

I just upgraded the demo to support both PHP 5.6 and PHP7.

When trying your number in the PHP 7 demo, it works fine for me: http://libphonenumber-for-php.giggsey.net/?phonenumber=6161217474&country=US&language=&region= (the footer on the page shows the php version)

@joacub
Copy link

joacub commented Jan 3, 2016

How to compile php7 ? With ppa or other

@giggsey
Copy link
Owner Author

giggsey commented Jan 3, 2016

I installed it using a ppa, but that's irrelevant to this library?

@joacub
Copy link

joacub commented Jan 3, 2016

In ubuntu 15.10 is possibol pecl is corrupt or bad compile i dont now the problem but tente problem exist

@joacub
Copy link

joacub commented Jan 3, 2016

this is system message kernel: [ 1808.603216] php-fpm7.0[1920]: segfault at 10 ip 00007fa07b10d2b7 sp 00007ffeddc7e690 error 4

@joacub
Copy link

joacub commented Jan 3, 2016

the problem is library pcre, the version 8.35 in ubuntu 15.10 not run correctly, i have compile manual new version 8.37 and now perfectly regex

@giggsey
Copy link
Owner Author

giggsey commented Apr 8, 2016

I just tried running the unit tests on a local vagrant box (using hhvm version 3.10.1), and the tests passed fine.

Travis seems to be running hhvm version 3.6.6. So maybe this has actually been fixed in a recent travis version.

@giggsey
Copy link
Owner Author

giggsey commented Oct 2, 2016

Travis tests now use the latest HHVM version, so closing this issue.

@giggsey giggsey closed this as completed Oct 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants