-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compile unsupported phpt tests (#1098)
Compile unsupported phpt test in k2 mode. Continuation of #1093
- Loading branch information
1 parent
3b0a9d6
commit 755b06b
Showing
43 changed files
with
554 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
/** @kphp-generate-stub-class */ | ||
interface Memcache { | ||
public function get (string|string[] $key) ::: mixed; | ||
public function delete (string $key) ::: bool; | ||
public function add (string $key, mixed $value, int $flags = 0, int $expire = 0) ::: bool; | ||
public function set (string $key, mixed $value, int $flags = 0, int $expire = 0) ::: bool; | ||
public function replace (string $key, mixed $value, int $flags = 0, int $expire = 0) ::: bool; | ||
public function decrement (string $key, int $v = 1) ::: mixed; | ||
public function increment (string $key, int $v = 1) ::: mixed; | ||
public function getVersion () ::: mixed; | ||
|
||
// this two functions shouldn't be there, but we need it to rewrite code | ||
public function addServer (string $host, int $port = 11211, bool $persistent = true, int $weight = 1, float $timeout = 1, int $retry_interval = 15, bool $status = true, mixed $failure_callback = null, int $timeoutms = 0) ::: bool; | ||
public function rpc_connect (string $host, int $port, mixed $default_actor_id = 0, float $timeout = 0.3, float $connect_timeout = 0.3, float $reconnect_timeout = 17.0) ::: bool; | ||
} | ||
|
||
|
||
/** @kphp-generate-stub-class */ | ||
final class McMemcache implements Memcache { | ||
/** @kphp-extern-func-info generate-stub */ | ||
public function __construct() ::: McMemcache; | ||
|
||
/** @kphp-extern-func-info generate-stub */ | ||
public function get (string|string[] $key) ::: mixed; | ||
/** @kphp-extern-func-info generate-stub */ | ||
public function delete (string $key) ::: bool; | ||
/** @kphp-extern-func-info generate-stub */ | ||
public function add (string $key, mixed $value, int $flags = 0, int $expire = 0) ::: bool; | ||
/** @kphp-extern-func-info generate-stub */ | ||
public function set (string $key, mixed $value, int $flags = 0, int $expire = 0) ::: bool; | ||
/** @kphp-extern-func-info generate-stub */ | ||
public function replace (string $key, mixed $value, int $flags = 0, int $expire = 0) ::: bool; | ||
/** @kphp-extern-func-info generate-stub */ | ||
public function decrement (string $key, int $v = 1) ::: mixed; | ||
/** @kphp-extern-func-info generate-stub */ | ||
public function increment (string $key, int $v = 1) ::: mixed; | ||
/** @kphp-extern-func-info generate-stub */ | ||
public function getVersion () ::: mixed; | ||
/** @kphp-extern-func-info generate-stub */ | ||
public function addServer (string $host, int $port = 11211, bool $persistent = true, int $weight = 1, float $timeout = 1, int $retry_interval = 15, bool $status = true, mixed $failure_callback = null, int $timeoutms = 0) ::: bool; | ||
|
||
/** @kphp-extern-func-info generate-stub */ | ||
public function rpc_connect (string $host, int $port, mixed $default_actor_id = 0, float $timeout = 0.3, float $connect_timeout = 0.3, float $reconnect_timeout = 17.0) ::: bool; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?php | ||
|
||
/** @kphp-generate-stub-class */ | ||
class ArithmeticError extends Error {} | ||
/** @kphp-generate-stub-class */ | ||
class DivisionByZeroError extends ArithmeticError {} | ||
/** @kphp-generate-stub-class */ | ||
class AssertionError extends Error {} | ||
/** @kphp-generate-stub-class */ | ||
class CompileError extends Error {} | ||
/** @kphp-generate-stub-class */ | ||
class ParseError extends CompileError {} | ||
/** @kphp-generate-stub-class */ | ||
class TypeError extends Error {} | ||
/** @kphp-generate-stub-class */ | ||
class ArgumentCountError extends TypeError {} | ||
/** @kphp-generate-stub-class */ | ||
class ValueError extends Error {} | ||
/** @kphp-generate-stub-class */ | ||
class UnhandledMatchError extends Error {} | ||
|
||
/** @kphp-generate-stub-class */ | ||
class LogicException extends Exception {} | ||
/** @kphp-generate-stub-class */ | ||
class BadFunctionCallException extends LogicException {} | ||
/** @kphp-generate-stub-class */ | ||
class BadMethodCallException extends BadFunctionCallException {} | ||
/** @kphp-generate-stub-class */ | ||
class DomainException extends LogicException {} | ||
/** @kphp-generate-stub-class */ | ||
class InvalidArgumentException extends LogicException {} | ||
/** @kphp-generate-stub-class */ | ||
class LengthException extends LogicException {} | ||
/** @kphp-generate-stub-class */ | ||
class OutOfRangeException extends LogicException {} | ||
|
||
/** @kphp-generate-stub-class */ | ||
class RuntimeException extends Exception {} | ||
/** @kphp-generate-stub-class */ | ||
class OutOfBoundsException extends RuntimeException {} | ||
/** @kphp-generate-stub-class */ | ||
class OverflowException extends RuntimeException {} | ||
/** @kphp-generate-stub-class */ | ||
class RangeException extends RuntimeException {} | ||
/** @kphp-generate-stub-class */ | ||
class UnderflowException extends RuntimeException {} | ||
/** @kphp-generate-stub-class */ | ||
class UnexpectedValueException extends RuntimeException {} | ||
|
||
/** @kphp-generate-stub-class */ | ||
class Random\RandomException extends Exception {} | ||
|
||
// https://www.php.net/manual/en/class.arrayiterator.php | ||
// TODO: make it work with T[] arrays when generic classes are available. | ||
// For now, it only supports mixed[]. | ||
/** @kphp-generate-stub-class */ | ||
final class ArrayIterator { | ||
/** @kphp-extern-func-info generate-stub */ | ||
public function __construct($arr ::: mixed[]); | ||
|
||
/** @kphp-extern-func-info generate-stub */ | ||
public function count(): int; | ||
|
||
/** @kphp-extern-func-info generate-stub */ | ||
public function current(): mixed; | ||
|
||
/** @kphp-extern-func-info generate-stub */ | ||
public function key(): mixed; | ||
|
||
/** @kphp-extern-func-info generate-stub */ | ||
public function next(): void; | ||
|
||
/** @kphp-extern-func-info generate-stub */ | ||
public function valid(): bool; | ||
} |
Oops, something went wrong.