Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix undefined sleep() function due to autoloading issue #390

Merged

Conversation

colinodell
Copy link
Contributor

PR #387 moved the now-deprecated sleep() function into a new deprecated/misc.php file. However, this file is not present in the autoloader configuration, resulting in this fatal error when using v2.3.0:

PHP Fatal error:  Uncaught Error: Call to undefined function Safe\sleep()

Adding deprecated/misc.php seems to fix this, as tested with this simple script:

<?php

require_once 'vendor/autoload.php';

use function Safe\sleep;

sleep(1);

@colinodell colinodell changed the title Fix missing sleep() function Fix undefined sleep() function due to autoloading issue Sep 15, 2022
@Kharhamel
Copy link
Collaborator

Oops, sorry

@Kharhamel
Copy link
Collaborator

The CI only failed because of the regenerated file, I am going to ignore it and merge

@Kharhamel Kharhamel merged commit b141ff5 into thecodingmachine:master Sep 20, 2022
@Kharhamel
Copy link
Collaborator

This is deployed in v2.3.1. Thanks for the fix.

@colinodell colinodell deleted the fix-missing-safe-function branch September 20, 2022 14:10
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants