Files
php-src/ext/zend_test/object_handlers.stub.php
Gina Peter Banyard a479ed7cc5 Zend: Add tests for offsets and containers (#12723)
Add various tests showcasing the behavioural variations of different offset types used on various container types in all possible operations:
 - Read
 - Write
 - Read Write
 - Appending
 - Unsetting
 - Existence checks with isset()/empty/null coalesce operator
 - Behaviour of nesting dimensions (e.g. $container[$offset1][$offset2])

Add a test to ensure compile time and runtime behaviour is identical for offsets.

Add an internal class that overloads the dimension object handlers to zend_test
2024-01-25 15:06:59 +00:00

36 lines
798 B
PHP

<?php
/**
* @generate-class-entries static
* @undocumentable
*/
final class DoOperationNoCast {
private int $val;
public function __construct(int $val) {}
}
final class LongCastableNoOperations {
private int $val;
public function __construct(int $val) {}
}
final class FloatCastableNoOperations {
private float $val;
public function __construct(float $val) {}
}
final class NumericCastableNoOperations {
private int|float $val;
public function __construct(int|float $val) {}
}
class DimensionHandlersNoArrayAccess {
public bool $read = false;
public bool $write = false;
public bool $has = false;
public bool $unset = false;
public int $readType;
public bool $hasOffset = false;
public int $checkEmpty;
public mixed $offset;
}