Skip to content

Instantly share code, notes, and snippets.

@rlerdorf
rlerdorf / general.php
Created November 6, 2025 23:23
Phan Demo - PHP 84, Phan v6-dev
<?php
/** @phan-file-suppress PhanUnusedPublicNoOverrideMethodParameter,PhanUnreferencedClass,PhanUnusedVariable */
class Iam { }
class GCECredentials {
/**
* @param Iam $iam [optional] An IAM instance.
* @param string|string[] $scope [optional] the scope of the access request,
* expressed either as an array or as a space-delimited string.
@rlerdorf
rlerdorf / Interface-test.php
Created November 5, 2025 01:55
Phan Demo - PHP 84, Phan v6-dev
<?php
interface Interface2 {
}
interface Interface1 extends Interface2 {
public function someMethod1();
}
@rlerdorf
rlerdorf / PropertyHooks.php
Last active October 23, 2025 00:42
Phan Demo - PHP 84, Phan v6-dev
<?php
/**
* Basic property hook tests
* @phan-file-suppress PhanUnreferencedClass, PhanUnreferencedPublicProperty, PhanUnreferencedPrivateProperty, PhanWriteOnlyPublicProperty
*/
class PropertyHookBasic {
// Simple get hook
public string $upperName {
get => strtoupper($this->upperName);
}
@rlerdorf
rlerdorf / PropertyHooks.php
Last active October 22, 2025 22:40
Phan Demo - PHP 84, Phan v6-dev
<?php
/**
* Basic property hook tests
* @phan-file-suppress PhanUnreferencedClass, PhanUnreferencedPublicProperty, PhanUnreferencedPrivateProperty, PhanWriteOnlyPublicProperty
*/
class PropertyHookBasic {
// Simple get hook
public string $upperName {
get => strtoupper($this->upperName);
}
@rlerdorf
rlerdorf / PropertyHooks.php
Last active October 22, 2025 22:33
Phan Demo - PHP 84, Phan v6-dev
<?php
/**
* Basic property hook tests
* @phan-file-suppress PhanUnreferencedClass, PhanUnreferencedPublicProperty, PhanUnreferencedPrivateProperty, PhanWriteOnlyPublicProperty
*/
class PropertyHookBasic {
// Simple get hook
public string $upperName {
get => strtoupper($this->upperName);
}
@rlerdorf
rlerdorf / index.php
Created October 16, 2025 18:39
Phan Demo - PHP 84, Phan 5.5.2
<?php
class Route {
use T;
function __construct() {
return self::A;
}
}
echo (new Route());
@rlerdorf
rlerdorf / index.php
Created October 16, 2025 18:34
Phan Demo - PHP 84, Phan 5.5.2
<?php
class Route {
use T;
function __construct() {
return self::A;
}
}
echo (new Route());
@rlerdorf
rlerdorf / index.php
Created October 16, 2025 18:28
Phan Demo - PHP 84, Phan 5.5.2
<?php
class Route {
use T;
function __construct() {
return self::A;
}
}
echo (new Route());
diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c
index 1abc4a3faf..7bc711be67 100644
--- a/src/php/ext/grpc/call.c
+++ b/src/php/ext/grpc/call.c
@@ -451,7 +451,8 @@ PHP_METHOD(Call, startBatch) {
op_num++;
PHP_GRPC_HASH_FOREACH_END()
- error = grpc_call_start_batch(call->wrapped, ops, op_num, call->wrapped,
+ grpc_call *wrapped = call->wrapped;
diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c
index 1abc4a3faf..7bc711be67 100644
--- a/src/php/ext/grpc/call.c
+++ b/src/php/ext/grpc/call.c
@@ -451,7 +451,8 @@ PHP_METHOD(Call, startBatch) {
op_num++;
PHP_GRPC_HASH_FOREACH_END()
- error = grpc_call_start_batch(call->wrapped, ops, op_num, call->wrapped,
+ grpc_call *wrapped = call->wrapped;