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

PHP 8.4.0alpha1 compatibility #135

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/php_http_message_body.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@

#include "php_http_api.h"

#if PHP_VERSION_ID < 80400
#include "ext/standard/php_lcg.h"
#else
#include "ext/random/php_random.h"
#endif

#define BOUNDARY_OPEN(body) \
do {\
Expand Down
4 changes: 4 additions & 0 deletions src/php_http_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@

#include "php_http_api.h"

#if PHP_VERSION_ID < 80400
#include "ext/standard/php_lcg.h"
#else
#include "ext/random/php_random.h"
#endif
#include "zend_exceptions.h"

/* SLEEP */
Expand Down
2 changes: 1 addition & 1 deletion tests/client002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ echo "Test\n";
class Observer implements SplObserver
{
#[ReturnTypeWillChange]
function update(SplSubject $client, http\Client\Request $request = null, StdClass $progress = null) {
function update(SplSubject $client, ?http\Client\Request $request = null, ?StdClass $progress = null) {
echo "P";
/* fence against buggy infof() calls in some curl versions */
$compare = $client->getProgressInfo($request);
Expand Down
2 changes: 1 addition & 1 deletion tests/client028.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class UserHandler implements http\Client\Curl\User
return count($this->client);
}

function wait(int $timeout_ms = null) {
function wait(?int $timeout_ms = null) {
echo "W";

if ($timeout_ms === null) {
Expand Down
4 changes: 2 additions & 2 deletions tests/info002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ Test
http\Exception\BadMessageException: http\Message::__construct(): Failed to parse headers: unexpected character '\057' at pos 4 of 'HTTP/1.1 99 Apples in my Basket' in %sinfo002.php:%d
Stack trace:
#0 %sinfo002.php(%d): http\Message->__construct('HTTP/1.1 99 App...')
#1 %sinfo002.php(%d): {closure}()
#1 %sinfo002.php(%d): {closur%s}()
#2 %sinfo002.php(%d): trap(Object(Closure))
#3 {main}
http\Exception\BadMessageException: http\Message::__construct(): Failed to parse headers: unexpected character '\040' at pos 7 of 'CONNECT HTTP/1.1' in %sinfo002.php:%d
Stack trace:
#0 %sinfo002.php(%d): http\Message->__construct('CONNECT HTTP/1....')
#1 %sinfo002.php(%d): {closure}()
#1 %sinfo002.php(%d): {closur%s}()
#2 %sinfo002.php(%d): trap(Object(Closure))
#3 {main}
HTTP/1.1 200
Expand Down
Loading