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

Trying to access array offset on value of type int #143

Open
jackzp opened this issue Feb 12, 2020 · 6 comments · May be fixed by #145
Open

Trying to access array offset on value of type int #143

jackzp opened this issue Feb 12, 2020 · 6 comments · May be fixed by #145

Comments

@jackzp
Copy link

jackzp commented Feb 12, 2020

if url have port in it , php will have this error

$url = "http://localhost:3000";
$response = Unirest\Request::get($url, $headers);

A PHP Error was encountered
Severity: Notice

Message: Trying to access array offset on value of type int

Filename: Unirest/Request.php

Line Number: 555

Backtrace:

File: /Users/jack/Documents/html/vendor/mashape/unirest-php/src/Unirest/Request.php
Line: 555
Function: _error_handler

File: /Users/jack/Documents/html/vendor/mashape/unirest-php/src/Unirest/Request.php
Line: 417
Function: encodeUrl

File: /Users/jack/Documents/html/vendor/mashape/unirest-php/src/Unirest/Request.php
Line: 236
Function: send

@Amurmurmur
Copy link

+1

@loverg-c
Copy link

+1 since upgrade to php 7.4

@loverg-c
Copy link

loverg-c commented Feb 25, 2020

I just createed a pull request for this one,

If you use composer, you can add/change your composer.json with this :
mashape/unirest-php": "^3.0.5", or mashape/unirest-php": "dev-master",
then add

 "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/loverg-c/unirest-php"
        }
    ],

and finally composer update

@amaraa019
Copy link

I just createed a pull request for this one,

If you use composer, you can add/change your composer.json with this :
mashape/unirest-php": "^3.0.5", or mashape/unirest-php": "dev-master",
then add

 "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/loverg-c/unirest-php"
        }
    ],

and finally composer update

Thank you so much. You're genius

@senter-logistics
Copy link

i got this error with php 7.4. Try to downgrade to 7.3

@Vahanerevan
Copy link

+1

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

Successfully merging a pull request may close this issue.

6 participants