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

Getting undefined function #27

Closed
sebbZA opened this issue Mar 9, 2015 · 13 comments
Closed

Getting undefined function #27

sebbZA opened this issue Mar 9, 2015 · 13 comments
Labels

Comments

@sebbZA
Copy link

sebbZA commented Mar 9, 2015

Hi,

When using composer to install your lib I get the following error when consuming it.
Call to undefined function React\Promise\resolve()

Any idea what could be causing this?

@jsor
Copy link
Member

jsor commented Mar 9, 2015

Could you provide a little bit more context? Maybe the full stacktrace or at least the file and line where the error happens. And ideally a reproducible test case with composer.json etc.

@jsor
Copy link
Member

jsor commented Apr 10, 2015

I'm closing this for now, feel free to reopen if you still have questions.

@jsor jsor closed this as completed Apr 10, 2015
@sebbZA
Copy link
Author

sebbZA commented Apr 10, 2015

Thanks
On 10 Apr 2015 9:30 AM, "Jan Sorgalla" notifications@github.com wrote:

I'm closing this for now, feel free to reopen if you still have questions.


Reply to this email directly or view it on GitHub
#27 (comment).

@ankitapage
Copy link

Hi,
I got the same error "Call to undefined function React\Promise\resolve()" and its in file "FatalErrorException in Promise.php line 128".
Can you please tell me what is causing this error.

Thanks.

@sebbZA
Copy link
Author

sebbZA commented May 29, 2015

Hi,

Make sure your composer autoload class is loading this library correctly.
On 29 May 2015 11:27 AM, "ankitapage" notifications@github.com wrote:

Hi,
I got the same error "Call to undefined function React\Promise\resolve()"
and its in file "FatalErrorException in Promise.php line 128".
Can you please tell me what is causing this error.

Thanks.


Reply to this email directly or view it on GitHub
#27 (comment).

@jsor
Copy link
Member

jsor commented May 29, 2015

If you're using a custom autoloader, make sure you include the functions.php.

@ankitapage
Copy link

@domagala Thanks, got its resolved.
@jsor Thanks to u 2.

@danielecr
Copy link
Contributor

please: document
HOW do include functions.php, where?
I am using autoload.php generated by composer, is it a "custom" autoloader?

@WyriHaximus
Copy link
Member

@danielecr It's loaded through functions_include.php by composer: https://github.com/reactphp/promise/blob/master/composer.json#L18

@danielecr
Copy link
Contributor

sorry, maybe I need more sleep, but in documentation (README.md) it is written:

$promise = React\Promise\FulfilledPromise($value);

and I was doing just that, not

$promise = new React\Promise\FulfilledPromise($value);

or it is due to newer php to be pedant on this? I am not a php lover, I just use it

@WyriHaximus
Copy link
Member

$promise = new React\Promise\FulfilledPromise($value);

or it is due to newer php to be pedant on this? I am not a php lover, I just use it

Well that is indeed the correct way to write it. That's not a function but a class and the missing new is an error on our side. Could you open a PR fixing it for that line and for the RejectedPromise right below it?

danielecr added a commit to danielecr/promise that referenced this issue Jul 26, 2019
for React\Promise\FulfilledPromise and React\Promise\RejectedPromise
rif reactphp#27
@danielecr
Copy link
Contributor

@WyriHaximus #145 is still waiting

@WyriHaximus
Copy link
Member

@danielecr Indeed it is

@clue clue added the question label Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants