Vladislav Kaverin
Vladislav Kaverin
### Problem ```php class Var { public const A = 0x1; public const B = 0x2; } ... switch ($var) { case Var::A: return a_work(); case Var::B: return b_work(); }...
Skipping default values can significantly reduce serialized message size: ```php _main(); function _main() { $with_nulls = new FooWithNulls(42); $without_nulls = new FooWithoutNulls(42); echo 'With default values: ' . strlen(instance_serialize($with_nulls)) ....
Depends on #764. ## Problem Given there are two ways to cast a variable to some type: * For primitive types there's `(T)$v`, where `T` is a primitive type. *...
`constexpr` for `switch` was supported in #727 and #770. ## The problem Consider following snippet ```php f(new Foo()); /** * @kphp-generic T * @param T $o */ function f($o) {...
```php /** * @kphp-generic T * @param class-string $t */ function foo($t) { } foo('int'); ``` Compilation of this code fails with ``` Starting php to cpp transpiling... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Compilation...
Consider following example: ```php
```php _main(); function _main() { /** @var I $i */ $i = new A(42); instance_serialize($i); } interface I {} /** @kphp-serializable */ class A implements I{ /** @kphp-serialized-field 1 */...
If `instance_serialize` accepts `$this` in method inherited from abstract class, then all fields of child class are just ignored. Code to reproduce: ```php $b = new B(42, 'hello, world!'); $b->serialize();...
**Is your feature request related to a problem? Please describe.** Currently, it's forbidden to put multiple `@path`s for single rule. Rule like ```php /** * @warning Do not use `foo()`!...