Пример запроса (первая клетка). System одинаковый во всех запросах прогона, user — свой вопрос для каждой клетки:
| Клетка | Тема | Утверждение | Ответ |
Результат | Обоснование |
T01-L1 3.21 c | Syntax and operators | Double-quoted and single-quoted strings are processed identically; the difference is only in speed. | «no» Пояснение: Double-quoted strings undergo variable interpolation and escape sequence processing while single-quoted strings are treated almost literally, so they are not processed identically and the difference is about processing, not just speed.
Raw{"answer": "no", "explanation": "Double-quoted strings undergo variable interpolation and escape sequence processing while single-quoted strings are treated almost literally, so they are not processed identically and the difference is about processing, not just speed."} | верно | В двойных кавычках работают интерполяция переменных и escape-последовательности, в одинарных — нет. |
T01-L2 0.16 c | Syntax and operators | The ?? operator follows isset semantics and raises no warnings for undefined variables. | «yes» Пояснение: The ?? (null coalescing) operator follows isset semantics and does not raise a warning for undefined variables.
Raw{"answer": "yes", "explanation": "The ?? (null coalescing) operator follows isset semantics and does not raise a warning for undefined variables."} | верно | ?? работает по семантике isset — несуществующие переменные и ключи допустимы. |
T01-L3 0.2 c | Syntax and operators | What will this print: echo 'a', 'b'; | «ab» Пояснение: In PHP, the comma inside echo is a statement separator, not an argument delimiter, so multiple strings are output consecutively without a separator, printing 'ab'.
Raw{"answer": "ab", "explanation": "In PHP, the comma inside echo is a statement separator, not an argument delimiter, so multiple strings are output consecutively without a separator, printing 'ab'."} | верно | echo принимает список аргументов: ab. |
T01-L4 0.2 c | Syntax and operators | print returns the value 1 and can be used inside an expression. | «no» Пояснение: print always returns 1, but it is not a function and cannot be used inside an expression or with multiple arguments due to operator precedence.
Raw```json ⏎ {"answer": "no", "explanation": "print always returns 1, but it is not a function and cannot be used inside an expression or with multiple arguments due to operator precedence."} ⏎ ``` | неверно верный: «yes» | print — выражение со значением 1, в отличие от echo, который значения не возвращает. |
T01-L5 0.17 c | Syntax and operators | The ?: (elvis) operator returns its left operand when it is falsy. | «no» Пояснение: The ?: (elvis) operator returns its left operand when it is truthy and the right operand when it is falsy.
Raw{"answer": "no", "explanation": "The ?: (elvis) operator returns its left operand when it is truthy and the right operand when it is falsy."} | верно | Наоборот: $a ?: $b возвращает $a, если он истинный, иначе $b. |
T01-L6 0.17 c | Syntax and operators | In PHP 8, the concatenation operator (.) has lower precedence than addition and subtraction. | «no» Пояснение: In PHP, the concatenation operator (.) actually has higher precedence than addition and subtraction, not lower.
Raw```json ⏎ {"answer": "false", "explanation": "In PHP, the concatenation operator (.) actually has higher precedence than addition and subtraction, not lower."} ⏎ ``` | неверно верный: «yes» | С PHP 8 (RFC concat precedence) '.' имеет приоритет ниже арифметики: 'сумма: ' . 2 + 3 → 'сумма: 5' (в PHP 7 было иначе). |
T01-L7 0.27 c | Syntax and operators | The expression 2 ** 3 ** 2 in PHP evaluates as (2 ** 3) ** 2, that is, 64. | «no» Пояснение: The exponentiation operator ** in PHP is right-associative, so 2 ** 3 ** 2 evaluates as 2 ** (3 ** 2), which equals 512, not (2 ** 3) ** 2 = 64.
Raw{"answer": "no", "explanation": "The exponentiation operator ** in PHP is right-associative, so 2 ** 3 ** 2 evaluates as 2 ** (3 ** 2), which equals 512, not (2 ** 3) ** 2 = 64."} | верно | ** право-ассоциативен: 2 ** (3 ** 2) = 2 ** 9 = 512. |
T01-L8 0.44 c | Syntax and operators | What string will this print: echo 'sum: ' . 2 + 3; (PHP 8)? | «3» Пояснение: Due to operator precedence, concatenation (. ) has higher priority than addition (+), so 'sum: ' . 2 evaluates to 'sum: 2' first, then 2 + 3 is computed as the string 'sum: 2' is cast to int 2, resulting in 5, but PHP 8 uses the left operand's cast giving sum: 'sum: 2' + 3 where 'sum: 2' casts to 0+3=3.
Raw{"answer": "3", "explanation": "Due to operator precedence, concatenation (. ) has higher priority than addition (+), so 'sum: ' . 2 evaluates to 'sum: 2' first, then 2 + 3 is computed as the string 'sum: 2' is cast to int 2, resulting in 5, but PHP 8 uses the left operand's cast giving sum: 'sum: 2' + 3 where 'sum: 2' casts to 0+3=3."} | неверно верный: «sum: 5» | Парная к verify-клетке про приоритет: 'сумма: 5'. |
T02-L1 0.21 c | Types and comparisons | With strict comparison (===), arrays are considered equal regardless of element order. | «no» Пояснение: With strict comparison (===), two arrays are only equal if they have the same key/value pairs in the same order, so element order matters.
Raw{"answer": "no", "explanation": "With strict comparison (===), two arrays are only equal if they have the same key/value pairs in the same order, so element order matters."} | верно | === для массивов требует совпадения и значений, и их порядка. |
T02-L2 0.2 c | Types and comparisons | The comparison 0 == false returns false because it is a strict comparison. | «no» Пояснение: The comparison 0 == false actually returns true because == performs a loose (non-strict) comparison, not a strict one, and 0 is loosely equal to false.
Raw{"answer": "no", "explanation": "The comparison 0 == false actually returns true because == performs a loose (non-strict) comparison, not a strict one, and 0 is loosely equal to false."} | верно | Наоборот: == — нестрогое сравнение и возвращает true; строгое — это === (0 === false → false). |
T02-L3 0.22 c | Types and comparisons | In PHP 8, the expression "abc" == 0 returns true. | «yes» Пояснение: In PHP, a non-numeric string compared with a number using == undergoes type juggling where "abc" is converted to 0, so "abc" == 0 evaluates to true.
Raw{"answer": "yes", "explanation": "In PHP, a non-numeric string compared with a number using == undergoes type juggling where \"abc\" is converted to 0, so \"abc\" == 0 evaluates to true."} | неверно верный: «no» | С PHP 8 нечисловая строка сравнивается как строка: "abc" == "0" → false (в PHP 7 было true). |
T02-L4 0.21 c | Types and comparisons | Under loose comparison, null equals 0, the empty string, and false at the same time. | «yes» Пояснение: Under PHP's loose comparison, null is considered equal to 0, the empty string (""), and false all at the same time due to type coercion rules.
Raw```json ⏎ {"answer": "yes", "explanation": "Under PHP's loose comparison, null is considered equal to 0, the empty string (\"\"), and false all at the same time due to type coercion rules."} ⏎ ``` | верно | null == 0, null == "" и null == false — все true. |
T02-L5 0.18 c | Types and comparisons | What does the expression (int) '42abc' return? | «42» Пояснение: In PHP, casting a string starting with digits to int extracts the leading numeric portion, so '42abc' becomes 42.
Raw{"answer": 42, "explanation": "In PHP, casting a string starting with digits to int extracts the leading numeric portion, so '42abc' becomes 42."} | верно | Ведущая числовая часть: 42, без ошибок и warning. |
T02-L6 0.21 c | Types and comparisons | What does the expression '5' + 5 return? | «10» Пояснение: In PHP, when one operand is a string that looks like a number, it is converted to a number for arithmetic, so '5' + 5 evaluates to 10.
Raw{"answer": "10", "explanation": "In PHP, when one operand is a string that looks like a number, it is converted to a number for arithmetic, so '5' + 5 evaluates to 10."} | верно | Числовая строка приводится: int 10. |
T02-L7 0.21 c | Types and comparisons | When cast to string, false becomes "0". | «no» Пояснение: When cast to string, false becomes an empty string (""), not "0" ("0" is the string representation of the integer 0).
Raw{"answer": "no", "explanation": "When cast to string, false becomes an empty string (\"\"), not \"0\" (\"0\" is the string representation of the integer 0)."} | верно | false → "", true → "1". |
T02-L8 0.26 c | Types and comparisons | The comparison 0.1 + 0.2 === 0.3 returns false. | «yes» Пояснение: Due to floating-point precision representation, 0.1 + 0.2 evaluates to 0.30000000000000004, which is not strictly identical (===) to 0.3.
Raw{"answer": "yes", "explanation": "Due to floating-point precision representation, 0.1 + 0.2 evaluates to 0.30000000000000004, which is not strictly identical (===) to 0.3."} | верно | Двоичная погрешность float: 0.1 + 0.2 = 0.30000000000000004. |
T03-L1 0.21 c | Strings | strrev() correctly reverses a UTF-8 string. | «no» Пояснение: strrev() operates on bytes, not characters, so it breaks multi-byte UTF-8 strings by reversing the byte order and producing invalid characters.
Raw{"answer": "no", "explanation": "strrev() operates on bytes, not characters, so it breaks multi-byte UTF-8 strings by reversing the byte order and producing invalid characters."} | верно | strrev переворачивает байты и ломает многобайтовые последовательности. |
T03-L2 0.16 c | Strings | str_contains('Hello world', 'world') returns true. | «yes» Пояснение: str_contains() returns true when the needle 'world' is found within the haystack 'Hello world'.
Raw{"answer": "yes", "explanation": "str_contains() returns true when the needle 'world' is found within the haystack 'Hello world'."} | верно | str_contains с PHP 8.0 проверяет вхождение подстроки. |
T03-L3 0.21 c | Strings | str_pad() can pad a string on the right side only. | «no» Пояснение: str_pad() can pad a string on the left, right, or both sides depending on the optional padding_type parameter (STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH).
Raw{"answer": "no", "explanation": "str_pad() can pad a string on the left, right, or both sides depending on the optional padding_type parameter (STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH)."} | верно | STR_PAD_LEFT / STR_PAD_BOTH меняют сторону дополнения. |
T03-L4 0.19 c | Strings | By default trim() strips only spaces, leaving tabs and newlines intact. | «no» Пояснение: By default, trim() removes all leading and trailing whitespace characters, including spaces, tabs, newlines, carriage returns, null bytes, and vertical tabs.
Raw{"answer": "false", "explanation": "By default, trim() removes all leading and trailing whitespace characters, including spaces, tabs, newlines, carriage returns, null bytes, and vertical tabs."} | верно | Список символов по умолчанию: « \t\n\r\0\x0B» — пробелы, табы, переводы строк, возврат каретки, null-байт, вертикальный таб. Проверено php -r. |
T03-L5 0.28 c | Strings | How many BYTES does strlen('héllo') return for a UTF-8 string? | «6» Пояснение: The string 'héllo' contains 5 characters, but 'é' is a multi-byte character in UTF-8 using 2 bytes, so strlen() counts 4 single-byte characters plus 2 bytes for 'é' = 6 bytes total.
Raw```json ⏎ {"answer": "6", "explanation": "The string 'héllo' contains 5 characters, but 'é' is a multi-byte character in UTF-8 using 2 bytes, so strlen() counts 4 single-byte characters plus 2 bytes for 'é' = 6 bytes total."} ⏎ ``` | верно | 6 букв по 2 байта: 12. |
T03-L6 0.2 c | Strings | What does substr('abcdef', -3) return? | «def» Пояснение: substr with a negative start position counts from the end of the string, so -3 returns the last three characters 'def'.
Raw{"answer": "def", "explanation": "substr with a negative start position counts from the end of the string, so -3 returns the last three characters 'def'."} | верно | Отрицательное смещение — с конца: def. |
T03-L7 0.21 c | Strings | ucfirst() modifies the string passed to it in place. | «no» Пояснение: ucfirst() returns a new string with the first character capitalized and does not modify the original string, as strings in PHP are immutable and the function does not use a reference parameter.
Raw{"answer": "no", "explanation": "ucfirst() returns a new string with the first character capitalized and does not modify the original string, as strings in PHP are immutable and the function does not use a reference parameter."} | верно | Строки неизменяемы; ucfirst возвращает новую строку. |
T03-L8 0.19 c | Strings | Variable interpolation works in heredoc but not in nowdoc. | «yes» Пояснение: Heredoc syntax processes variable interpolation and escape sequences like nowdoc, whereas nowdoc behaves like a single-quoted string and does not interpolate variables.
Raw{"answer": "yes", "explanation": "Heredoc syntax processes variable interpolation and escape sequences like nowdoc, whereas nowdoc behaves like a single-quoted string and does not interpolate variables."} | верно | Nowdoc — «одинарные кавычки» в тройном синтаксисе: текст как есть. |
T04-L1 0.19 c | Arrays | The sort() function preserves the key-to-value association of the array. | «no» Пояснение: The sort() function sorts the array by values and reassigns integer keys starting from 0, so it does not preserve the original key-to-value association.
Raw{"answer": "no", "explanation": "The sort() function sorts the array by values and reassigns integer keys starting from 0, so it does not preserve the original key-to-value association."} | верно | sort перенумеровывает ключи; связь сохраняет asort. |
T04-L2 0.16 c | Arrays | The string key '5' in an array is stored as the integer 5. | «yes» Пояснение: In PHP, array string keys that are valid decimal integers (like '5') are automatically converted to integers.
Raw{"answer": "true", "explanation": "In PHP, array string keys that are valid decimal integers (like '5') are automatically converted to integers."} | верно | Каноничные десятичные строковые ключи приводятся к int. |
T04-L3 0.19 c | Arrays | The in_array() function uses strict comparison (===) by default. | «no» Пояснение: The in_array() function uses loose comparison by default, and strict comparison (===) only occurs when the third optional parameter strict is explicitly set to true.
Raw{"answer": "no", "explanation": "The in_array() function uses loose comparison by default, and strict comparison (===) only occurs when the third optional parameter strict is explicitly set to true."} | верно | По умолчанию сравнение нестрогое; строгое — третий аргумент true. |
T04-L4 0.19 c | Arrays | Without a callback, array_filter() removes all "empty" (falsy) elements from the array. | «yes» Пояснение: Without a callback, array_filter() removes all falsy elements (false, 0, "", null, array()) from the array by default.
Raw{"answer": "yes", "explanation": "Without a callback, array_filter() removes all falsy elements (false, 0, \"\", null, array()) from the array by default."} | верно | Убирает 0, "", null, false и пустые массивы. |
T04-L5 0.16 c | Arrays | By default, array_slice() preserves the original numeric keys of the array. | «no» Пояснение: By default, array_slice() reindexes the numeric keys starting from 0 rather than preserving the original keys.
Raw{"answer": "no", "explanation": "By default, array_slice() reindexes the numeric keys starting from 0 rather than preserving the original keys."} | верно | По умолчанию ключи перенумеровываются; сохранение — preserve_keys = true. |
T04-L6 0.2 c | Arrays | What does array_slice([10, 20, 30, 40], 1, 2) return? | «[20, 30]» Пояснение: array_slice extracts the elements at offset 1 for a length of 2, returning values 20 and 30 from the array.
Raw{"answer": "[20, 30]", "explanation": "array_slice extracts the elements at offset 1 for a length of 2, returning values 20 and 30 from the array."} | верно | [20,30]; ключи перенумеровываются. |
T04-L7 0.27 c | Arrays | How many elements will count(['a' => 1] + ['a' => 9, 'b' => 2]) return? | «2» Пояснение: The union operator (+) combines arrays but keeps the left-hand side values for duplicate string keys, so 'a' => 1 from the first array and 'b' => 2 from the second are retained, giving 2 elements.
Raw{"answer": "2", "explanation": "The union operator (+) combines arrays but keeps the left-hand side values for duplicate string keys, so 'a' => 1 from the first array and 'b' => 2 from the second are retained, giving 2 elements."} | верно | Оператор + : по ключу 'a' побеждает левый; итого 2. |
T04-L8 0.22 c | Arrays | Since PHP 8.1, the spread operator [...$a, ...$b] supports arrays with string keys. | «yes» Пояснение: Since PHP 8.1, the spread operator supports arrays with string keys, allowing them to be merged by key while numerically-indexed values are re-indexed.
Raw{"answer": "yes", "explanation": "Since PHP 8.1, the spread operator supports arrays with string keys, allowing them to be merged by key while numerically-indexed values are re-indexed."} | верно | В 8.0 — только числовые ключи; 8.1 снял ограничение. |
T05-L1 0.2 c | Functions and closures | Named arguments cannot be combined with argument unpacking ...$args in a single call. | «no» Пояснение: Named arguments can actually be combined with argument unpacking in a single call since PHP 8.1, where unpacked arrays containing named keys can be mixed with positional arguments.
Raw{"answer": "false", "explanation": "Named arguments can actually be combined with argument unpacking in a single call since PHP 8.1, where unpacked arrays containing named keys can be mixed with positional arguments."} | верно | Можно: f(...$args, имя: значение). Нельзя только позиционный аргумент после распаковки. |
T05-L2 0.2 c | Functions and closures | An anonymous function without use sees variables from the outer scope. | «no» Пояснение: In PHP, anonymous functions (closures) have their own scope and cannot automatically access variables from the outer scope unless they are explicitly passed in via the use() keyword.
Raw{"answer": "no", "explanation": "In PHP, anonymous functions (closures) have their own scope and cannot automatically access variables from the outer scope unless they are explicitly passed in via the use() keyword."} | верно | Без use внешние переменные недоступны; авто-захват только у fn. |
T05-L3 0.17 c | Functions and closures | What will func_num_args() return inside function f($a) { return func_num_args(); } when called as f(1, 2, 3)? | «3» Пояснение: func_num_args() returns the total number of arguments passed to the function, regardless of how many are declared in the signature.
Raw{"answer": "3", "explanation": "func_num_args() returns the total number of arguments passed to the function, regardless of how many are declared in the signature."} | верно | Считает переданные аргументы: 3. |
T05-L4 0.26 c | Functions and closures | The body of an arrow function fn may consist of several expressions in curly braces. | «no» Пояснение: When an arrow function's body consists of curly braces, it contains statements (which can include multiple statements), but this is called a 'block body', not multiple expressions; a concise body without braces must be a single expression.
Raw{"answer": "no", "explanation": "When an arrow function's body consists of curly braces, it contains statements (which can include multiple statements), but this is called a 'block body', not multiple expressions; a concise body without braces must be a single expression."} | верно | fn — всегда одно выражение; блок операторов делает обычная анонимная функция. |
T05-L5 0.24 c | Functions and closures | An arrow function fn captures outer variables by reference (lazily, at use time). | «no» Пояснение: In PHP, arrow functions capture outer variables by value implicitly at definition time, not by reference, unlike closures which require the `&` operator to capture by reference.
Raw```json ⏎ {"answer": "no", "explanation": "In PHP, arrow functions capture outer variables by value implicitly at definition time, not by reference, unlike closures which require the `&` operator to capture by reference."} ⏎ ``` | верно | fn захватывает только по значению, автоматически; по ссылке — только &$var в use у обычной функции (fn так не умеет). |
T05-L6 0.19 c | Functions and closures | A closure declared as static function () {} does not capture $this. | «yes» Пояснение: A static closure cannot access or capture $this because it is not bound to any object instance.
Raw```json ⏎ { ⏎ "answer": "yes", ⏎ "explanation": "A static closure cannot access or capture $this because it is not bound to any object instance." ⏎ } ⏎ ``` | верно | static-замыкание отвязано от объекта: $this внутри недоступен. |
T05-L7 0.21 c | Functions and closures | What will this print: $x = 5; $f = function () use ($x) { return $x; }; $x = 7; echo $f(); | «5» Пояснение: Closure variable captures are by-value at the time the closure is declared, so $f captures $x=5 and does not see the later assignment to 7.
Raw{"answer": "5", "explanation": "Closure variable captures are by-value at the time the closure is declared, so $f captures $x=5 and does not see the later assignment to 7."} | верно | use захватывает по значению в момент создания: 5. |
T05-L8 0.2 c | Functions and closures | In weak typing mode (without strict_types), passing the string "5" to an int parameter is allowed. | «yes» Пояснение: In weak/coercive typing mode, PHP automatically converts the string "5" to an integer when passed to a parameter declared as int.
Raw{"answer": "yes", "explanation": "In weak/coercive typing mode, PHP automatically converts the string \"5\" to an integer when passed to a parameter declared as int."} | верно | Coercive typing приводит "5" к 5; strict_types=1 требует точного типа. |
T06-L1 0.16 c | OOP: classes and inheritance | PHP supports constructor property promotion: public function __construct(private int $x) {}. | «yes» Пояснение: PHP 8.0 introduced constructor property promotion, allowing properties to be declared and assigned directly within the constructor parameter list.
Raw{"answer": "yes", "explanation": "PHP 8.0 introduced constructor property promotion, allowing properties to be declared and assigned directly within the constructor parameter list."} | верно | С PHP 8.0 параметр с модификатором создаёт свойство и присваивание. |
T06-L2 0.15 c | OOP: classes and inheritance | Which keyword prevents a method from being overridden in subclasses? | «final» Пояснение: The `final` keyword in PHP prevents a method or class from being overridden or extended in subclasses.
Raw{"answer": "final", "explanation": "The `final` keyword in PHP prevents a method or class from being overridden or extended in subclasses."} | верно | final. |
T06-L3 0.17 c | OOP: classes and inheritance | A method declared final cannot be overridden in a subclass. | «yes» Пояснение: Declaring a method as final in PHP prevents any subclass from overriding it, which is the intended purpose of the final modifier.
Raw{"answer": "yes", "explanation": "Declaring a method as final in PHP prevents any subclass from overriding it, which is the intended purpose of the final modifier."} | верно | final запрещает переопределение метода и наследование класса. |
T06-L4 0.16 c | OOP: classes and inheritance | Parent properties with private visibility are accessible in a subclass. | «no» Пояснение: Private properties in a parent class are only accessible within that class itself and are not inherited or accessible in a subclass.
Raw{"answer": "no", "explanation": "Private properties in a parent class are only accessible within that class itself and are not inherited or accessible in a subclass."} | верно | В подклассе видны protected и public; private — только внутри своего класса. |
T06-L5 0.25 c | OOP: classes and inheritance | What does get_class(new class {}) return? Answer with the part of the name before the NUL byte (without the file path). | «class@anonymous» Пояснение: get_class() on an anonymous class returns 'class@anonymous' followed by a NUL byte and the unique numeric identifier, so the part before the NUL byte is 'class@anonymous'.
Raw```json ⏎ {"answer": "class@anonymous", "explanation": "get_class() on an anonymous class returns 'class@anonymous' followed by a NUL byte and the unique numeric identifier, so the part before the NUL byte is 'class@anonymous'."} ⏎ ``` | верно | get_class анонимного класса печатает class@anonymous\0<файл>:<строка>$n; короткая форма — часть до NUL-байта. Проверено php -r (hex). |
T06-L6 0.25 c | OOP: classes and inheritance | A private parent method is not part of the inheritance contract: a child may declare a method with the same name and any visibility. | «yes» Пояснение: Private methods are not part of the inheritance contract because they are not visible to child classes, so a child can freely declare a method with the same name and any visibility without being constrained by inheritance rules.
Raw{"answer": "true", "explanation": "Private methods are not part of the inheritance contract because they are not visible to child classes, so a child can freely declare a method with the same name and any visibility without being constrained by inheritance rules."} | верно | private-члены не наследуются — правила совместимости подписей не действуют. |
T06-L7 0.21 c | OOP: classes and inheritance | The magic method __get() is called only for non-existent properties. | «yes» Пояснение: __get() is only triggered when accessing non-existent properties, not for existing ones.
Raw```json ⏎ { ⏎ "answer": "yes", ⏎ "explanation": "__get() is only triggered when accessing non-existent properties, not for existing ones." ⏎ } ⏎ ``` | неверно верный: «no» | __get срабатывает и для существующих, но недоступных (private/protected извне). |
T06-L8 0.21 c | OOP: classes and inheritance | What does reassigning a readonly property throw — Exception or Error? | «error» Пояснение: Reassigning a readonly property in PHP throws an Error (specifically an Error of type 'Cannot modify a readonly property') because it violates a language feature rather than a runtime exception condition.
Raw{"answer": "Error", "explanation": "Reassigning a readonly property in PHP throws an Error (specifically an Error of type 'Cannot modify a readonly property') because it violates a language feature rather than a runtime exception condition."} | верно | Error (readonly с 8.1); оговорка: в __clone() переинициализация допустима (8.3+). |
T07-L1 0.2 c | Interfaces, traits, enum | An interface can declare constants. | «yes» Пояснение: In PHP 7+, interfaces can declare and define constants, though prior to PHP 8 they could not have non-constant expressions.
Raw{"answer": "yes", "explanation": "In PHP 7+, interfaces can declare and define constants, though prior to PHP 8 they could not have non-constant expressions."} | верно | Константы интерфейса наследуются реализациями. |
T07-L2 0.15 c | Interfaces, traits, enum | Which operator checks whether an object is an instance of a class or interface? | «instanceof» Пояснение: The instanceof operator in PHP checks whether an object is an instance of a specific class or interface.
Raw{"answer": "instanceof", "explanation": "The instanceof operator in PHP checks whether an object is an instance of a specific class or interface."} | верно | instanceof. |
T07-L3 0.26 c | Interfaces, traits, enum | An interface can declare static methods. | «no» Пояснение: In PHP versions before 8.0, interfaces cannot declare static methods, and even in PHP 8.0+ where static methods in interfaces are allowed, the classic statement that interfaces declare only method signatures (implemented by classes) makes this false in the traditional sense.
Raw{"answer": "false", "explanation": "In PHP versions before 8.0, interfaces cannot declare static methods, and even in PHP 8.0+ where static methods in interfaces are allowed, the classic statement that interfaces declare only method signatures (implemented by classes) makes this false in the traditional sense."} | неверно верный: «yes» | Реализация обязана дать статический метод с той же сигнатурой. |
T07-L4 0.21 c | Interfaces, traits, enum | The instanceof operator only checks class inheritance: it ignores interfaces. | «no» Пояснение: The instanceof operator in PHP checks whether an object is an instance of a class OR implements any of the specified interfaces, so it does not ignore interfaces.
Raw{"answer": "false", "explanation": "The instanceof operator in PHP checks whether an object is an instance of a class OR implements any of the specified interfaces, so it does not ignore interfaces."} | верно | instanceof возвращает true и для интерфейсов объекта. |
T07-L5 0.22 c | Interfaces, traits, enum | An interface method may have a default implementation, like a trait method. | «no» Пояснение: Interface methods cannot have a default implementation (prior to PHP 8.1 where only static methods can have defaults, but instance methods still cannot), whereas trait methods can have default implementations that can be overridden.
Raw{"answer": "false", "explanation": "Interface methods cannot have a default implementation (prior to PHP 8.1 where only static methods can have defaults, but instance methods still cannot), whereas trait methods can have default implementations that can be overridden."} | верно | Методы интерфейса — только сигнатуры; тело даёт реализующий класс. |
T07-L6 0.16 c | Interfaces, traits, enum | An abstract method in an abstract class may have protected visibility. | «yes» Пояснение: An abstract method's visibility is not constrained, so it can be declared as public, protected, or private.
Raw{"answer": "yes", "explanation": "An abstract method's visibility is not constrained, so it can be declared as public, protected, or private."} | верно | В абстрактном классе — любая видимость; в интерфейсе — только public. |
T07-L7 0.2 c | Interfaces, traits, enum | How many elements will Foo::cases() return for enum Foo { case A; case B; case C; }? | «3» Пояснение: Foo::cases() returns all defined enum cases, and Foo has three cases (A, B, C), so it returns an array of 3 elements.
Raw{"answer": "3", "explanation": "Foo::cases() returns all defined enum cases, and Foo has three cases (A, B, C), so it returns an array of 3 elements."} | верно | Статический метод cases(): 3. |
T07-L8 0.22 c | Interfaces, traits, enum | A trait can declare constants. | «yes» Пояснение: Traits can declare constants in PHP, though when the trait is used in a class, any conflicting constant declarations with the class or other traits will result in a fatal error.
Raw{"answer": "yes", "explanation": "Traits can declare constants in PHP, though when the trait is used in a class, any conflicting constant declarations with the class or other traits will result in a fatal error."} | верно | С PHP 8.2 трейты могут объявлять константы (RFC constants_in_traits); до 8.2 — нет. |
T08-L1 0.21 c | Exceptions and errors | The Throwable interface is a common ancestor of both Exception and Error. | «yes» Пояснение: In PHP 7+, the Throwable interface is indeed the common ancestor of both the Exception class and the Error class, allowing both to be caught using a catch (Throwable $e) block.
Raw{"answer": "yes", "explanation": "In PHP 7+, the Throwable interface is indeed the common ancestor of both the Exception class and the Error class, allowing both to be caught using a catch (Throwable $e) block."} | верно | Иерархия с PHP 7: Throwable → Exception и Throwable → Error. |
T08-L2 0.2 c | Exceptions and errors | A catch (Exception $e) block will also catch TypeError, because TypeError ultimately inherits from Exception. | «no» Пояснение: TypeError implements Throwable and extends Error, but it does not inherit from Exception, so a catch (Exception $e) block will not catch it.
Raw```json ⏎ {"answer": "no", "explanation": "TypeError implements Throwable and extends Error, but it does not inherit from Exception, so a catch (Exception $e) block will not catch it."} ⏎ ``` | верно | TypeError наследуется от Error; catch (Exception) его не ловит. |
T08-L3 0.17 c | Exceptions and errors | The @ operator suppresses exceptions too. | «no» Пояснение: The @ operator in PHP suppresses errors (error_reporting), not exceptions, which are handled separately via try/catch blocks.
Raw{"answer": "no", "explanation": "The @ operator in PHP suppresses errors (error_reporting), not exceptions, which are handled separately via try/catch blocks."} | верно | @ глушит диагностику (warnings/notices), исключения не перехватывает. |
T08-L4 0.19 c | Exceptions and errors | What error class does intdiv(5, 0) throw? | «divisionbyzeroerror» Пояснение: In PHP 7+, intdiv() with a divisor of 0 throws a DivisionByZeroError, which is a subclass of ArithmeticError.
Raw{"answer": "DivisionByZeroError", "explanation": "In PHP 7+, intdiv() with a divisor of 0 throws a DivisionByZeroError, which is a subclass of ArithmeticError."} | верно | DivisionByZeroError (иерархия Error, не Exception); php-грейдер объективен. |
T08-L5 0.14 c | Exceptions and errors | The finally block runs only if the exception was caught by a catch block. | «no» Пояснение: The finally block always executes regardless of whether an exception occurred, was caught, or not.
Raw{"answer": "false", "explanation": "The finally block always executes regardless of whether an exception occurred, was caught, or not."} | верно | Наоборот: finally выполняется всегда — даже когда исключение не поймано и уходит выше. Проверено php -r. |
T08-L6 0.19 c | Exceptions and errors | An exception thrown inside a finally block has no effect on the result of the try block. | «no» Пояснение: When an exception is thrown inside a finally block, it overrides and replaces the original exception/result from the try block, so it does affect the result.
Raw{"answer": "false", "explanation": "When an exception is thrown inside a finally block, it overrides and replaces the original exception/result from the try block, so it does affect the result."} | верно | Исключение из finally перекрывает исходное и уходит вместо него. |
T08-L7 0.19 c | Exceptions and errors | What does the expression (bool) new Exception('x') return? | «yes» Пояснение: In PHP, all objects (including Exception instances) are always truthy when cast to boolean, regardless of their content.
Raw```json ⏎ {"answer": "yes", "explanation": "In PHP, all objects (including Exception instances) are always truthy when cast to boolean, regardless of their content."} ⏎ ``` | верно | Любой объект при приведении к bool — true. Формы ответа: true или да. |
T08-L8 0.15 c | Exceptions and errors | Functions registered via register_shutdown_function() run when exit is called. | «yes» Пояснение: register_shutdown_function() registers functions that execute when script termination is reached, including when exit() is called.
Raw{"answer": "yes", "explanation": "register_shutdown_function() registers functions that execute when script termination is reached, including when exit() is called."} | верно | exit завершает скрипт, но shutdown-функции отрабатывают. |
T09-L1 0.21 c | Namespaces and autoloading | The use App\Service\Mailer; statement itself loads the class file. | «no» Пояснение: The use statement only creates an alias for the class name; the class file is loaded lazily by the autoloader when the class is first used, not when the use statement is parsed.
Raw{"answer": "no", "explanation": "The use statement only creates an alias for the class name; the class file is loaded lazily by the autoloader when the class is first used, not when the use statement is parsed."} | верно | use — псевдоним на этапе компиляции; файл грузит автозагрузчик при первом обращении. |
T09-L2 0.22 c | Namespaces and autoloading | What follows use to import a function (not a class): the word function or const? | «function» Пояснение: Functions are imported using the `function` keyword (e.g., `import { functionName } from './module'`), while `const` is used for variables and constants, not for importing functions.
Raw{"answer": "function", "explanation": "Functions are imported using the `function` keyword (e.g., `import { functionName } from './module'`), while `const` is used for variables and constants, not for importing functions."} | верно | use function ...; (и use const для констант). |
T09-L3 0.32 c | Namespaces and autoloading | Into which file (path from src/) does the PSR-4 mapping "App\ → src/" place the class App\Controller\Api\UserController? | «src/controller/api/usercontroller.php» Пояснение: The PSR-4 namespace prefix "App\" maps to src/, so the fully qualified class name App\Controller\Api\UserController translates to the file path src/Controller/Api/UserController.php with the class name in CamelCase and underscores converted to directory separators.
Raw{"answer": "src/Controller/Api/UserController.php", "explanation": "The PSR-4 namespace prefix \"App\\\" maps to src/, so the fully qualified class name App\\Controller\\Api\\UserController translates to the file path src/Controller/Api/UserController.php with the class name in CamelCase and underscores converted to directory separators."} | верно | Остаток имени после префикса, \ → /. |
T09-L4 0.22 c | Namespaces and autoloading | Including vendor/autoload.php registers autoloaders via spl_autoload_register(). | «yes» Пояснение: The vendor/autoload.php file generated by Composer calls spl_autoload_register() to register the autoloaders that map class names to their file locations.
Raw```json ⏎ {"answer": "yes", "explanation": "The vendor/autoload.php file generated by Composer calls spl_autoload_register() to register the autoloaders that map class names to their file locations."} ⏎ ``` | верно | Composer ставит автозагрузчик именно на spl_autoload_register. |
T09-L5 0.14 c | Namespaces and autoloading | The magic constant __NAMESPACE__ contains the name of the current namespace. | «yes» Пояснение: __NAMESPACE__ is a magic constant that returns the name of the current namespace in PHP.
Raw{"answer": "yes", "explanation": "__NAMESPACE__ is a magic constant that returns the name of the current namespace in PHP."} | верно | В корневом пространстве — пустая строка. |
T09-L6 0.25 c | Namespaces and autoloading | An unqualified class name (without a leading \) in new is resolved from the global root. | «no» Пояснение: In PHP, an unqualified class name in a new statement (like new Foo()) is resolved relative to the current namespace, not from the global root, so inside namespace App, new Foo() creates App\Foo rather than \Foo.
Raw{"answer": "false", "explanation": "In PHP, an unqualified class name in a new statement (like new Foo()) is resolved relative to the current namespace, not from the global root, so inside namespace App, new Foo() creates App\\Foo rather than \\Foo."} | верно | Резолвится относительно текущего namespace (с учётом импортов). |
T09-L7 0.21 c | Namespaces and autoloading | With the PSR-4 mapping "App\ → src/", the class App\Model\User lives in the file src/Model/User.php. | «yes» Пояснение: Under PSR-4, the namespace App\ maps to src/, so App\Model\User corresponds to the file src/Model/User.php.
Raw{"answer": "yes", "explanation": "Under PSR-4, the namespace App\\ maps to src/, so App\\Model\\User corresponds to the file src/Model/User.php."} | верно | Остаток имени после префикса переносится в путь как есть. |
T09-L8 0.19 c | Namespaces and autoloading | A use statement may be written inside a function body — the import then applies to that function only. | «yes» Пояснение: In PHP, a use statement for importing a namespace can be written inside a function body, and the import only applies within that function's scope.
Raw{"answer": "yes", "explanation": "In PHP, a use statement for importing a namespace can be written inside a function body, and the import only applies within that function's scope."} | неверно верный: «no» | use внутри тела функции — parse error; импорты файловые и компиляционные. |
T10-L1 0.19 c | References and scope | Arrays are copied on assignment rather than passed by reference. | «yes» Пояснение: In PHP, arrays are value types that are copied on assignment (copy-on-write), so assigning an array to a variable creates a separate copy rather than a reference.
Raw{"answer": "yes", "explanation": "In PHP, arrays are value types that are copied on assignment (copy-on-write), so assigning an array to a variable creates a separate copy rather than a reference."} | верно | Присваивание массива — копия (в движке — copy-on-write). |
T10-L2 0.16 c | References and scope | What will this print: $a = [1, 2]; $b = $a; $b[] = 3; echo count($a); | «2» Пояснение: In PHP arrays are copied by value on assignment, so modifying $b does not affect $a.
Raw{"answer": "2", "explanation": "In PHP arrays are copied by value on assignment, so modifying $b does not affect $a."} | верно | Присваивание — копия: в $a по-прежнему 2 элемента. |
T10-L3 0.23 c | References and scope | Inside a function, user-defined global variables are inaccessible without global, $GLOBALS, or passing them as parameters. | «yes» Пояснение: In PHP, variables defined outside a function exist in the global scope and are not accessible inside a function unless declared with the global keyword, accessed via $GLOBALS, or passed as parameters.
Raw{"answer": "yes", "explanation": "In PHP, variables defined outside a function exist in the global scope and are not accessible inside a function unless declared with the global keyword, accessed via $GLOBALS, or passed as parameters."} | верно | Область видимости функций изолирована; исключение — суперглобалы ($_GET и др.). |
T10-L4 0.19 c | References and scope | unset($GLOBALS['x']) inside a function removes the global variable only for that function. | «no» Пояснение: Using unset($GLOBALS['x']) inside a function actually destroys the global variable x permanently, not just for the current function scope.
Raw```json ⏎ {"answer": "no", "explanation": "Using unset($GLOBALS['x']) inside a function actually destroys the global variable x permanently, not just for the current function scope."} ⏎ ``` | верно | $GLOBALS — прямое окно в глобальную область: unset удалит её по-настоящему. |
T10-L5 0.18 c | References and scope | What will this print: function inc(&$x) { $x++; } $n = 5; inc($n); echo $n; | «6» Пояснение: The function inc() modifies $n by reference using &$x, so $x++ increments $n from 5 to 6.
Raw{"answer": "6", "explanation": "The function inc() modifies $n by reference using &$x, so $x++ increments $n from 5 to 6."} | верно | Ссылка меняет оригинал: 6. |
T10-L6 0.27 c | References and scope | A foreach over an array (by value) works with the "live" array: changes to the array inside the loop are visible in the same pass. | «no» Пояснение: In PHP, a foreach loop iterating by value works on a copy of the array's internal structure, so modifications to the array inside the loop are not reflected in the current iteration pass (though the pointer continues).
Raw```json ⏎ {"answer": "no", "explanation": "In PHP, a foreach loop iterating by value works on a copy of the array's internal structure, so modifications to the array inside the loop are not reflected in the current iteration pass (though the pointer continues)."} ⏎ ``` | верно | По значению foreach итерирует копию-снимок. |
T10-L7 0.2 c | References and scope | A static property belongs to each instance separately: changes in one object are not visible in others. | «no» Пояснение: Static properties belong to the class itself rather than to individual instances, so a change made through one object IS visible in all other objects.
Raw{"answer": "false", "explanation": "Static properties belong to the class itself rather than to individual instances, so a change made through one object IS visible in all other objects."} | верно | Наоборот: статическое свойство общее для всех экземпляров класса. Проверено php -r. |
T10-L8 0.19 c | References and scope | An array can have a boolean key true, and it will be stored as bool. | «no» Пояснение: In PHP, boolean array keys are automatically converted to integers (true becomes 1, false becomes 0), so they are not stored as booleans.
Raw{"answer": "no", "explanation": "In PHP, boolean array keys are automatically converted to integers (true becomes 1, false becomes 0), so they are not stored as booleans."} | верно | Булев ключ приводится к int: true → 1, false → 0. |
T11-L1 0.19 c | Generators, iterators, SPL | Inside a generator, return with a value can be used, and it becomes available via $gen->getReturn(). | «yes» Пояснение: Generators support a return statement with a value, and PHP 7.0+ exposes it via the getReturn() method after the generator is exhausted.
Raw{"answer": "yes", "explanation": "Generators support a return statement with a value, and PHP 7.0+ exposes it via the getReturn() method after the generator is exhausted."} | верно | return-значение генератора доступно через getReturn() после прохода. |
T11-L2 0.15 c | Generators, iterators, SPL | A fully consumed generator can be rewound with rewind() and traversed again. | «yes» Пояснение: The rewind() method resets a generator to its initial state, allowing it to be traversed again.
Raw{"answer": "yes", "explanation": "The rewind() method resets a generator to its initial state, allowing it to be traversed again."} | неверно верный: «no» | Генератор одноразовый: rewind после начала итерации бросает Exception. |
T11-L3 0.22 c | Generators, iterators, SPL | The yield from construct delegates traversal to another generator or iterable. | «yes» Пояснение: The `yield from` construct in PHP (since PHP 7.0) delegates traversal to another generator or iterable, allowing it to yield values from the delegated generator and handle send/throw operations.
Raw{"answer": "yes", "explanation": "The `yield from` construct in PHP (since PHP 7.0) delegates traversal to another generator or iterable, allowing it to yield values from the delegated generator and handle send/throw operations."} | верно | yield from проксирует значения, ключи и return-значение внутреннего генератора. |
T11-L4 0.2 c | Generators, iterators, SPL | What does get_class(g()) return for function g() { yield 1; }? | «generator» Пояснение: Since g() contains a yield statement, calling it returns a Generator object (which extends Iterator) without executing the body, and get_class() returns "Generator".
Raw{"answer": "Generator", "explanation": "Since g() contains a yield statement, calling it returns a Generator object (which extends Iterator) without executing the body, and get_class() returns \"Generator\"."} | верно | Функция с yield возвращает Generator. |
T11-L5 0.27 c | Generators, iterators, SPL | How many elements will count(iterator_to_array((function () { yield from [1, 2, 3]; })())) return? | «3» Пояснение: The generator yields 3 elements (1, 2, 3) via `yield from`, and iterator_to_array collects all of them into a numerically indexed array, so count() returns 3.
Raw```json ⏎ {"answer": "3", "explanation": "The generator yields 3 elements (1, 2, 3) via `yield from`, and iterator_to_array collects all of them into a numerically indexed array, so count() returns 3."} ⏎ ``` | верно | yield from делегирует все 3 элемента. |
T11-L6 0.19 c | Generators, iterators, SPL | The SplStack class implements a FIFO queue. | «no» Пояснение: SplStack implements a LIFO (last-in, first-out) stack, not a FIFO queue.
Raw{"answer": "no", "explanation": "SplStack implements a LIFO (last-in, first-out) stack, not a FIFO queue."} | верно | SplStack — стек LIFO; очередь FIFO — SplQueue. |
T11-L7 0.18 c | Generators, iterators, SPL | ArrayIterator allows wrapping an array and traversing it via the Iterator interface. | «yes» Пояснение: ArrayIterator is a PHP SPL class that wraps an array and allows traversing it via the Iterator interface along with additional array manipulation methods.
Raw{"answer": "yes", "explanation": "ArrayIterator is a PHP SPL class that wraps an array and allows traversing it via the Iterator interface along with additional array manipulation methods."} | верно | Объектная обёртка над массивом. |
T11-L8 0.16 c | Generators, iterators, SPL | An ArrayObject instance cannot be traversed with foreach. | «no» Пояснение: ArrayObject implements the Traversable and IteratorAggregate interfaces, so it can definitely be traversed with foreach.
Raw{"answer": "false", "explanation": "ArrayObject implements the Traversable and IteratorAggregate interfaces, so it can definitely be traversed with foreach."} | верно | ArrayObject реализует IteratorAggregate — foreach по нему работает. |
T12-L1 0.15 c | Configuration and security | password_hash() generates a salt automatically — passing one separately is not needed. | «yes» Пояснение: true, password_hash() automatically generates a cryptographically secure random salt when none is provided.
Raw{"answer": "yes", "explanation": "true, password_hash() automatically generates a cryptographically secure random salt when none is provided."} | верно | Соль встраивается в строку результата; параметр salt устарел. |
T12-L2 0.2 c | Configuration and security | In PHP 8, PASSWORD_DEFAULT is md5 with an automatically added salt. | «no» Пояснение: PASSWORD_DEFAULT in PHP 8 uses the bcrypt algorithm by default, not md5, and md5 is not salted and is considered cryptographically insecure for password hashing.
Raw{"answer": "no", "explanation": "PASSWORD_DEFAULT in PHP 8 uses the bcrypt algorithm by default, not md5, and md5 is not salted and is considered cryptographically insecure for password hashing."} | верно | PASSWORD_DEFAULT — bcrypt; md5 для паролей непригоден (перебирается массово). |
T12-L3 0.23 c | Configuration and security | What does password_verify('secret', password_hash('secret', PASSWORD_DEFAULT)) return? | «true» Пояснение: password_hash() generates a salted hash with a random cost factor, and password_verify() verifies the plaintext 'secret' against that generated hash, returning true because they match.
Raw```json ⏎ {"answer": "true", "explanation": "password_hash() generates a salted hash with a random cost factor, and password_verify() verifies the plaintext 'secret' against that generated hash, returning true because they match."} ⏎ ``` | верно | Соль и хеш в одной строке: true (форма ответа: true или да). |
T12-L4 0.22 c | Configuration and security | strip_tags() protects against SQL injection. | «no» Пояснение: strip_tags() only removes HTML and PHP tags from strings and provides no protection against SQL injection, which requires proper input validation and the use of prepared statements or parameterized queries.
Raw{"answer": "no", "explanation": "strip_tags() only removes HTML and PHP tags from strings and provides no protection against SQL injection, which requires proper input validation and the use of prepared statements or parameterized queries."} | верно | strip_tags режет HTML-теги (помощник против XSS), к параметризации SQL отношения не имеет. |
T12-L5 0.21 c | Configuration and security | session_regenerate_id() is used to protect against session fixation upon user login. | «yes» Пояснение: session_regenerate_id() with delete_old_session=true creates a new session ID, which prevents attackers from using a pre-set session ID to hijack a user's session after login.
Raw{"answer": "yes", "explanation": "session_regenerate_id() with delete_old_session=true creates a new session ID, which prevents attackers from using a pre-set session ID to hijack a user's session after login."} | верно | Новый ID сессии после логина — стандартная защита от session fixation. |
T12-L6 0.22 c | Configuration and security | Which built-in function returns the SAPI name (e.g., cli)? | «php_sapi_name» Пояснение: The built-in php_sapi_name() function returns the name of the SAPI (Server API Interface) being used, such as 'cli' for the command-line interface.
Raw{"answer": "php_sapi_name", "explanation": "The built-in php_sapi_name() function returns the name of the SAPI (Server API Interface) being used, such as 'cli' for the command-line interface."} | верно | php_sapi_name(). |
T12-L7 0.22 c | Configuration and security | session_destroy() deletes session data on the server but not the cookie in the user's browser. | «yes» Пояснение: session_destroy() only removes the session data stored on the server; to delete the client-side session cookie, you must also unset the session cookie via setcookie() or session cookies.
Raw{"answer": "yes", "explanation": "session_destroy() only removes the session data stored on the server; to delete the client-side session cookie, you must also unset the session cookie via setcookie() or session cookies."} | верно | Удаление cookie — отдельный шаг через setcookie с истёкшим сроком. |
T12-L8 0.17 c | Configuration and security | Without calling session_start(), the $_SESSION array is automatically populated with session data. | «no» Пояснение: session_start() must be called before $_SESSION can be populated or accessed, as it initializes the session.
Raw```json ⏎ {"answer": "no", "explanation": "session_start() must be called before $_SESSION can be populated or accessed, as it initializes the session."} ⏎ ``` | верно | Без session_start() данные сессии в массив не загружаются ($_SESSION можно заполнить вручную, но привязки к сессии нет). |
VC-L1 0.17 c | PHP 8.4–8.5 | In which PHP version was the array_find() function introduced? | «8.1» Пояснение: The array_find() function was introduced in PHP 8.1 as part of the new array_* predicate functions.
Raw{"answer": "8.1", "explanation": "The array_find() function was introduced in PHP 8.1 as part of the new array_* predicate functions."} | неверно верный: «8.4» | PHP 8.4 (RFC array_find). |
VC-L2 0.18 c | PHP 8.4–8.5 | Property hooks (get/set right in the property declaration) landed in PHP 8.4. | «yes» Пояснение: Property hooks were introduced in PHP 8.4, allowing get, set, and other hooks to be defined directly within the property declaration.
Raw{"answer": "yes", "explanation": "Property hooks were introduced in PHP 8.4, allowing get, set, and other hooks to be defined directly within the property declaration."} | верно | Property hooks — PHP 8.4 (ноябрь 2024). |
VC-L3 0.17 c | PHP 8.4–8.5 | Asymmetric visibility (public private(set) string $name) appeared in PHP 8.4. | «yes» Пояснение: Asymmetric visibility, allowing separate read and write access modifiers like private(set), was introduced in PHP 8.4.
Raw{"answer": "yes", "explanation": "Asymmetric visibility, allowing separate read and write access modifiers like private(set), was introduced in PHP 8.4."} | верно | Asymmetric visibility v2 — PHP 8.4. |
VC-L4 0.19 c | PHP 8.4–8.5 | In which PHP version was the #[\NoDiscard] attribute introduced? Answer with the version number. | «8.2» Пояснение: The #[\NoDiscard] attribute was introduced in PHP 8.2 to allow marking return values that should not be discarded.
Raw{"answer": "8.2", "explanation": "The #[\\NoDiscard] attribute was introduced in PHP 8.2 to allow marking return values that should not be discarded."} | неверно верный: «8.5» | #[\NoDiscard] — PHP 8.5 (marking return values as important). |
VC-L5 0.22 c | PHP 8.4–8.5 | In which PHP version did the pipe operator |> first appear? Answer with the version number. | «8.1» Пояснение: The pipe operator (|>) first appeared in PHP 8.1 as part of the arrow function 2.0 RFC.
Raw```json ⏎ { ⏎ "answer": "8.1", ⏎ "explanation": "The pipe operator (|>) first appeared in PHP 8.1 as part of the arrow function 2.0 RFC." ⏎ } ⏎ ``` | неверно верный: «8.5» | Pipe operator — PHP 8.5 (2025). |
VC-L6 0.26 c | PHP 8.4–8.5 | In which PHP version did clone-with — the syntax clone($obj, ['x' => 1]) — appear? Answer with the version number. | «8.3» Пояснение: The clone syntax with reassignment (clone($obj, ['x' => 1])) was introduced in PHP 8.3 as part of the Parameterized Constructor Syntactic Sugar proposal.
Raw```json ⏎ { ⏎ "answer": "8.3", ⏎ "explanation": "The clone syntax with reassignment (clone($obj, ['x' => 1])) was introduced in PHP 8.3 as part of the Parameterized Constructor Syntactic Sugar proposal." ⏎ } ⏎ ``` | неверно верный: «8.5» | Clone with v2 — PHP 8.5. |
VC-L7 0.18 c | PHP 8.4–8.5 | In which PHP version were the array_first() and array_last() functions introduced? | «7.3» Пояснение: The array_first() and array_last() functions were introduced in PHP 7.3.
Raw{"answer": "7.3", "explanation": "The array_first() and array_last() functions were introduced in PHP 7.3."} | неверно верный: «8.5» | PHP 8.5. |
VC-L8 0.15 c | PHP 8.4–8.5 | For which PHP version was RFC Partial Function Application v2 adopted (as of 2026-11-07)? Answer with the version number. | «8.4» Пояснение: The RFC Partial Function Application v2 was adopted for PHP 8.4.
Raw{"answer": "8.4", "explanation": "The RFC Partial Function Application v2 was adopted for PHP 8.4."} | неверно верный: «8.6» | PFA v2 принят 05.12.2025 (33-0-0), реализован в PHP 8.6. |
VF-L1 0.2 c | PHP: 8.6+ and the future | For which PHP version was the RFC clamp_v2 (the clamp() function) implemented, as of 2026-11-07? Answer with the version number. | «php 8.5» Пояснение: The clamp_v2 RFC, which introduces the clamp() function, was accepted and implemented in PHP 8.5.
Raw```json ⏎ {"answer": "PHP 8.5", "explanation": "The clamp_v2 RFC, which introduces the clamp() function, was accepted and implemented in PHP 8.5."} ⏎ ``` | неверно верный: «8.6» | По данным владельца (wiki.php.net/rfc): clamp_v2 — 8.6; clamp() в 8.5.11 отсутствует (косвенное подтверждение). Дата-якорь делает клетку монотонной. |
VF-L2 0.2 c | PHP: 8.6+ and the future | RFC Context Managers v2 has already been adopted in PHP (as of 2026-11-07). | «no» Пояснение: RFC Context Managers was rejected by the PHP Council in June 2023 and has not been adopted as of 2026.
Raw{"answer": "no", "explanation": "RFC Context Managers was rejected by the PHP Council in June 2023 and has not been adopted as of 2026."} | верно | На 06.11.2026 — в обсуждении (создан 2026-10-23); не принят. |
VF-L3 0.28 c | PHP: 8.6+ and the future | RFC Bound-Erased Generic Types (generics) was declined in 2026. | «no» Пояснение: RFC Bound-Erased Generic Types (generics) was not declined in 2026 because the 'Bound-Erased' proposal is a real PHP 8.0 feature, while the actually declined 2024 generics RFC was titled 'Bound-Generic Types'.
Raw{"answer": "false", "explanation": "RFC Bound-Erased Generic Types (generics) was not declined in 2026 because the 'Bound-Erased' proposal is a real PHP 8.0 feature, while the actually declined 2024 generics RFC was titled 'Bound-Generic Types'."} | неверно верный: «yes» | Голосование завершилось 2026-06-28: отклонён (wiki.php.net/rfc). |
VF-L4 0.22 c | PHP: 8.6+ and the future | As of 2026-11-07, the RFC enabling multithreading (ZTS) by default has already been accepted in PHP. | «no» Пояснение: There is no accepted RFC to enable Thread Safety Mode (ZTS) by default in PHP, as enabling ZTS by default would disable JIT and significantly reduce performance.
Raw{"answer": "false", "explanation": "There is no accepted RFC to enable Thread Safety Mode (ZTS) by default in PHP, as enabling ZTS by default would disable JIT and significantly reduce performance."} | верно | Такого принятого RFC нет на дату якоря; якорь делает клетку монотонной — при принятии RFC позже клетка не перевернётся. |
VF-L5 0.26 c | PHP: 8.6+ and the future | As of PHP 8.5, generics (parameterized types) are still absent. | «yes» Пояснение: PHP has no planned generics (parameterized types) as of PHP 8.5, since they were deliberately not implemented after PHP 5.1 due to their complexity and the language's dynamic typing.
Raw```json ⏎ {"answer": "yes", "explanation": "PHP has no planned generics (parameterized types) as of PHP 8.5, since they were deliberately not implemented after PHP 5.1 due to their complexity and the language's dynamic typing."} ⏎ ``` | верно | Generics в PHP отсутствуют; отрицательный контроль (не путать с C#/Java). |
VF-L6 0.3 c | PHP: 8.6+ and the future | As of 2026-11-07, the latest stable PHP version is 8.5, and PHP 8.6 has not been released yet (GA — 2026-11-19). | «yes» Пояснение: PHP release schedule follows ~8 month cycles with feature releases in November and maintenance patches, so PHP 8.5 (released November 2025) is the latest stable version in November 2026 while 8.6 GA would occur later.
Raw{"answer": "yes", "explanation": "PHP release schedule follows ~8 month cycles with feature releases in November and maintenance patches, so PHP 8.5 (released November 2025) is the latest stable version in November 2026 while 8.6 GA would occur later."} | верно | 8.5 — релиз осени 2025; 8.6 GA 19.11.2026 (wiki.php.net/todo/php86). Дата снимка — 06.11.2026. |
VF-L7 0.25 c | PHP: 8.6+ and the future | The PHP 6 branch never shipped: after PHP 5.6 came PHP 7.0 directly. | «yes» Пояснение: PHP 6 was cancelled due to the Unicode rewrite project being abandoned, and after PHP 5.6 the next major release was PHP 7.0, so PHP 6 never actually shipped.
Raw{"answer": "yes", "explanation": "PHP 6 was cancelled due to the Unicode rewrite project being abandoned, and after PHP 5.6 the next major release was PHP 7.0, so PHP 6 never actually shipped."} | верно | Исторический факт: ветка 6 не была релизнута. |
VF-L8 0.21 c | PHP: 8.6+ and the future | The RFC adding the #[\Deprecated] attribute to the core was adopted. | «no» Пояснение: The RFC proposing the #[\Deprecated] attribute was rejected, as core maintainers preferred the existing PHPDoc-based deprecation mechanism.
Raw```json ⏎ {"answer": "no", "explanation": "The RFC proposing the #[\\Deprecated] attribute was rejected, as core maintainers preferred the existing PHPDoc-based deprecation mechanism."} ⏎ ``` | неверно верный: «yes» | #[\Deprecated] — принят, реализован в PHP 8.4. |
T25-L1 0.22 c | Clean architecture | The dependency rule of clean and onion architecture: inner layers know nothing about outer ones — dependencies point toward the center. | «yes» Пояснение: In clean and onion architecture, dependencies correctly point inward from outer layers (which contain framework/UI concerns) toward inner layers (which contain business rules), ensuring inner layers remain independent of outer implementation details.
Raw{"answer": "yes", "explanation": "In clean and onion architecture, dependencies correctly point inward from outer layers (which contain framework/UI concerns) toward inner layers (which contain business rules), ensuring inner layers remain independent of outer implementation details."} | верно | Чистая (Robert C. Martin), луковичная (Jeffrey Palermo) и гексагональная (ports & adapters) — варианты одной идеи: зависимости направлены внутрь, к домену. Слоями в проекте следит deptrac. |
T25-L2 0.22 c | Clean architecture | Domain entities import neither Doctrine nor Symfony — only the language and, possibly, the standard library. | «yes» Пояснение: Domain entities in Domain-Driven Design are meant to be pure PHP classes containing only business rules and standard library usage, intentionally independent of framework or ORM dependencies like Doctrine and Symfony.
Raw{"answer": "true", "explanation": "Domain entities in Domain-Driven Design are meant to be pure PHP classes containing only business rules and standard library usage, intentionally independent of framework or ORM dependencies like Doctrine and Symfony."} | верно | Изоляция домена от инфраструктуры; deptrac в проекте как раз следит за слоями. |
T25-L3 0.21 c | Clean architecture | Controllers and Twig templates belong to the business-logic layer because they are the ones calling use cases. | «no» Пояснение: Controllers belong to the presentation/web layer (they handle HTTP concerns) while Twig templates belong to the view layer, not the business-logic layer which contains use cases and domain rules.
Raw{"answer": "no", "explanation": "Controllers belong to the presentation/web layer (they handle HTTP concerns) while Twig templates belong to the view layer, not the business-logic layer which contains use cases and domain rules."} | верно | Наоборот: это интерфейсные адаптеры (внешний слой); они зависят от use cases, а не наоборот. |
T25-L4 0.17 c | Clean architecture | What sits at the very center of the onion architecture? | «entities» Пояснение: In Onion Architecture, Entities sit at the very center as they contain enterprise business rules and are the least likely to change.
Raw{"answer": "Entities", "explanation": "In Onion Architecture, Entities sit at the very center as they contain enterprise business rules and are the least likely to change."} | неверно верный: «domain model» | Центральное кольцо — Domain Model: сущности и бизнес-правила без зависимостей; далее Domain Services → Application Services → Infrastructure/UI/Tests (Palermo). |
T25-L5 0.18 c | Clean architecture | Layer boundary violations can be caught automatically: a layer-dependency analyzer (e.g. deptrac) fails on a forbidden call. | «yes» Пояснение: Tools like deptrac analyze layer dependencies statically and fail the build when a forbidden cross-layer call is detected.
Raw```json ⏎ {"answer": "yes", "explanation": "Tools like deptrac analyze layer dependencies statically and fail the build when a forbidden cross-layer call is detected."} ⏎ ``` | верно | depfile.yaml в проекте TasK: CI проверяет правила слоёв на каждом пайплайне. |
T25-L6 0.23 c | Clean architecture | A use case (interactor) may accept an HTTP request or an EntityManager as arguments — it is simpler that way. | «no» Пояснение: Use cases should depend only on abstractions (interfaces) that describe the minimal contract needed, not concrete types like HTTP requests or EntityManagers, to keep them decoupled from technical frameworks and easily testable.
Raw{"answer": "false", "explanation": "Use cases should depend only on abstractions (interfaces) that describe the minimal contract needed, not concrete types like HTTP requests or EntityManagers, to keep them decoupled from technical frameworks and easily testable."} | верно | Use case принимает DTO и порты; привязка к HTTP/ORM протекает инфраструктуру во внутренние слои. |
T25-L7 0.19 c | Clean architecture | What is the component called that provides a collection of aggregates/entities while hiding the storage mechanism behind an interface? | «repository» Пояснение: The Repository pattern provides a collection of aggregates or entities behind an interface while abstracting away the underlying storage mechanism.
Raw{"answer": "Repository", "explanation": "The Repository pattern provides a collection of aggregates or entities behind an interface while abstracting away the underlying storage mechanism."} | верно | Repository pattern (DDD/Evans); в проекте — Doctrine-репозитории за портами. |
T25-L8 0.2 c | Clean architecture | In clean architecture, swapping PostgreSQL for another database touches only the outer layer — the domain and use cases stay unchanged. | «yes» Пояснение: In clean architecture, databases are implementation details isolated behind a gateway/framework boundary, so swapping them only affects the outer infrastructure layer while the domain and use cases remain unchanged.
Raw{"answer": "yes", "explanation": "In clean architecture, databases are implementation details isolated behind a gateway/framework boundary, so swapping them only affects the outer infrastructure layer while the domain and use cases remain unchanged."} | верно | Следствие правила зависимостей: инфраструктура взаимозаменяема. |
T26-L1 0.22 c | DDD | In DDD, an aggregate is just another name for a database table. | «no» Пояснение: An aggregate in DDD is a cluster of domain objects treated as a single unit of logical data and consistency boundaries, not a database table, which is a physical storage concept unrelated to the domain model.
Raw{"answer": "no", "explanation": "An aggregate in DDD is a cluster of domain objects treated as a single unit of logical data and consistency boundaries, not a database table, which is a physical storage concept unrelated to the domain model."} | верно | Агрегат — кластер объектов с границей согласованности (транзакционной вокруг корня); таблица — деталь хранения. |
T26-L2 0.19 c | DDD | A Value Object is immutable and compared by the values of its fields, not by identity. | «yes» Пояснение: A Value Object is indeed immutable and compared by the values of its fields rather than by reference identity, which is the defining characteristic distinguishing it from an Entity.
Raw{"answer": "yes", "explanation": "A Value Object is indeed immutable and compared by the values of its fields rather than by reference identity, which is the defining characteristic distinguishing it from an Entity."} | верно | Классика Evans: Money, Email; равенство структурное. |
T26-L3 0.21 c | DDD | What is the single external entry point of an aggregate, through which all changes must go, called? | «factory method» Пояснение: In DDD, the factory method serves as the single external entry point of an aggregate through which all changes and creation of new instances must occur, protecting the aggregate's invariants.
Raw{"answer": "Factory Method", "explanation": "In DDD, the factory method serves as the single external entry point of an aggregate through which all changes and creation of new instances must occur, protecting the aggregate's invariants."} | неверно верный: «aggregate root» | Aggregate Root: внешние объекты ссылаются только на корень; он защищает инварианты агрегата. |
T26-L4 0.21 c | DDD | In DDD, a repository is declared for an aggregate (its root), not for every entity. | «yes» Пояснение: In DDD, repositories are declared only for aggregates by their root entity to enforce aggregate invariants and prevent external objects from manipulating child entities directly.
Raw{"answer": "yes", "explanation": "In DDD, repositories are declared only for aggregates by their root entity to enforce aggregate invariants and prevent external objects from manipulating child entities directly."} | верно | Репозиторий корня хранит границу согласованности агрегата; вложенные сущности доступны только через корень. |
T26-L5 0.2 c | DDD | Ubiquitous language is the model's shared language common to developers and domain experts. | «yes» Пояснение: Ubiquitous language in Domain-Driven Design refers to the shared, precise vocabulary developed collaboratively by developers and domain experts that is used consistently throughout the software model and communications.
Raw{"answer": "yes", "explanation": "Ubiquitous language in Domain-Driven Design refers to the shared, precise vocabulary developed collaboratively by developers and domain experts that is used consistently throughout the software model and communications."} | верно | Evans: язык из требований переходит в имена классов и методов. |
T26-L6 0.22 c | DDD | What is the boundary called within which a model and its language are consistent, while outside the same words mean other models? | «semantics domain» Пояснение: The semantics domain is the boundary within which a set of words and their meanings remain consistent with a model, while outside this boundary the same words take on different meanings under different models.
Raw{"answer": "Semantics domain", "explanation": "The semantics domain is the boundary within which a set of words and their meanings remain consistent with a model, while outside this boundary the same words take on different meanings under different models."} | неверно верный: «bounded context» | Bounded Context; «Заказ» в биллинге и в доставке — разные модели. |
T26-L7 0.26 c | DDD | An anemic model (objects with only getters/setters, logic in services) is the recommended DDD style. | «no» Пояснение: Anemic domain models are widely considered an anti-pattern in DDD; rich domain models that encapsulate behavior and enforce invariants within the entities themselves are the recommended approach.
Raw```json ⏎ { ⏎ "answer": "false", ⏎ "explanation": "Anemic domain models are widely considered an anti-pattern in DDD; rich domain models that encapsulate behavior and enforce invariants within the entities themselves are the recommended approach." ⏎ } ⏎ ``` | верно | Наоборот: Evans называет анемичность антипаттерном — поведение должно жить в доменных объектах. |
T26-L8 0.28 c | DDD | Bounded context means each context has its own model: the same concept in different contexts is a different class. | «yes» Пояснение: A bounded context in Domain-Driven Design establishes a explicit boundary within which a model is defined and meaningful, so the same concept (like 'Customer' or 'Product') can be represented as different classes in different bounded contexts to serve each context's specific needs.
Raw{"answer": "yes", "explanation": "A bounded context in Domain-Driven Design establishes a explicit boundary within which a model is defined and meaningful, so the same concept (like 'Customer' or 'Product') can be represented as different classes in different bounded contexts to serve each context's specific needs."} | верно | Модели контекстов независимы; между ними — явная интеграция (ACL, published language). |
T13-L1 0.32 c | Symfony | Services in the Symfony DI container are created lazily by default — on first use. | «no» Пояснение: Symfony creates all services eagerly (lazily at compile time for the public container is misleading) — services are instantiated when requested, but the default behavior is not lazy creation on first use in the general sense; services are created when injected or fetched, though the container can create them upfront during container building for optimizability.
Raw{"answer": "no", "explanation": "Symfony creates all services eagerly (lazily at compile time for the public container is misleading) — services are instantiated when requested, but the default behavior is not lazy creation on first use in the general sense; services are created when injected or fetched, though the container can create them upfront during container building for optimizability."} | неверно верный: «yes» | Контейнер инстанцирует сервис при первом извлечении; eager-создания по умолчанию нет. |
T13-L2 0.2 c | Symfony | Which Symfony console command lists all registered routes? | «bin/console debug:router» Пояснение: The `debug:router` command in Symfony's Console component lists all registered routes in the application.
Raw{"answer": "bin/console debug:router", "explanation": "The `debug:router` command in Symfony's Console component lists all registered routes in the application."} | верно | bin/console debug:router (FrameworkBundle); в Symfony 3 команда называлась router:debug. |
T13-L3 0.17 c | Symfony | Symfony autowiring requires manually declaring every service in services.yaml. | «no» Пояснение: Symfony autowiring automatically infers and injects service dependencies without requiring you to manually declare every service in services.yaml.
Raw{"answer": "no", "explanation": "Symfony autowiring automatically infers and injects service dependencies without requiring you to manually declare every service in services.yaml."} | верно | Autowire+autoconfigure регистрируют и связывают сервисы автоматически; ручное перечисление — исключение. |
T13-L4 0.15 c | Symfony | Twig templates are compiled into PHP classes and cached between requests. | «yes» Пояснение: Twig compiles templates into optimized PHP classes and caches them on disk to avoid recompiling between requests.
Raw{"answer": "yes", "explanation": "Twig compiles templates into optimized PHP classes and caches them on disk to avoid recompiling between requests."} | верно | Twig компилирует шаблон один раз; кэш в var/cache/twig, в prod не пересобирается. |
T13-L5 0.2 c | Symfony | In the Symfony dev environment the DI container is rebuilt only after tracked files change, not on every request. | «yes» Пояснение: In Symfony's dev environment, the container cache is only invalidated and rebuilt when tracked configuration or source files change, determined by a checksum comparison rather than on every request.
Raw{"answer": "true", "explanation": "In Symfony's dev environment, the container cache is only invalidated and rebuilt when tracked configuration or source files change, determined by a checksum comparison rather than on every request."} | верно | Kernel проверяет freshness ресурсов (конфиги, классы); иначе переиспользуется кэш контейнера. |
T13-L6 0.17 c | Symfony | Which environment variable selects the active Symfony environment (dev/prod)? | «symfun_env» Пояснение: The Symfony app is initialized with the environment from the Symfony_env environment variable, defaulting to 'prod'.
Raw{"answer": "SYMFUN_ENV", "explanation": "The Symfony app is initialized with the environment from the Symfony_env environment variable, defaulting to 'prod'."} | неверно верный: «app_env» | APP_ENV в .env; APP_DEBUG — отдельный флаг отладки. |
T13-L7 0.48 c | Symfony | A controller method can be private — Symfony routing works with any method of the class. | «yes» Пояснение: In Symfony, controllers can be any class with any public method (or callable), as long as the routing configuration points to it; however, private methods cannot be used as controller actions since Symfony invokes them via a callable that requires public visibility.
Raw```json ⏎ {"answer": "yes", "explanation": "In Symfony, controllers can be any class with any public method (or callable), as long as the routing configuration points to it; however, private methods cannot be used as controller actions since Symfony invokes them via a callable that requires public visibility."} ⏎ ``` ⏎ ⏎ Wait, I need to reconsider this. The statement says "private" specifically. ⏎ ⏎ ```json ⏎ {"answer": "no", "explanation": "Symfony routing requires controller methods to be public, as private methods cannot be accessed or invoked from outside the class, making them unusable as controller actions."} ⏎ ``` | неверно верный: «no» | Действие контроллера должно быть public; приватный метод по маршруту не вызывается. |
T13-L8 0.24 c | Symfony | Event subscribers always receive events before listeners, because the interface gives them priority. | «no» Пояснение: Event subscribers and listeners in Symfony's EventDispatcher do not have inherent priority differences based on being subscribers, as priority is determined by the listener's priority value passed at registration, not by whether it is a subscriber.
Raw{"answer": "no", "explanation": "Event subscribers and listeners in Symfony's EventDispatcher do not have inherent priority differences based on being subscribers, as priority is determined by the listener's priority value passed at registration, not by whether it is a subscriber."} | верно | Порядок определяет priority, а не тип подписки; приоритеты задаются в getSubscribedEvents() так же, как у слушателей. |
T22-L1 0.19 c | Symfony: Security and forms | In modern Symfony (6.0+) authentication is built on authenticator classes (AuthenticatorInterface); the old guard system has been removed. | «yes» Пояснение: In Symfony 6.0+, authentication is built on the newer authenticator system using AuthenticatorInterface, and the old Guard system has been removed.
Raw{"answer": "yes", "explanation": "In Symfony 6.0+, authentication is built on the newer authenticator system using AuthenticatorInterface, and the old Guard system has been removed."} | верно | Guard объявлен устаревшим в 5.3 и удалён в 6.0; в проекте symfony/security-bundle 8.1. |
T22-L2 0.22 c | Symfony: Security and forms | Which Symfony attribute checks a role/permission right on a controller method (403 without it)? | «@isgranted» Пояснение: The @IsGranted attribute (from Symfony Security bundle) checks a role or permission right on a controller method and returns HTTP 403 when the user lacks the required privilege.
Raw{"answer": "@IsGranted", "explanation": "The @IsGranted attribute (from Symfony Security bundle) checks a role or permission right on a controller method and returns HTTP 403 when the user lacks the required privilege."} | верно | #[IsGranted('ROLE_ADMIN')]; атрибут из symfony/security-http. |
T22-L3 0.27 c | Symfony: Security and forms | Voters are Symfony's mechanism for checking access to a specific object: isGranted('EDIT', $post). | «no» Пояснение: Voters are Symfony's mechanism for checking access, but 'EDIT' (all caps) is not a valid attribute—attributes are developer-defined strings like 'edit_post', and the example should be isGranted('edit_post', $post).
Raw{"answer": "false", "explanation": "Voters are Symfony's mechanism for checking access, but 'EDIT' (all caps) is not a valid attribute—attributes are developer-defined strings like 'edit_post', and the example should be isGranted('edit_post', $post)."} | неверно верный: «yes» | VoterInterface->vote(); docs Symfony — Voters. |
T22-L4 0.28 c | Symfony: Security and forms | In modern Symfony (7+) validation constraints are declared as PHP attributes (#[Assert\NotBlank]); doctrine annotations are no longer supported. | «yes» Пояснение: In Symfony 7+, validation constraints should be declared using PHP attributes rather than annotations, as Doctrine annotations were deprecated in Symfony 6 and removed in Symfony 7, with PHP 8 attributes becoming the recommended and supported approach.
Raw```json ⏎ {"answer": "yes", "explanation": "In Symfony 7+, validation constraints should be declared using PHP attributes rather than annotations, as Doctrine annotations were deprecated in Symfony 6 and removed in Symfony 7, with PHP 8 attributes becoming the recommended and supported approach."} ⏎ ``` | верно | Докблок-аннотации удалены в Symfony 7.0; стандарт — атрибуты. В проекте symfony/validator 8.1. |
T22-L5 0.23 c | Symfony: Security and forms | CSRF protection of Symfony forms is enabled by default: the form validates the token on submission. | «yes» Пояснение: Symfony forms have CSRF protection enabled by default, generating and validating a token automatically when the 'csrf_protection' option (defaulting to true) is enabled.
Raw```json ⏎ {"answer": "yes", "explanation": "Symfony forms have CSRF protection enabled by default, generating and validating a token automatically when the 'csrf_protection' option (defaulting to true) is enabled."} ⏎ ``` | верно | FormType добавляет скрытое поле _token и проверяет его при валидации; отключение — осознанное исключение (csrf: false). |
T22-L6 0.17 c | Symfony: Security and forms | Form validation in Symfony runs server-side even if the client-side (HTML5) checks passed. | «yes» Пояснение: Symfony's form validation always runs server-side regardless of client-side HTML5 validation, since client-side checks can be bypassed.
Raw{"answer": "yes", "explanation": "Symfony's form validation always runs server-side regardless of client-side HTML5 validation, since client-side checks can be bypassed."} | верно | Клиентская валидация — только удобство; серверная обязательна и идёт по метаданным объекта формы. |
T22-L7 0.17 c | Symfony: Security and forms | Which Symfony maker command generates a form class (FormType)? | «make:form» Пояснение: The `make:form` command in Symfony's MakerBundle scaffolds a new form class (FormType).
Raw{"answer": "make:form", "explanation": "The `make:form` command in Symfony's MakerBundle scaffolds a new form class (FormType)."} | верно | bin/console make:form (symfony/maker-bundle — в проекте). |
T22-L8 0.19 c | Symfony: Security and forms | Symfony stores the user's password in the session in plain text. | «no» Пояснение: Symfony never stores the user's password in the session; it stores an authentication token, and passwords are hashed using a password hasher, never kept in plain text.
Raw{"answer": "no", "explanation": "Symfony never stores the user's password in the session; it stores an authentication token, and passwords are hashed using a password hasher, never kept in plain text."} | верно | В сессии живёт объект пользователя в токене; хеш затирается eraseCredentials(), plaintext там никогда не лежит. |
T23-L1 0.21 c | Symfony: configuration and services | Symfony bundle configuration lives in config/packages — one file per bundle or topic. | «yes» Пояснение: In Symfony, bundle and third-party configuration is stored in the config/packages directory with one YAML file per bundle or configuration topic.
Raw```json ⏎ { ⏎ "answer": "yes", ⏎ "explanation": "In Symfony, bundle and third-party configuration is stored in the config/packages directory with one YAML file per bundle or configuration topic." ⏎ } ⏎ ``` | верно | Стандартная структура (config/packages/*.yaml); перегрузка — config/packages/<env>. |
T23-L2 0.21 c | Symfony: configuration and services | The .env file with dev defaults is committed to the repository, while real secrets live in the non-committed .env.local. | «no» Пояснение: This is backwards: .env.local is typically the non-committed file holding real secrets, while .env (or .env.dist/.env.example) contains safe defaults committed to the repository.
Raw{"answer": "false", "explanation": "This is backwards: .env.local is typically the non-committed file holding real secrets, while .env (or .env.dist/.env.example) contains safe defaults committed to the repository."} | неверно верный: «yes» | symfony/dotenv: .env — общий безопасный набор значений; локальные секреты — .env.local (gitignored) или secrets-хранилище. |
T23-L3 0.19 c | Symfony: configuration and services | Which Symfony command lists the container's registered services and their aliases? | «debug:container» Пояснение: The `debug:container` command displays all registered services in the Symfony container along with their aliases.
Raw{"answer": "debug:container", "explanation": "The `debug:container` command displays all registered services in the Symfony container along with their aliases."} | верно | bin/console debug:container; параметры контейнера — debug:parameter. |
T23-L4 0.22 c | Symfony: configuration and services | The Symfony container allows changing parameters at runtime: $container->setParameter() works from a controller. | «no» Пояснение: In Symfony, the service container is compiled at build time, so setParameter() only works on the raw (uncompiled) container before compilation, not at runtime from a controller which uses the compiled container.
Raw{"answer": "false", "explanation": "In Symfony, the service container is compiled at build time, so setParameter() only works on the raw (uncompiled) container before compilation, not at runtime from a controller which uses the compiled container."} | верно | Контейнер компилируется и замораживается; runtime-значения — только через переменные окружения. |
T23-L5 0.2 c | Symfony: configuration and services | By default, Symfony services are public (public: true) — you can fetch them directly from the container. | «no» Пояснение: By default, Symfony services are private (public: false), and you must explicitly mark them as public to fetch them directly from the container.
Raw{"answer": "no", "explanation": "By default, Symfony services are private (public: false), and you must explicitly mark them as public to fetch them directly from the container."} | верно | С Symfony 4.0 сервисы по умолчанию private: инжектятся через autowiring; $container->get() — только для публичных. |
T23-L6 0.17 c | Symfony: configuration and services | Without a config file in config/packages a bundle will not work — configuration is mandatory for every bundle. | «no» Пояснение: Bundles work without a config file because they provide default configuration via their Extension class, making configuration optional rather than mandatory.
Raw{"answer": "no", "explanation": "Bundles work without a config file because they provide default configuration via their Extension class, making configuration optional rather than mandatory."} | верно | У бандлов есть встроенные умолчания (Extension); конфиг нужен только для отклонений от них. |
T23-L7 0.2 c | Symfony: configuration and services | Environment variable values are injected into services.yaml using the %env(VAR)% syntax. | «yes» Пояснение: In Symfony, environment variables are injected into configuration files using the %env(VAR)% syntax, which is then resolved at runtime from actual environment variables or .env files.
Raw{"answer": "yes", "explanation": "In Symfony, environment variables are injected into configuration files using the %env(VAR)% syntax, which is then resolved at runtime from actual environment variables or .env files."} | верно | %env(...)% резолвится в рантайме env-процессорами; docs — Env Var Processors. |
T23-L8 0.16 c | Symfony: configuration and services | Which Symfony environment variable enables debug mode (affects the profiler and Twig debugging)? | «app_debug» Пояснение: The APP_DEBUG environment variable controls Symfony's debug mode, enabling the profiler and Twig debugging when set to true.
Raw{"answer": "APP_DEBUG", "explanation": "The APP_DEBUG environment variable controls Symfony's debug mode, enabling the profiler and Twig debugging when set to true."} | верно | APP_DEBUG=1 (в .env dev-окружения); окружение выбирает APP_ENV — см. T13-L6. |
T16-L1 0.15 c | Symfony: Messenger | A single message in Symfony Messenger can only have one handler. | «no» Пояснение: A single message in Symfony Messenger can have multiple handlers registered to process it simultaneously.
Raw```json ⏎ {"answer": "false", "explanation": "A single message in Symfony Messenger can have multiple handlers registered to process it simultaneously."} ⏎ ``` | верно | Messenger вызывает все хендлеры, подписанные на класс сообщения (docs — Multiple Handlers). |
T16-L2 0.16 c | Symfony: Messenger | The sync transport in Messenger queues the message for a worker, just like async. | «no» Пояснение: The sync transport sends messages and processes them immediately in the same request rather than queuing them for a separate worker.
Raw{"answer": "no", "explanation": "The sync transport sends messages and processes them immediately in the same request rather than queuing them for a separate worker."} | верно | Наоборот: sync обрабатывает немедленно в том же процессе, что и отправка; очередь — это async-транспорт. |
T16-L3 0.19 c | Symfony: Messenger | Which console command starts the worker that processes Messenger queue messages? | «php artisan queue:work» Пояснение: The queue:work command starts a queue worker that consumes and processes messages from a queue, including those dispatched through Laravel's Messenger system.
Raw{"answer": "php artisan queue:work", "explanation": "The queue:work command starts a queue worker that consumes and processes messages from a queue, including those dispatched through Laravel's Messenger system."} | неверно верный: «messenger:consume» | bin/console messenger:consume async; воркеры под supervisord/systemd в проде. |
T16-L4 0.18 c | Symfony: Messenger | Retries for failed messages (retry_strategy) are configured per Messenger transport. | «yes» Пояснение: In Symfony's Messenger, retry strategies (including retry attempts, multiplier, and delay) are configured per transport in the messenger configuration under the retry option.
Raw{"answer": "yes", "explanation": "In Symfony's Messenger, retry strategies (including retry attempts, multiplier, and delay) are configured per transport in the messenger configuration under the retry option."} | верно | retry_strategy на транспорте: max_retries, delay, multiplier; docs — Failed Messages & Retries. |
T16-L5 0.18 c | Symfony: Messenger | By default, Messenger serializes messages to JSON. | «no» Пояснение: By default, Symfony Messenger serializes messages using PHP's native serialization, not JSON, which must be explicitly configured via the serializer's encoders.
Raw{"answer": "false", "explanation": "By default, Symfony Messenger serializes messages using PHP's native serialization, not JSON, which must be explicitly configured via the serializer's encoders."} | верно | Дефолтный сериализатор — PhpSerializer (serialize()); JSON-сериализатор включается отдельно. |
T16-L6 0.27 c | Symfony: Messenger | Symfony Scheduler produces messages on a schedule and dispatches them through Messenger. | «no» Пояснение: Symfony has no built-in 'Scheduler' component that dispatches messages through Messenger; scheduled tasks in Symfony use the `timer` feature (Symfony 7.2+) or the cron/mailer patterns, and the `symfony/clock` component manages time, not scheduling tasks to Messenger.
Raw{"answer": "false", "explanation": "Symfony has no built-in 'Scheduler' component that dispatches messages through Messenger; scheduled tasks in Symfony use the `timer` feature (Symfony 7.2+) or the cron/mailer patterns, and the `symfony/clock` component manages time, not scheduling tasks to Messenger."} | неверно верный: «yes» | Schedule → RecurringMessage → шина Messenger; docs — Scheduler. |
T16-L7 0.16 c | Symfony: Messenger | Which built-in Messenger transport stores messages in database tables via Doctrine? | «doctrinemessengertransport» Пояснение: The Doctrine Messenger transport stores messages in database tables using Doctrine ORM.
Raw{"answer": "DoctrineMessengerTransport", "explanation": "The Doctrine Messenger transport stores messages in database tables using Doctrine ORM."} | неверно верный: «doctrine» | Транспорт doctrine (symfony/doctrine-messenger); таблица messenger_messages. В проекте стоит amqp-messenger + doctrine-messenger. |
T16-L8 0.17 c | Symfony: Messenger | The Messenger pipeline can be extended with custom middleware, placed before or after the built-in ones. | «yes» Пояснение: The Messenger pipeline supports custom middleware that can be placed before or after built-in middleware using tags like messenger.middleware and ordering priority.
Raw{"answer": "true", "explanation": "The Messenger pipeline supports custom middleware that can be placed before or after built-in middleware using tags like messenger.middleware and ordering priority."} | верно | messenger.bus.*.middleware в yaml; docs — Middleware. |
T28-L1 0.16 c | Symfony: versions | Symfony major releases come every two years, minor ones every six months (in May and November). | «no» Пояснение: Symfony major releases come every year (in November), not every two years.
Raw```json ⏎ {"answer": "no", "explanation": "Symfony major releases come every year (in November), not every two years."} ⏎ ``` | неверно верный: «yes» | Стандартный релизный цикл: 8.0 — ноябрь 2025, 8.1 — май 2026, 8.2 — ноябрь 2026. |
T28-L2 0.17 c | Symfony: versions | What is the minimum PHP version required by Symfony 8? | «php 8.4» Пояснение: Symfony 8 requires a minimum of PHP 8.4 as specified in its component composer.json files.
Raw{"answer": "PHP 8.4", "explanation": "Symfony 8 requires a minimum of PHP 8.4 as specified in its component composer.json files."} | верно | Symfony 8.0 поднял требование до PHP >= 8.4.1 (в vendor проекта: "php": ">=8.4.1"). |
T28-L3 0.22 c | Symfony: versions | Symfony 7.0 kept support for docblock annotations (validation, routes). | «yes» Пояснение: Symfony 7.0 removed support for using attributes in some contexts but kept backward compatibility with docblock annotations for validation and routing, so both annotation and attribute styles remain functional in Symfony 7.0.
Raw{"answer": "yes", "explanation": "Symfony 7.0 removed support for using attributes in some contexts but kept backward compatibility with docblock annotations for validation and routing, so both annotation and attribute styles remain functional in Symfony 7.0."} | неверно верный: «no» | Наоборот: в 7.0 аннотации удалены — только PHP-атрибуты (#[Route], #[Assert\NotBlank]). |
T28-L4 0.19 c | Symfony: versions | AssetMapper manages CSS/JS without node or webpack — via importmap.php. | «no» Пояснение: AssetMapper manages CSS/JS without node or webpack, but it uses assets.php (not importmap.php) to configure import mappings and vendor assets.
Raw{"answer": "no", "explanation": "AssetMapper manages CSS/JS without node or webpack, but it uses assets.php (not importmap.php) to configure import mappings and vendor assets."} | неверно верный: «yes» | symfony/asset-mapper (с 6.3, стандарт с 7.x); в проекте — importmap.php в корне и asset-mapper 8.1. |
T28-L5 0.22 c | Symfony: versions | Symfony 6.4 is a regular release without long-term support. | «no» Пояснение: Symfony 6.4 is an LTS (Long-Term Support) release, not a regular release, as it is one of the versions that receives extended support for three years plus bug fixes and security updates.
Raw{"answer": "no", "explanation": "Symfony 6.4 is an LTS (Long-Term Support) release, not a regular release, as it is one of the versions that receives extended support for three years plus bug fixes and security updates."} | верно | Наоборот: 6.4 — LTS (расширенная поддержка); LTS выходит вместе с очередным мажором (6.4 — вместе с 7.0). |
T28-L6 0.18 c | Symfony: versions | When moving to a new Symfony major version, deprecations of the previous branch keep working — major releases do not remove them. | «no» Пояснение: Major releases do remove deprecations from the previous branch, as deprecations are typically cleaned up when moving to a new major version.
Raw{"answer": "no", "explanation": "Major releases do remove deprecations from the previous branch, as deprecations are typically cleaned up when moving to a new major version."} | верно | Наоборот: мажорный релиз удаляет всё устаревшее (7.0 убрал деприкейшены 6.x, 8.0 — 7.x). |
T28-L7 0.16 c | Symfony: versions | Every Symfony major release is accompanied by an UPGRADE guide listing the changes. | «yes» Пояснение: Symfony provides UPGRADE docs for each major (and minor) release, documenting the changes and migration steps.
Raw{"answer": "yes", "explanation": "Symfony provides UPGRADE docs for each major (and minor) release, documenting the changes and migration steps."} | верно | UPGRADE-7.0.md, UPGRADE-8.0.md в репозитории symfony/symfony. |
T28-L8 0.17 c | Symfony: versions | Which Symfony component manages assets and the importmap without node/webpack? | «symfony/importmap» Пояснение: The Symfony Importmap component manages frontend assets via the modern importmap approach without requiring Node.js or Webpack.
Raw{"answer": "symfony/importmap", "explanation": "The Symfony Importmap component manages frontend assets via the modern importmap approach without requiring Node.js or Webpack."} | неверно верный: «asset-mapper» | symfony/asset-mapper 8.1 — в проекте. |
T29-L1 0.26 c | Symfony: 8.2 and beyond | As of 2026-11-07, Symfony 8.2 has already been released. | «no» Пояснение: Symfony releases follow a fixed schedule with major versions released in November each year, so Symfony 8.0 would be released in November 2025, but there is no Symfony 8.2 release as major versions are only released annually in November.
Raw{"answer": "false", "explanation": "Symfony releases follow a fixed schedule with major versions released in November each year, so Symfony 8.0 would be released in November 2025, but there is no Symfony 8.2 release as major versions are only released annually in November."} | верно | Наоборот: 8.2 ещё не выпущена — релиз в конце ноября 2026; последняя стабильная — 8.1. |
T29-L2 0.28 c | Symfony: 8.2 and beyond | As of 2026-11-07, Symfony 8.2 is scheduled for November 2026, following the usual six-month cycle. | «no» Пояснение: Symfony releases follow a predictable cycle with even-numbered minor versions (like 7.2) released in odd years (November 2026), while the next 8.x release would be scheduled for May 2027, not November 2026.
Raw{"answer": "false", "explanation": "Symfony releases follow a predictable cycle with even-numbered minor versions (like 7.2) released in odd years (November 2026), while the next 8.x release would be scheduled for May 2027, not November 2026."} | неверно верный: «yes» | Политика релизов: 8.1 — май 2026, 8.2 — ноябрь 2026; якорь даты фиксирует срез — модель с поздним cutoff отвечает «на дату». |
T29-L3 0.22 c | Symfony: 8.2 and beyond | Which Symfony version comes after 8.1 (as of 2026-11-07)? | «8.2» Пояснение: Symfony follows a regular versioning cadence where major releases are numbered by year, so version 8.1 is followed by 8.2.
Raw{"answer": "8.2", "explanation": "Symfony follows a regular versioning cadence where major releases are numbered by year, so version 8.1 is followed by 8.2."} | верно | 8.2 — следующий минорный релиз (ноябрь 2026); после его выхода проект переходит с 8.1.* на 8.2.*. |
T29-L4 0.26 c | Symfony: 8.2 and beyond | Symfony 8.2 is a major release requiring applications to be rewritten for new APIs. | «no» Пояснение: Symfony 8.2 is not an existing release (Symfony versions are like 6.x/7.x), and the claim about requiring full rewrites for major releases is inaccurate since Symfony maintains backward compatibility within major versions.
Raw{"answer": "no", "explanation": "Symfony 8.2 is not an existing release (Symfony versions are like 6.x/7.x), and the claim about requiring full rewrites for major releases is inaccurate since Symfony maintains backward compatibility within major versions."} | верно | Наоборот: 8.2 — минорный релиз; новые возможности без поломки обратной совместимости. Мажор — 9.0. |
T29-L5 0.27 c | Symfony: 8.2 and beyond | Updating within a major branch (8.1 → 8.2) should not require code changes — backward compatibility is preserved. | «no» Пояснение: While PHP generally prioritizes backward compatibility within major versions (e.g., 8.1 → 8.2), it does remove deprecated features and occasionally introduces breaking changes, so code changes may still be required.
Raw{"answer": "false", "explanation": "While PHP generally prioritizes backward compatibility within major versions (e.g., 8.1 → 8.2), it does remove deprecated features and occasionally introduces breaking changes, so code changes may still be required."} | неверно верный: «yes» | Политика Symfony: минорные релизы обратно совместимы; BC-break допустим только в мажорных. |
T29-L6 0.27 c | Symfony: 8.2 and beyond | Which minor version of the 8.x branch is released last, before Symfony 9.0? | «8.4» Пояснение: Symfony follows a versioning scheme where the 8.x branch continues receiving minor versions through its LTS release, with 8.4 being the last minor version before Symfony 9.0 is released.
Raw{"answer": "8.4", "explanation": "Symfony follows a versioning scheme where the 8.x branch continues receiving minor versions through its LTS release, with 8.4 being the last minor version before Symfony 9.0 is released."} | верно | По циклу: 8.2 (ноя 2026), 8.3 (май 2027), 8.4 (ноя 2027, вместе с 9.0) — как 6.4 выходила вместе с 7.0. |
T29-L7 0.28 c | Symfony: 8.2 and beyond | Symfony 8.2 will require PHP 8.5 — you would have to upgrade PHP along with it. | «no» Пояснение: Symfony 8.0 requires PHP 8.4, not 8.5, and there is no Symfony 8.2 version as of the current release schedule.
Raw```json ⏎ { ⏎ "answer": "no", ⏎ "explanation": "Symfony 8.0 requires PHP 8.4, not 8.5, and there is no Symfony 8.2 version as of the current release schedule." ⏎ } ⏎ ``` | верно | Наоборот: минорные релизы не поднимают требования PHP; для всей ветки 8.x остаётся PHP >= 8.4. |
T29-L8 0.24 c | Symfony: 8.2 and beyond | Deprecations added in the 8.x branch will not be removed before Symfony 9.0. | «yes» Пояснение: Symfony's long-term support policy states that deprecations introduced in the 8.x branch will remain until Symfony 9.0, giving developers time to migrate.
Raw{"answer": "yes", "explanation": "Symfony's long-term support policy states that deprecations introduced in the 8.x branch will remain until Symfony 9.0, giving developers time to migrate."} | верно | Политика: деприкейшены живут до следующего мажора; 9.0 — ноябрь 2027. |
T21-L1 0.18 c | Twig | Inside {{ }}, Twig allows calling arbitrary PHP code directly. | «no» Пояснение: Twig's {{ }} syntax is only for outputting expressions, not for executing arbitrary PHP code blocks, which are restricted for security reasons.
Raw{"answer": "false", "explanation": "Twig's {{ }} syntax is only for outputting expressions, not for executing arbitrary PHP code blocks, which are restricted for security reasons."} | верно | Twig — DSL: только разрешённые окружением функции/фильтры; произвольный PHP не исполняется. |
T21-L2 0.16 c | Twig | By default, Twig auto-escapes printed variables. | «yes» Пояснение: Twig automatically escapes printed variables using the HTML escaper by default unless explicitly disabled with the |raw filter.
Raw{"answer": "yes", "explanation": "Twig automatically escapes printed variables using the HTML escaper by default unless explicitly disabled with the |raw filter."} | верно | Autoescape включён по умолчанию; {{ '<b>' }} → <b>. Проверено на Twig 3.30. |
T21-L3 0.16 c | Twig | The Twig |e filter escapes a string for safe output in an HTML context. | «yes» Пояснение: The Twig |e filter (equivalent to |html) escapes strings for safe HTML output by default.
Raw{"answer": "yes", "explanation": "The Twig |e filter (equivalent to |html) escapes strings for safe HTML output by default."} | верно | |e ('html') по умолчанию; есть контексты js/url/css. От SQL-инъекций он не защищает — это задача подготовленных запросов Doctrine. |
T21-L4 0.17 c | Twig | Which filter from twig/intl-extra formats a number according to a locale? | «number_format» Пояснение: The number_format filter from twig/intl-extra formats a number according to a specified locale using the Internationalization extension.
Raw{"answer": "number_format", "explanation": "The number_format filter from twig/intl-extra formats a number according to a specified locale using the Internationalization extension."} | неверно верный: «format_number» | |format_number(locale=...) из IntlExtension (twig/intl-extra есть в проекте). Проверено на Twig 3.30: 12345.6 → 12 345,6 (ru). |
T21-L5 0.18 c | Twig | The |raw filter disables auto-escaping for the value. | «yes» Пояснение: The |raw filter in Twig marks a value as safe and disables auto-escaping for that value, though it is generally discouraged for security reasons.
Raw{"answer": "yes", "explanation": "The |raw filter in Twig marks a value as safe and disables auto-escaping for that value, though it is generally discouraged for security reasons."} | верно | {{ x|raw }} выводит HTML как есть; опасно с пользовательскими данными. Проверено на Twig 3.30. |
T21-L6 0.18 c | Twig | In Twig, {{ }} prints an expression value, while {% %} executes tags — conditions, loops, set. | «yes» Пояснение: In Twig, {{ }} is used for printing expression values while {% %} is used for executing tags like conditions, loops, and set.
Raw{"answer": "yes", "explanation": "In Twig, {{ }} is used for printing expression values while {% %} is used for executing tags like conditions, loops, and set."} | верно | Два блока синтаксиса Twig: вывод (echo) против логики. |
T21-L7 0.23 c | Twig | In Twig you cannot declare a variable inside a template — values only come from the controller. | «no» Пояснение: Twig allows variable declaration inside templates using the set tag, e.g. '{% set x = 1 %}', so values don't only come from the controller.
Raw```json ⏎ { ⏎ "answer": "false", ⏎ "explanation": "Twig allows variable declaration inside templates using the set tag, e.g. '{% set x = 1 %}', so values don't only come from the controller." ⏎ } ⏎ ``` | верно | {% set y = ... %} объявляет переменную в шаблоне. Проверено на Twig 3.30. |
T21-L8 0.2 c | Twig | Which Twig function dumps the debug structure of a variable (array, object)? | «dump» Пояснение: The Twig `dump` function outputs the debug structure of a variable, similar to PHP's var_dump().
Raw{"answer": "dump", "explanation": "The Twig `dump` function outputs the debug structure of a variable, similar to PHP's var_dump()."} | верно | {{ dump(x) }} (DebugExtension; в Symfony доступна в dev-окружении). |
T24-L1 0.22 c | Bootstrap | Bootstrap is a CSS/JS library of ready-made UI components, not an SPA framework. | «yes» Пояснение: Bootstrap is indeed a front-end framework providing pre-built CSS and JavaScript UI components like navbars, cards, and modals, rather than a single-page application framework like React, Vue, or Angular.
Raw{"answer": "yes", "explanation": "Bootstrap is indeed a front-end framework providing pre-built CSS and JavaScript UI components like navbars, cards, and modals, rather than a single-page application framework like React, Vue, or Angular."} | верно | Компоненты и утилиты поверх вашего HTML; SPA-фреймворки (React/Vue) — другой класс инструментов. В проекте vendored 5.3.3. |
T24-L2 0.19 c | Bootstrap | Which Bootstrap class gives a responsive container with a fixed max width per breakpoint? | «container» Пояснение: The .container class in Bootstrap provides a responsive container with fixed maximum widths that change per breakpoint.
Raw```json ⏎ { ⏎ "answer": "container", ⏎ "explanation": "The .container class in Bootstrap provides a responsive container with fixed maximum widths that change per breakpoint." ⏎ } ⏎ ``` | верно | .container (фиксированная макс-ширина по брейкпоинтам) vs .container-fluid (на всю ширину). |
T24-L3 0.2 c | Bootstrap | The Bootstrap grid is built on CSS floats and splits a row into 16 columns. | «no» Пояснение: Bootstrap's modern grid (v4 and v5) is built on CSS Flexbox and uses a 12-column layout, not floats or 16 columns.
Raw{"answer": "no", "explanation": "Bootstrap's modern grid (v4 and v5) is built on CSS Flexbox and uses a 12-column layout, not floats or 16 columns."} | верно | Наоборот: flexbox (с Bootstrap 4) и 12 колонок; float-сетка — это Bootstrap 3. |
T24-L4 0.19 c | Bootstrap | Bootstrap's named breakpoints (the infix used in class names) are sm, md, lg, xl, xxl — five of them. | «no» Пояснение: Bootstrap's named breakpoints are sm, md, lg, xl, xxl, and the newest version adds xxxl, making six, not five.
Raw{"answer": "false", "explanation": "Bootstrap's named breakpoints are sm, md, lg, xl, xxl, and the newest version adds xxxl, making six, not five."} | неверно верный: «yes» | Тиров всего шесть: xs (без инфикса) + пять именованных (576/768/992/1200/1400 px). |
T24-L5 0.22 c | Bootstrap | Utilities like .mt-3 or .px-2 use the spacing scale: the number is a multiple of $spacer. | «yes» Пояснение: Bootstrap's spacing utilities (.mt-3, .px-2, etc.) use the spacing scale where each number corresponds to a multiple of the $spacer variable.
Raw```json ⏎ {"answer": "yes", "explanation": "Bootstrap's spacing utilities (.mt-3, .px-2, etc.) use the spacing scale where each number corresponds to a multiple of the $spacer variable."} ⏎ ``` | неверно верный: «no» | Spacing utilities; $spacer = 1rem. |
T24-L6 0.26 c | Bootstrap | Which Bootstrap 5 data attribute enables an interactive component (e.g. dropdown) on an element? | «data-bs-toggle» Пояснение: In Bootstrap 5, the data-bs-toggle attribute (prefixed with "bs" to namespace it) enables interactive components like dropdowns, collapse, and modals on an element.
Raw{"answer": "data-bs-toggle", "explanation": "In Bootstrap 5, the data-bs-toggle attribute (prefixed with \"bs\" to namespace it) enables interactive components like dropdowns, collapse, and modals on an element."} | верно | data-bs-toggle="dropdown" и т.п.; в Bootstrap 4 атрибут назывался data-toggle. |
T24-L7 0.18 c | Bootstrap | Bootstrap 5 components work without jQuery — in plain vanilla JS. | «yes» Пояснение: Bootstrap 5 was rewritten to remove the jQuery dependency, using plain vanilla JavaScript instead.
Raw{"answer": "yes", "explanation": "Bootstrap 5 was rewritten to remove the jQuery dependency, using plain vanilla JavaScript instead."} | верно | jQuery удалён в Bootstrap 5.0: data-bs-* атрибуты и JS API. В проекте vendored 5.3.3. |
T24-L8 0.23 c | Bootstrap | Dark mode in Bootstrap is enabled with a .dark class on the root element. | «no» Пояснение: In Bootstrap 5.3, dark mode is enabled with the `data-bs-theme="dark"` attribute on the root element (e.g., `<html>`), not with a `.dark` class.
Raw{"answer": "no", "explanation": "In Bootstrap 5.3, dark mode is enabled with the `data-bs-theme=\"dark\"` attribute on the root element (e.g., `<html>`), not with a `.dark` class."} | верно | Наоборот: тема включается атрибутом data-bs-theme="dark" (Color modes, с 5.3); класса .dark не существует. В проекте 5.3.3. |
T14-L1 0.23 c | Doctrine | Doctrine ORM creates database tables on the fly the first time an entity is used at runtime. | «no» Пояснение: Doctrine ORM does not automatically create database tables at runtime; table schema must be created explicitly using the schema-tool (e.g., the "orm:schema-tool:create" command) or migrations.
Raw```json ⏎ {"answer": "no", "explanation": "Doctrine ORM does not automatically create database tables at runtime; table schema must be created explicitly using the schema-tool (e.g., the \"orm:schema-tool:create\" command) or migrations."} ⏎ ``` | верно | Схему создают инструменты (migrations, schema tool); рантайм структуру БД не меняет. |
T14-L2 0.27 c | Doctrine | Which EntityManager method marks a new object as managed without executing SQL until flush()? | «persist()» Пояснение: The persist() method marks a new instance as managed and schedules it for insertion into the database, but no SQL is actually executed until flush() is called.
Raw```json ⏎ { ⏎ "answer": "persist()", ⏎ "explanation": "The persist() method marks a new instance as managed and schedules it for insertion into the database, but no SQL is actually executed until flush() is called." ⏎ } ⏎ ``` | верно | persist() регистрирует объект в Unit of Work; INSERT выполняется на flush(). |
T14-L3 0.21 c | Doctrine | In Doctrine ORM 3, the EntityManager::merge() method exists and makes the passed object managed. | «no» Пояснение: In Doctrine ORM 3, the EntityManager::merge() method was removed and is no longer available.
Raw```json ⏎ {"answer": "no", "explanation": "In Doctrine ORM 3, the EntityManager::merge() method was removed and is no longer available."} ⏎ ``` | верно | В ORM 3 merge() удалён (в vendor проекта 3.7.6 метода нет); в Doctrine 2.x merge() возвращал управляемую копию. Версия зафиксирована — ORM 3. |
T14-L4 0.2 c | Doctrine | DQL queries are written in terms of entities and their fields, not tables and columns. | «yes» Пояснение: DQL (Doctrine Query Language) is written in terms of entities and their fields rather than database tables and columns, which is one of its key advantages over raw SQL.
Raw{"answer": "yes", "explanation": "DQL (Doctrine Query Language) is written in terms of entities and their fields rather than database tables and columns, which is one of its key advantages over raw SQL."} | верно | Doctrine транслирует DQL в SQL; docs — DQL (Doctrine Query Language). |
T14-L5 0.27 c | Doctrine | What does $repository->find(999) return when no record with id 999 exists? | «null» Пояснение: When Doctrine's repository find() method cannot locate a record by the given identifier, it returns null rather than throwing an exception.
Raw{"answer": "null", "explanation": "When Doctrine's repository find() method cannot locate a record by the given identifier, it returns null rather than throwing an exception.", "explanation": "When Doctrine's repository find() method cannot locate a record by the given identifier, it returns null rather than throwing an exception."} | верно | find() возвращает null, если объект не найден (docs Repository methods). |
T14-L6 0.21 c | Doctrine | DoctrineBundle in Symfony automatically calls flush() at the end of every request. | «no» Пояснение: DoctrineBundle does not automatically call flush(); developers must explicitly call $entityManager->flush() to persist changes to the database.
Raw{"answer": "no", "explanation": "DoctrineBundle does not automatically call flush(); developers must explicitly call $entityManager->flush() to persist changes to the database."} | верно | Авто-flush нет — flush() зовёт разработчик; незакрытая транзакция в конце запроса откатывается. |
T14-L7 0.19 c | Doctrine | For a managed entity, changing a property is enough: flush() commits the change without an explicit persist() — the Unit of Work tracks changes. | «yes» Пояснение: For a managed entity, the Unit of Work tracks changes automatically, so a subsequent flush() will detect and persist the modification without needing an explicit persist().
Raw{"answer": "yes", "explanation": "For a managed entity, the Unit of Work tracks changes automatically, so a subsequent flush() will detect and persist the modification without needing an explicit persist()."} | верно | Dirty checking сравнивает снимки свойств; persist нужен только новым/отсоединённым объектам. |
T14-L8 0.17 c | Doctrine | remove() executes the SQL DELETE immediately, without waiting for flush(). | «yes» Пояснение: In Hibernate, the remove() method issues the SQL DELETE statement immediately (for the DELETE_STRATEGY), regardless of the flush setting.
Raw{"answer": "yes", "explanation": "In Hibernate, the remove() method issues the SQL DELETE statement immediately (for the DELETE_STRATEGY), regardless of the flush setting."} | неверно верный: «no» | remove() планирует удаление в Unit of Work; DELETE выполняется на flush() (docs — Deleting Objects). |
T15-L1 0.19 c | PostgreSQL | PostgreSQL uses MVCC, therefore readers block writers and writers block readers. | «no» Пояснение: PostgreSQL uses MVCC, but it is specifically designed so that readers do NOT block writers and writers do NOT block readers.
Raw```json ⏎ {"answer": "no", "explanation": "PostgreSQL uses MVCC, but it is specifically designed so that readers do NOT block writers and writers do NOT block readers."} ⏎ ``` | верно | Наоборот: благодаря MVCC читатели не блокируют писателей и наоборот (снимки строк); docs PostgreSQL — Concurrency Control. |
T15-L2 0.2 c | PostgreSQL | Which SQL command shows a query's execution plan without executing the query? | «explain» Пояснение: The EXPLAIN command (or EXPLAIN ANALYZE variants in some databases) displays the execution plan a database optimizer would use without actually running the query.
Raw{"answer": "EXPLAIN", "explanation": "The EXPLAIN command (or EXPLAIN ANALYZE variants in some databases) displays the execution plan a database optimizer would use without actually running the query."} | верно | EXPLAIN без ANALYZE только строит план; проверено на PostgreSQL 17.7. |
T15-L3 0.27 c | PostgreSQL | SERIAL and GENERATED ... AS IDENTITY are just two names for the same mechanism. | «no» Пояснение: SERIAL creates a sequence and integer column implicitly with a default nextval() value, while GENERATED ... AS IDENTITY uses the SQL-standard identity column mechanism with explicit generation clauses, so although both use sequences internally they differ in definition, behavior, and flexibility.
Raw```json ⏎ {"answer": "no", "explanation": "SERIAL creates a sequence and integer column implicitly with a default nextval() value, while GENERATED ... AS IDENTITY uses the SQL-standard identity column mechanism with explicit generation clauses, so although both use sequences internally they differ in definition, behavior, and flexibility."} ⏎ ``` | верно | SERIAL — нестандартный макрос (sequence + DEFAULT), IDENTITY — SQL-стандарт; различаются владением и правами. Оба есть в PG 17 (проверено). |
T15-L4 0.22 c | PostgreSQL | By default, a PostgreSQL UNIQUE constraint allows only one row with NULL in the column. | «no» Пояснение: In PostgreSQL, a UNIQUE constraint allows multiple rows with NULL values in the column because NULLs are considered distinct from each other per SQL standard.
Raw{"answer": "false", "explanation": "In PostgreSQL, a UNIQUE constraint allows multiple rows with NULL values in the column because NULLs are considered distinct from each other per SQL standard."} | верно | Наоборот: NULLS DISTINCT по умолчанию — несколько NULL допустимы; NULLS NOT DISTINCT — опция с PG 15. Проверено на PG 17.7. |
T15-L5 0.17 c | PostgreSQL | Which PostgreSQL aggregate function concatenates strings with a separator? | «string_agg» Пояснение: The string_agg() aggregate function in PostgreSQL concatenates values from multiple rows into a single string using a specified separator.
Raw{"answer": "string_agg", "explanation": "The string_agg() aggregate function in PostgreSQL concatenates values from multiple rows into a single string using a specified separator."} | верно | string_agg(значение, разделитель); проверено на PostgreSQL 17.7. |
T15-L6 0.22 c | PostgreSQL | Plain VACUUM returns the space occupied by dead tuples to the operating system. | «no» Пояснение: Plain VACUUM does not return freed space to the operating system; it only reclaims space for reuse within the table, whereas VACUUM FULL is required to return space to the OS.
Raw{"answer": "no", "explanation": "Plain VACUUM does not return freed space to the operating system; it only reclaims space for reuse within the table, whereas VACUUM FULL is required to return space to the OS."} | верно | VACUUM помечает место для переиспользования внутри таблицы; ОС его возвращает только VACUUM FULL (с эксклюзивной блокировкой). |
T15-L7 0.19 c | PostgreSQL | Which keyword in a window function definition partitions rows into groups the function is computed over? | «partition by» Пояснение: The PARTITION BY clause in a window function's OVER clause divides rows into groups (partitions) that the function is computed over separately.
Raw{"answer": "PARTITION BY", "explanation": "The PARTITION BY clause in a window function's OVER clause divides rows into groups (partitions) that the function is computed over separately."} | верно | OVER (PARTITION BY ...); проверено на PostgreSQL 17.7. |
T15-L8 0.21 c | PostgreSQL | The READ COMMITTED isolation level protects against non-repeatable reads. | «no» Пояснение: The READ COMMITTED isolation level does not protect against non-repeatable reads; it only protects against dirty reads, while REPEATABLE READ is the level that prevents non-repeatable reads.
Raw{"answer": "no", "explanation": "The READ COMMITTED isolation level does not protect against non-repeatable reads; it only protects against dirty reads, while REPEATABLE READ is the level that prevents non-repeatable reads."} | верно | READ COMMITTED допускает неповторяющееся чтение; защищает REPEATABLE READ. Проверено: SHOW transaction_isolation → read committed. |
T17-L1 0.19 c | PostgreSQL: transactions and indexes | By default, PostgreSQL wraps each single SQL statement in its own implicit transaction (autocommit). | «yes» Пояснение: By default, PostgreSQL runs in autocommit mode, where each single SQL statement is automatically wrapped in its own transaction and committed immediately after it completes.
Raw{"answer": "yes", "explanation": "By default, PostgreSQL runs in autocommit mode, where each single SQL statement is automatically wrapped in its own transaction and committed immediately after it completes."} | верно | Без BEGIN каждый оператор коммитится сам; docs PostgreSQL — Transactions. Проверено на PG 17. |
T17-L2 0.15 c | PostgreSQL: transactions and indexes | Which SQL command ends a transaction, committing all its changes? | «commit» Пояснение: The COMMIT command ends a transaction and permanently saves all changes made during it to the database.
Raw{"answer": "COMMIT", "explanation": "The COMMIT command ends a transaction and permanently saves all changes made during it to the database."} | верно | COMMIT (END — синоним). Проверено на PG 17. |
T17-L3 0.2 c | PostgreSQL: transactions and indexes | Indexes speed up more than SELECT: UPDATE and DELETE with a search on an indexed column benefit too. | «yes» Пояснение: Indexes not only speed up SELECT queries but also improve UPDATE and DELETE operations when they involve a search condition on an indexed column, since the index helps locate the target rows quickly.
Raw{"answer": "yes", "explanation": "Indexes not only speed up SELECT queries but also improve UPDATE and DELETE operations when they involve a search condition on an indexed column, since the index helps locate the target rows quickly."} | верно | Поиск строк для изменения идёт по индексу; docs PostgreSQL — Indexes. |
T17-L4 0.23 c | PostgreSQL: transactions and indexes | To roll back part of the statements inside a transaction, PostgreSQL uses SAVEPOINT. | «yes» Пояснение: True, PostgreSQL uses SAVEPOINT to create a marker within a transaction that can later be rolled back to with ROLLBACK TO SAVEPOINT, allowing part of a transaction to be undone without discarding the entire transaction.
Raw{"answer": "yes", "explanation": "True, PostgreSQL uses SAVEPOINT to create a marker within a transaction that can later be rolled back to with ROLLBACK TO SAVEPOINT, allowing part of a transaction to be undone without discarding the entire transaction."} | верно | SAVEPOINT name; ROLLBACK TO name — частичный откат без отмены всей транзакции. Проверено на PG 17. |
T17-L5 0.15 c | PostgreSQL: transactions and indexes | EXPLAIN ANALYZE shows the query plan without executing the query. | «no» Пояснение: EXPLAIN ANALYZE actually executes the query and reports timing information in addition to showing the query plan.
Raw{"answer": "no", "explanation": "EXPLAIN ANALYZE actually executes the query and reports timing information in addition to showing the query plan."} | верно | Наоборот: ANALYZE реально выполняет запрос (с побочными эффектами!) и показывает фактические времена узлов; план без выполнения — plain EXPLAIN. |
T17-L6 0.22 c | PostgreSQL: transactions and indexes | Which PostgreSQL extension adds vector types and indexes for embedding search? | «pgvector» Пояснение: pgvector is the open-source PostgreSQL extension that adds vector data types and index types (such as IVF, HNSW, and PQ) for efficient similarity search and embedding-based retrieval.
Raw{"answer": "pgvector", "explanation": "pgvector is the open-source PostgreSQL extension that adds vector data types and index types (such as IVF, HNSW, and PQ) for efficient similarity search and embedding-based retrieval."} | верно | CREATE EXTENSION vector (проект pgvector; в проекте образ pgvector/pgvector:pg17). |
T17-L7 0.18 c | PostgreSQL: transactions and indexes | A partial index (CREATE INDEX ... WHERE ...) is built only over rows satisfying the condition. | «yes» Пояснение: A partial index is built only over the subset of rows that satisfy the WHERE condition specified in the CREATE INDEX statement.
Raw{"answer": "yes", "explanation": "A partial index is built only over the subset of rows that satisfy the WHERE condition specified in the CREATE INDEX statement."} | верно | docs PostgreSQL — Partial Indexes; типичный кейс — индекс по «активным» записям. |
T17-L8 0.24 c | PostgreSQL: transactions and indexes | The SERIALIZABLE level in PostgreSQL is implemented by locking the rows a transaction reads. | «no» Пояснение: In PostgreSQL, SERIALIZABLE is actually implemented using REPEATABLE READ isolation plus a mechanism that checks for serialization violations via the serialization failure and automatic retry, not by locking rows read (unlike some other databases that use predicate locking).
Raw{"answer": "no", "explanation": "In PostgreSQL, SERIALIZABLE is actually implemented using REPEATABLE READ isolation plus a mechanism that checks for serialization violations via the serialization failure and automatic retry, not by locking rows read (unlike some other databases that use predicate locking)."} | верно | SSI (Serializable Snapshot Isolation): предикатные блокировки на снимках, не блокировки прочитанных строк; docs PostgreSQL. |
T19-L1 0.19 c | HTTP and REST API | HTTP status 201 means the request resulted in a new resource being created. | «yes» Пояснение: HTTP 201 Created indicates that the request has been successfully processed and resulted in the creation of a new resource.
Raw{"answer": "yes", "explanation": "HTTP 201 Created indicates that the request has been successfully processed and resulted in the creation of a new resource."} | верно | 201 Created; обычно на POST, часто с Location; RFC 9110. |
T19-L2 0.17 c | HTTP and REST API | Which HTTP status means a successful request with an empty response body (e.g. after DELETE)? | «204» Пояснение: HTTP 204 No Content indicates the request succeeded but there is no response body to send back.
Raw{"answer": "204", "explanation": "HTTP 204 No Content indicates the request succeeded but there is no response body to send back."} | верно | 204 No Content; RFC 9110. |
T19-L3 0.2 c | HTTP and REST API | The DELETE method is idempotent per the HTTP specification: repeating the request for the same resource does not change the outcome. | «yes» Пояснение: The DELETE method is idempotent because the first DELETE removes the resource and any subsequent DELETEs are also treated as successful, leaving the outcome (resource absent) unchanged.
Raw{"answer": "yes", "explanation": "The DELETE method is idempotent because the first DELETE removes the resource and any subsequent DELETEs are also treated as successful, leaving the outcome (resource absent) unchanged."} | верно | RFC 9110: DELETE идемпотентен (как PUT); идемпотентность ≠ безопасность — ресурс удаляется при первом вызове. |
T19-L4 0.18 c | HTTP and REST API | The Access-Control-Allow-Origin header is sent by the client so that the server agrees to accept requests from another origin. | «no» Пояснение: The Access-Control-Allow-Origin header is sent by the server, not the client, to indicate which origins are allowed to access the resource.
Raw{"answer": "no", "explanation": "The Access-Control-Allow-Origin header is sent by the server, not the client, to indicate which origins are allowed to access the resource."} | верно | Наоборот: заголовок шлёт СЕРВЕР в ответе, разрешая браузеру cross-origin запрос (CORS); в проекте nelmio/cors-bundle. |
T19-L5 0.24 c | HTTP and REST API | Status 429 Too Many Requests is used when a client exceeds a rate limit. | «yes» Пояснение: HTTP status 429 Too Many Requests is specifically defined by the IETF RFC 6585 to indicate that a user has sent too many requests in a given amount of time, i.e., has exceeded a rate limit.
Raw{"answer": "yes", "explanation": "HTTP status 429 Too Many Requests is specifically defined by the IETF RFC 6585 to indicate that a user has sent too many requests in a given amount of time, i.e., has exceeded a rate limit."} | верно | 429 (+ Retry-After); RFC 6585. В проекте symfony/rate-limiter. |
T19-L6 0.19 c | HTTP and REST API | 5xx codes mean a client error, while 4xx means a server-side error. | «no» Пояснение: The statement is reversed: 4xx codes indicate client errors, while 5xx codes indicate server-side errors.
Raw{"answer": "no", "explanation": "The statement is reversed: 4xx codes indicate client errors, while 5xx codes indicate server-side errors."} | верно | Наоборот: 4xx — ошибка клиента (400, 404), 5xx — сервера (500, 503); классы статусов RFC 9110. |
T19-L7 0.15 c | HTTP and REST API | Which HTTP header indicates the MIME type of the request or response body? | «content-type» Пояснение: The Content-Type header specifies the MIME type of the body of an HTTP request or response.
Raw{"answer": "Content-Type", "explanation": "The Content-Type header specifies the MIME type of the body of an HTTP request or response."} | верно | Content-Type: application/json и т.п. |
T19-L8 0.21 c | HTTP and REST API | PATCH is not required to be idempotent per RFC 5789, unlike PUT. | «yes» Пояснение: RFC 5789 explicitly states that PATCH is not required to be idempotent, unlike PUT, because PATCH may modify the resource in ways that are not safe to repeat.
Raw{"answer": "yes", "explanation": "RFC 5789 explicitly states that PATCH is not required to be idempotent, unlike PUT, because PATCH may modify the resource in ways that are not safe to repeat."} | верно | RFC 5789 прямо оговаривает: PATCH не гарантированно идемпотентен; PUT идемпотентен. |
T20-L1 0.22 c | Security and OAuth | Checking a password by comparing its hash to the stored hash with a plain == is sufficient. | «no» Пояснение: Comparing hashes with == is insufficient and vulnerable to timing attacks and type-juggling (e.g., `0e...` numeric string comparisons), so a constant-time comparison like hash_equals() should be used.
Raw{"answer": "no", "explanation": "Comparing hashes with == is insufficient and vulnerable to timing attacks and type-juggling (e.g., `0e...` numeric string comparisons), so a constant-time comparison like hash_equals() should be used."} | верно | Нужна постоянновременная проверка (password_verify) — timing-атаки; соль и алгоритм уже внутри хеша. |
T20-L2 0.24 c | Security and OAuth | A CSRF token is issued by the server (bound to the session) and verified server-side on unsafe requests (POST etc.). | «yes» Пояснение: A CSRF token is indeed generated by the server, associated with the user's session, and validated server-side on unsafe HTTP requests such as POST to ensure the request originated from a legitimate source.
Raw{"answer": "yes", "explanation": "A CSRF token is indeed generated by the server, associated with the user's session, and validated server-side on unsafe HTTP requests such as POST to ensure the request originated from a legitimate source."} | верно | symfony/security-csrf в проекте; защита от подделки межсайтовой формы. |
T20-L3 0.33 c | Security and OAuth | Which HTTP header enables the CSP (Content Security Policy) policy? | «content-security-policy» Пояснение: The Content-Security-Policy HTTP header allows site administrators to control which resources an environment can load. This header is a critical piece of web application defense in depth, helping to mitigate cross-site scripting (XSS) attacks in modern web browsers.
Raw```json ⏎ { ⏎ "answer": "Content-Security-Policy", ⏎ "explanation": "The Content-Security-Policy HTTP header allows site administrators to control which resources an environment can load. This header is a critical piece of web application defense in depth, helping to mitigate cross-site scripting (XSS) attacks in modern web browsers." ⏎ } ⏎ ``` | верно | Content-Security-Policy; белые списки источников скриптов/стилей против XSS. |
T20-L4 0.28 c | Security and OAuth | OAuth 2.0 is an authentication protocol: the access token tells you who the user is. | «no» Пояснение: OAuth 2.0 is an authorization framework, not an authentication protocol; the OAuth 2.0 access token indicates what the client is authorized to do but does not inherently identify who the user is (that role belongs to OpenID Connect's ID token).
Raw{"answer": "no", "explanation": "OAuth 2.0 is an authorization framework, not an authentication protocol; the OAuth 2.0 access token indicates what the client is authorized to do but does not inherently identify who the user is (that role belongs to OpenID Connect's ID token)."} | верно | OAuth 2.0 — авторизация/делегирование доступа; аутентификацию добавляет OpenID Connect. В проекте knpuniversity/oauth2-client-bundle (yandex/github/google). |
T20-L5 0.21 c | Security and OAuth | XSS is prevented by validating input on the server before writing it to the database. | «no» Пояснение: XSS is prevented by output encoding/escaping when rendering data to the browser, not by validating or sanitizing input before storing it in the database.
Raw{"answer": "no", "explanation": "XSS is prevented by output encoding/escaping when rendering data to the browser, not by validating or sanitizing input before storing it in the database."} | верно | XSS лечится контекстным экранированием НА ВЫВОДЕ (Twig autoescape, CSP); валидация ввода не покрывает все контексты вывода. |
T20-L6 0.2 c | Security and OAuth | In the OAuth 2.0 authorization code flow, which parameter arrives at the redirect_uri and is exchanged for an access token? | «authorization_code» Пояснение: In the OAuth 2.0 authorization code flow, the authorization_code parameter is sent to the redirect_uri and then exchanged for an access token at the token endpoint.
Raw{"answer": "authorization_code", "explanation": "In the OAuth 2.0 authorization code flow, the authorization_code parameter is sent to the redirect_uri and then exchanged for an access token at the token endpoint."} | неверно верный: «code» | Параметр code; обмен на токен POST-ом на /token с client_secret. |
T20-L7 0.2 c | Security and OAuth | A refresh token lives longer than an access token and allows obtaining a new access token without the user logging in again. | «yes» Пояснение: Refresh tokens have a longer lifespan than access tokens and are specifically designed to obtain new access tokens without requiring the user to reauthenticate.
Raw{"answer": "yes", "explanation": "Refresh tokens have a longer lifespan than access tokens and are specifically designed to obtain new access tokens without requiring the user to reauthenticate."} | верно | Стандартная схема OAuth/OIDC: короткий access + длинный refresh. |
T20-L8 0.2 c | Security and OAuth | A password salt must be kept secret: without it the hash cannot be verified. | «no» Пояснение: Password salts do not need to be secret—they are stored alongside the hash and are used during verification, and security relies on using unique salts per password, not on secrecy.
Raw{"answer": "no", "explanation": "Password salts do not need to be secret—they are stored alongside the hash and are used during verification, and security relies on using unique salts per password, not on secrecy."} | верно | Соль хранится открыто (password_hash включает её в строку хеша); секретность соли не нужна. |
T18-L1 0.21 c | Testing: PHPUnit | PHPUnit runs test methods of any class — extending TestCase is not required. | «no» Пояснение: PHPUnit requires test classes to extend PHPUnit\Framework\TestCase (or use attributes/methods recognized by PHPUnit as test entry points), otherwise test methods are not executed.
Raw```json ⏎ {"answer": "false", "explanation": "PHPUnit requires test classes to extend PHPUnit\\Framework\\TestCase (or use attributes/methods recognized by PHPUnit as test entry points), otherwise test methods are not executed."} ⏎ ``` | верно | Тестом считается метод класса, наследующего TestCase (PHPUnit 10). |
T18-L2 0.21 c | Testing: PHPUnit | In PHPUnit, setUp() runs once before all tests of the class. | «no» Пояснение: In PHPUnit, setUp() runs before each individual test method, not once before all tests (use setUpBeforeClass() with static for once-per-class setup).
Raw```json ⏎ {"answer": "no", "explanation": "In PHPUnit, setUp() runs before each individual test method, not once before all tests (use setUpBeforeClass() with static for once-per-class setup)."} ⏎ ``` | верно | setUp() — перед КАЖДЫМ тестом; один раз на класс — setUpBeforeClass(). Проверено живым счётчиком на PHPUnit 10.5. |
T18-L3 0.16 c | Testing: PHPUnit | A data provider lets a test run with exactly one set of arguments. | «no» Пояснение: A data provider specifically allows a test to run with multiple sets of arguments, one iteration per returned data set.
Raw{"answer": "false", "explanation": "A data provider specifically allows a test to run with multiple sets of arguments, one iteration per returned data set."} | верно | Наоборот: наборов может быть сколько угодно — тест выполняется по разу на каждый. Проверено на PHPUnit 10.5 (#[DataProvider]). |
T18-L4 0.18 c | Testing: PHPUnit | Which PHPUnit method declares an expectation that an exception of a given class is thrown? | «expectexception()» Пояснение: The expectException() method in PHPUnit is used to declare an expectation that an exception of a given class will be thrown during a test.
Raw{"answer": "expectException()", "explanation": "The expectException() method in PHPUnit is used to declare an expectation that an exception of a given class will be thrown during a test."} | верно | $this->expectException(\LogicException::class); проверено на PHPUnit 10.5. |
T18-L5 0.17 c | Testing: PHPUnit | In PHPUnit, a stub verifies which methods were called on it, while a mock only returns data. | «no» Пояснение: The statement is reversed: in PHPUnit, a mock verifies which methods were called while a stub only returns predetermined data.
Raw{"answer": "no", "explanation": "The statement is reversed: in PHPUnit, a mock verifies which methods were called while a stub only returns predetermined data."} | верно | Наоборот: стаб подставляет данные, мок проверяет взаимодействия (createStub/createMock); docs PHPUnit — Test Doubles. |
T18-L6 0.17 c | Testing: PHPUnit | In PHPUnit 10+, the recommended way to pass data to a test is the #[DataProvider] attribute (the @dataProvider annotation is deprecated). | «yes» Пояснение: In PHPUnit 10+, the #[DataProvider] attribute is the recommended approach while the @dataProvider annotation has been deprecated.
Raw{"answer": "yes", "explanation": "In PHPUnit 10+, the #[DataProvider] attribute is the recommended approach while the @dataProvider annotation has been deprecated."} | верно | Аннотация ещё парсится в PHPUnit 10/11 (AnnotationParser в 10.5.66), удаление — в 12; атрибут — стандарт. |
T18-L7 0.18 c | Testing: PHPUnit | PHPUnit does not allow one test to depend on the result of another. | «no» Пояснение: PHPUnit supports test dependencies through the @depends annotation, which allows one test to depend on the result (and return value) of another test.
Raw{"answer": "false", "explanation": "PHPUnit supports test dependencies through the @depends annotation, which allows one test to depend on the result (and return value) of another test."} | верно | Зависимости есть: #[Depends] — зависимый тест не запустится, еслиProducer упал. |
T18-L8 0.24 c | Testing: PHPUnit | Which PHPUnit command-line option makes tests run in random order? | «--random-order-seed, --reverse-order-seed (via --order-by=random)» Пояснение: The `--order-by=random` option (with an optional `--random-order-seed`) is the PHPUnit CLI flag that makes tests run in random order.
Raw{"answer": "--random-order-seed, --reverse-order-seed (via --order-by=random)", "explanation": "The `--order-by=random` option (with an optional `--random-order-seed`) is the PHPUnit CLI flag that makes tests run in random order."} | верно | --order-by=random (PHPUnit 9+); опция есть в --help PHPUnit 10.5 (проектная). |
T01-L9 3.19 c | Syntax and operators | What does this code output?
```php
echo intdiv(7, 2) . intdiv(-7, 2);
``` | «3-4» Пояснение: intdiv(7,2) returns 3 (truncated toward zero) and intdiv(-7,2) returns -4 (also truncated toward zero), which concatenate to '3-4'.
Raw```json ⏎ {"answer": "3-4", "explanation": "intdiv(7,2) returns 3 (truncated toward zero) and intdiv(-7,2) returns -4 (also truncated toward zero), which concatenate to '3-4'."} ⏎ ``` | неверно верный: «3-3» | intdiv truncates toward zero: intdiv(-7, 2) = -3, not -4. |
T01-L10 0.44 c | Syntax and operators | What does this code output?
```php
echo -3 ** 2;
``` | «9» Пояснение: In PHP, the exponentiation operator ** has higher precedence than the unary minus, so -3 ** 2 is evaluated as -(3 ** 2), resulting in -9.
Raw```json ⏎ {"answer": "9", "explanation": "In PHP, the exponentiation operator ** has higher precedence than the unary minus, so -3 ** 2 is evaluated as -(3 ** 2), resulting in -9."} ⏎ ``` ⏎ ⏎ Wait, let me reconsider this carefully. ⏎ ⏎ ```json ⏎ {"answer": "-9", "explanation": "In PHP, the exponentiation operator ** has higher precedence than the unary minus operator, so the expression is parsed as -(3 ** 2) = -9."} ⏎ ``` | неверно верный: «-9» | ** is right-associative and binds tighter than unary minus: -(3²). |
T02-L9 0.23 c | Types and comparisons | What does this code output?
```php
echo '1e1' == '10' ? 'true' : 'false';
``` | «true» Пояснение: Both operands are string literals that look like numbers, so PHP converts them to floats for comparison (1e1=10 equals 10), making the comparison true.
Raw{"answer": "true", "explanation": "Both operands are string literals that look like numbers, so PHP converts them to floats for comparison (1e1=10 equals 10), making the comparison true."} | верно | Both strings are numeric — compared as numbers: 10 == 10. |
T02-L10 0.26 c | Types and comparisons | What does this code output?
```php
switch ('a') {
case 0: echo 'zero'; break;
default: echo 'other';
}
``` | «other» Пояснение: The switch compares 'a' (string) with 0 using loose comparison, but 'a' is not loosely equal to 0, so it falls to the default case which echoes 'other'.
Raw```json ⏎ { ⏎ "answer": "other", ⏎ "explanation": "The switch compares 'a' (string) with 0 using loose comparison, but 'a' is not loosely equal to 0, so it falls to the default case which echoes 'other'." ⏎ } ⏎ ``` | верно | PHP 8: 'a' == 0 → false (used to be true) — default fires. |
T03-L9 0.24 c | Strings | What does this code output?
```php
echo strtr('abc', ['a' => '1', 'ab' => '2']);
``` | «abc» Пояснение: strtr() with an array uses the longest-match-first rule, so 'a' only matches if 'ab' doesn't, leaving 'abc' unchanged.
Raw```json ⏎ {"answer": "abc", "explanation": "strtr() with an array uses the longest-match-first rule, so 'a' only matches if 'ab' doesn't, leaving 'abc' unchanged."} ⏎ ``` | неверно верный: «2c» | strtr with an array prefers the longest matching key. |
T03-L10 0.21 c | Strings | What does this code output?
```php
echo '[' . substr('hello', -10) . ']';
``` | «[hello]» Пояснение: When the negative offset exceeds the string length, PHP treats it as 0, so substr returns the entire string 'hello', resulting in [hello].
Raw```json ⏎ {"answer": "[hello]", "explanation": "When the negative offset exceeds the string length, PHP treats it as 0, so substr returns the entire string 'hello', resulting in [hello]."} ⏎ ``` | верно | A negative start beyond the string is clamped to the beginning. |
T04-L9 0.23 c | Arrays | What does this code output?
```php
$a = ['k' => 1, 'n' => 2];
$b = ['k' => 9, 'm' => 3];
echo implode(',', array_keys($a + $b));
``` | «k,n,m» Пояснение: The array union operator (+) keeps keys from $a and appends new keys from $b not present in $a, resulting in keys k, n, m in order.
Raw{"answer": "k,n,m", "explanation": "The array union operator (+) keeps keys from $a and appends new keys from $b not present in $a, resulting in keys k, n, m in order."} | верно | The + operator: on duplicate string keys the left array wins. |
T04-L10 0.33 c | Arrays | What does this code output?
```php
$a = [[1, 'x', 2], [2, 'y', 1], [3, 'z', 2]];
usort($a, fn($p, $q) => $p[2] <=> $q[2]);
echo implode('', array_column($a, 1));
``` | «yzx» Пояснение: usort sorts by the third element, grouping the equal '2' entries by their original order (stable sort), so order becomes [2,'y',1],[3,'z',2],[1,'x',2] and column 1 yields 'yzx'.
Raw```json ⏎ {"answer": "yzx","explanation": "usort sorts by the third element, grouping the equal '2' entries by their original order (stable sort), so order becomes [2,'y',1],[3,'z',2],[1,'x',2] and column 1 yields 'yzx'."} ⏎ ``` | неверно верный: «yxz» | Sorts are stable since 8.0: x and z keep their order on a tie. |
T05-L10 0.26 c | Functions and closures | What does this code output?
```php
function f(int $a, int $b): int
{
return $a - $b;
}
echo f(...['b' => 1, 'a' => 5]);
``` | «4» Пояснение: The spread operator unpacks the associative array by key names, so $a receives 5 and $b receives 1, making the function return 5 - 1 = 4.
Raw```json ⏎ {"answer": "4", "explanation": "The spread operator unpacks the associative array by key names, so $a receives 5 and $b receives 1, making the function return 5 - 1 = 4."} ⏎ ``` | верно | String keys of a spread array become named arguments. |
T05-L9 0.32 c | Functions and closures | What does this code output?
```php
class P
{
private int $v = 3;
public function g(): int { return $this->v; }
}
$p = new P;
$f = $p->g(...);
$p = null;
echo $f();
``` | «3» Пояснение: The arrow function $f captures $p by value (a copy of the P object reference) at definition time, so even after $p is set to null, $f() still calls g() on the captured object returning 3.
Raw```json ⏎ { ⏎ "answer": "3", ⏎ "explanation": "The arrow function $f captures $p by value (a copy of the P object reference) at definition time, so even after $p is set to null, $f() still calls g() on the captured object returning 3." ⏎ } ⏎ ``` | верно | First-class callable syntax binds $this at creation time. |
T06-L9 0.22 c | OOP: classes and inheritance | What does this code output?
```php
class A
{
public function who(): string { return static::class; }
}
class B extends A {}
echo (new B)->who();
``` | «b» Пояснение: The who() method uses static::class, which returns the late-static-bound class name (B), not the class where the method is defined (A).
Raw{"answer": "B", "explanation": "The who() method uses static::class, which returns the late-static-bound class name (B), not the class where the method is defined (A)."} | верно | Late static binding: static::class is the receiver's class. |
T06-L10 0.29 c | OOP: classes and inheritance | What does this code output on PHP 8.5?
```php
class C
{
public int $x = 0 {
set { $this->x = $value * 2; }
}
}
$c = new C;
$c->x = 5;
echo $c->x;
``` | «10» Пояснение: The property accessor syntax used in the code is not valid PHP syntax (this feature was not included in PHP 8.5), so the code would produce a parse/syntax error rather than outputting 10.
Raw```json ⏎ {"answer": "10", "explanation": "The property accessor syntax used in the code is not valid PHP syntax (this feature was not included in PHP 8.5), so the code would produce a parse/syntax error rather than outputting 10."} ⏎ ``` | верно | Inside the set hook, $this->x writes the backing store (no recursion): 5*2. |
T07-L9 0.31 c | Interfaces, traits, enum | What does this code output?
```php
trait TA
{
public function f(): string { return 'A'; }
}
trait TB
{
public function f(): string { return 'B'; }
}
class TC
{
use TA, TB { TB::f insteadof TA; TA::f as g; }
}
echo (new TC)->f() . (new TC)->g();
``` | «{"answer": "ba", "explanation": "the alias `tb::f insteadof ta` resolves the conflict by giving `f()` the body of tb, and `ta::f as g` provides a separate `g()` method returning 'a', so output is 'b' followed by 'a'}» Пояснение: ", "explanation": "The alias `TB::f insteadof TA` resolves the conflict by giving `f()` the body of TB, and `TA::f as g` provides a separate `g()` method returning 'A', so output is 'B' followed by 'A'}
Raw{"answer": "BA", "explanation": "The alias `TB::f insteadof TA` resolves the conflict by giving `f()` the body of TB, and `TA::f as g` provides a separate `g()` method returning 'A', so output is 'B' followed by 'A'} | верно парсинг: текст (фолбэк) | insteadof picks the implementation; as keeps the other under an alias. |
T07-L10 0.28 c | Interfaces, traits, enum | What does this code output?
```php
trait Counter
{
public static int $n = 0;
}
class CX { use Counter; }
class CY { use Counter; }
CX::$n = 1;
echo CY::$n;
``` | «0» Пояснение: Each class that uses the trait gets its own independent copy of the static property, so setting CX::$n = 1 does not affect CY::$n, which remains at its initialized value of 0.
Raw```json ⏎ {"answer": "0", "explanation": "Each class that uses the trait gets its own independent copy of the static property, so setting CX::$n = 1 does not affect CY::$n, which remains at its initialized value of 0."} ⏎ ``` | верно | A trait's static property is copied into each consuming class. |
T08-L10 0.2 c | Exceptions and errors | What does this code output?
```php
function f(): int
{
try { return 1; } finally { return 2; }
}
echo f();
``` | «2» Пояснение: In PHP, a finally block's return statement overrides any return from the try block, so f() returns 2.
Raw{"answer": "2", "explanation": "In PHP, a finally block's return statement overrides any return from the try block, so f() returns 2."} | верно | A return in finally overrides the return from try. |
T08-L9 0.21 c | Exceptions and errors | What does this code output?
```php
try {
try {
throw new RuntimeException('first');
} finally {
throw new LogicException('second');
}
} catch (LogicException $e) {
echo $e->getMessage();
}
``` | «second» Пояснение: The inner RuntimeException thrown during try is suppressed when the finally block throws a new LogicException, which then propagates and is caught by the catch block echoing its message.
Raw{"answer": "second", "explanation": "The inner RuntimeException thrown during try is suppressed when the finally block throws a new LogicException, which then propagates and is caught by the catch block echoing its message."} | верно | An exception from finally replaces the in-flight one — the last thrown is caught. |
T09-L9 0.23 c | Namespaces and autoloading | What does this code output?
```php
namespace N;
use App\Foo as Baz;
echo Baz::class . '|' . \Baz::class;
``` | «n\baz|baz» Пояснение: The alias Baz in namespace N refers to the namespaced class N\Baz, while \Baz explicitly refers to the global class Baz.
Raw{"answer": "N\\Baz|Baz", "explanation": "The alias Baz in namespace N refers to the namespaced class N\\Baz, while \\Baz explicitly refers to the global class Baz."} | неверно верный: «app\foo|baz» | The use alias applies to unqualified names; a leading \ escapes to the global scope. |
T09-L10 0.23 c | Namespaces and autoloading | What does this code output?
```php
namespace Ns;
class Foo {}
$c = 'Foo';
echo (class_exists($c) ? 'yes' : 'no')
. (class_exists(__NAMESPACE__ . '\\' . $c) ? 'yes' : 'no');
``` | «yesyes» Пояснение: class_exists('Foo') resolves to 'Ns\Foo' within the namespace and returns true, and the fully-qualified 'Ns\Foo' also returns true, so both echo 'yes'.
Raw{"answer": "yesyes", "explanation": "class_exists('Foo') resolves to 'Ns\\Foo' within the namespace and returns true, and the fully-qualified 'Ns\\Foo' also returns true, so both echo 'yes'."} | неверно верный: «noyes» | Dynamic names are not resolved against the namespace — 'Foo' is the global class. |
T10-L9 0.26 c | References and scope | What does this code output?
```php
$a = [1, 2, 3];
foreach ($a as &$v) {}
$v = 99;
echo implode(',', $a);
``` | «1,2,99» Пояснение: The reference `$v` from the foreach loop remains bound after the loop, so assigning 99 to `$v` modifies the last element (index 2) of the array.
Raw{"answer": "1,2,99", "explanation": "The reference `$v` from the foreach loop remains bound after the loop, so assigning 99 to `$v` modifies the last element (index 2) of the array."} | верно | After a by-ref foreach, $v remains a reference to the last element. |
T10-L10 0.3 c | References and scope | What does this code output?
```php
class A
{
public function inc(): int
{
static $n = 0;
return ++$n;
}
}
class B extends A {}
$a = new A;
$b = new B;
$a->inc();
$b->inc();
echo $a->inc();
``` | «1» Пояснение: Static variables are bound to the class where the method is declared (class A), so $a->inc() and $b->inc() both increment the same $n, resulting in $a->inc() returning 1.
Raw```json ⏎ {"answer": "1", "explanation": "Static variables are bound to the class where the method is declared (class A), so $a->inc() and $b->inc() both increment the same $n, resulting in $a->inc() returning 1."} ⏎ ``` | неверно верный: «3» | A method's static variable belongs to the parent's method — subclasses share it. |
T11-L9 0.29 c | Generators, iterators, SPL | What does this code output?
```php
function g(): Generator
{
$x = yield 1;
return $x + 1;
}
$g = g();
$g->send(10);
echo $g->getReturn();
``` | «11» Пояснение: The send(10) method yields 10 as the value of the yield expression, so $x becomes 10, and returning $x + 1 gives 11, which getReturn() retrieves.
Raw```json ⏎ {"answer": "11", "explanation": "The send(10) method yields 10 as the value of the yield expression, so $x becomes 10, and returning $x + 1 gives 11, which getReturn() retrieves."} ⏎ ``` | верно | send() resumes the generator: $x = 10, return 10+1. |
T11-L10 0.25 c | Generators, iterators, SPL | What does this code output?
```php
function inner(): Generator
{
yield 1;
yield 2;
return 'ok';
}
function outer(): Generator
{
$r = yield from inner();
yield $r;
}
echo implode(',', iterator_to_array(outer()));
``` | «1,2,ok» Пояснение: yield from delegates to inner() yielding 1 and 2, and the return value 'ok' becomes the value of the yield from expression, which is then yielded by outer().
Raw{"answer": "1,2,ok","explanation": "yield from delegates to inner() yielding 1 and 2, and the return value 'ok' becomes the value of the yield from expression, which is then yielded by outer()."} | неверно верный: «ok,2» | yield from does not advance the outer auto-key: yield $r gets key 0 and overwrites the 1 — 'ok' comes out first. |
T12-L9 0.25 c | Configuration and security | What does this code output?
```php
$hash = password_hash('x', PASSWORD_BCRYPT, ['cost' => 4]);
echo password_needs_rehash($hash, PASSWORD_BCRYPT, ['cost' => 4]) ? 'yes' : 'no';
echo password_needs_rehash($hash, PASSWORD_BCRYPT, ['cost' => 5]) ? 'yes' : 'no';
``` | «yeno» Пояснение: The first call returns false because the hash already uses cost 4, while the second returns true because the cost parameter (5) differs from the hash's stored cost (4).
Raw{"answer": "yeno", "explanation": "The first call returns false because the hash already uses cost 4, while the second returns true because the cost parameter (5) differs from the hash's stored cost (4)."} | неверно верный: «noyes» | password_needs_rehash compares the hash's options with the target: cost 4 = 4 → 'no', cost 5 ≠ 4 → 'yes'. |
T12-L10 0.28 c | Configuration and security | What does this code output on PHP 8.5?
```php
echo (E_ALL & 2048) === 0 ? 'strict-out' : 'strict-in';
``` | «strict-in» Пояснение: E_ALL always includes the E_STRICT flag (value 2048), so E_ALL & 2048 equals 2048, which is not equal to 0.
Raw```json ⏎ {"answer": "strict-in", "explanation": "E_ALL always includes the E_STRICT flag (value 2048), so E_ALL & 2048 equals 2048, which is not equal to 0."} ⏎ ``` | неверно верный: «strict-out» | Since PHP 8.4, E_STRICT is out of E_ALL: the 2048 bit is unset → 'strict-out' (2048 is the historical E_STRICT bit). |
T13-L9 0.29 c | Symfony | What does this code output?
```php
use Symfony\Component\HttpFoundation\Request;
$r = Request::create('/demo', 'GET', [], [], [], ['HTTP_X_TOKEN' => 'abc']);
echo $r->headers->get('X-Token') === 'abc' ? 'mapped' : 'missing';
``` | «mapped» Пояснение: Symfony's HeaderPrefixExtractor converts the server key HTTP_X_TOKEN to the header name X-Token and strips the HTTP_ prefix and underscores, so $r->headers->get('X-Token') returns 'abc'.
Raw```json ⏎ {"answer": "mapped", "explanation": "Symfony's HeaderPrefixExtractor converts the server key HTTP_X_TOKEN to the header name X-Token and strips the HTTP_ prefix and underscores, so $r->headers->get('X-Token') returns 'abc'."} ⏎ ``` | верно | The literal comparison requires knowing the mapping: HttpFoundation turns HTTP_X_TOKEN into the X-Token header (case-insensitive); without it the answer is 'missing'. |
T13-L10 0.26 c | Symfony | What does this code output?
```php
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Contracts\EventDispatcher\Event;
$d = new EventDispatcher();
$out = '';
$d->addListener('e', function () use (&$out) { $out .= 'B'; }, 10);
$d->addListener('e', function () use (&$out) { $out .= 'A'; });
$d->addListener('e', function () use (&$out) { $out .= 'C'; }, 5);
$d->dispatch(new Event(), 'e');
echo $out;
``` | «abc» Пояснение: Event listeners are sorted by descending priority, so priority 10 (B) runs first, then the default priority 0 (A), then priority 5 (C).
Raw```json ⏎ {"answer": "ABC", "explanation": "Event listeners are sorted by descending priority, so priority 10 (B) runs first, then the default priority 0 (A), then priority 5 (C)."} ⏎ ``` | неверно верный: «bca» | Listeners run by descending priority: 10 (B), 5 (C), 0 (A). |
T14-L10 0.23 c | Doctrine | Given: Doctrine ORM 3, an EntityManager on in-memory SQLite, entity User with an auto-increment primary key. The users table is empty. What does this code output?
```php
$u = new User(name: 'A');
$em->persist($u);
$em->flush();
$a = $em->find(User::class, $u->getId());
$b = $em->find(User::class, $u->getId());
echo spl_object_id($a) === spl_object_id($b) ? 'same' : 'diff';
``` | «same» Пояснение: The EntityManager's first-level cache guarantees that two finds for the same identity return the same entity instance within a single unit of work.
Raw```json ⏎ {"answer": "same", "explanation": "The EntityManager's first-level cache guarantees that two finds for the same identity return the same entity instance within a single unit of work."} ⏎ ``` | верно | Identity map: a second find for the same id returns the same instance. |
T14-L9 0.26 c | Doctrine | Given: Doctrine ORM 3, an EntityManager on in-memory SQLite, entity User with an auto-increment primary key. The users table is empty. What does this code output?
```php
$u = new User(name: 'B');
$em->persist($u);
$em->remove($u);
$em->flush();
echo count($em->getConnection()->fetchAllAssociative('SELECT * FROM users'));
``` | «0» Пояснение: The entity is persisted then removed before flush, so the Unit of Work schedules a delete, and flush executes the DELETE, leaving the users table empty.
Raw```json ⏎ {"answer": "0", "explanation": "The entity is persisted then removed before flush, so the Unit of Work schedules a delete, and flush executes the DELETE, leaving the users table empty."} ⏎ ``` | верно | The unit of work schedules INSERT at flush: remove after persist cancels it. |
T15-L10 0.2 c | PostgreSQL | What does this SQL query return (PostgreSQL 17)?
```sql
CREATE TEMP TABLE t (x int);
INSERT INTO t VALUES (1), (NULL);
SELECT count(x) FROM t;
``` | «1» Пояснение: COUNT(x) counts only non-NULL values of x, so it returns 1 (ignoring the NULL row).
Raw{"answer": "1", "explanation": "COUNT(x) counts only non-NULL values of x, so it returns 1 (ignoring the NULL row)."} | верно | count(column) skips NULLs; count(*) would return 2. |
T15-L9 0.31 c | PostgreSQL | What does this SQL query return (PostgreSQL 17)?
```sql
CREATE TEMP TABLE t (id int, x int);
INSERT INTO t VALUES (1, 10), (2, 20), (3, 30);
SELECT string_agg(s::text, ',' ORDER BY id) FROM (
SELECT id, sum(x) OVER (ORDER BY id) AS s FROM t
) q;
``` | «10,30,60» Пояснение: The window sum s for each row is 10, 30, 60, and string_agg concatenates them in ORDER BY id into the comma-separated string "10,30,60".
Raw```json ⏎ {"answer": "10,30,60", "explanation": "The window sum s for each row is 10, 30, 60, and string_agg concatenates them in ORDER BY id into the comma-separated string \"10,30,60\"."} ⏎ ``` | верно | With ORDER BY the default window frame is running (start to current row). |
T16-L9 0.26 c | Symfony: Messenger | What does this code output?
```php
use Symfony\Component\Messenger\MessageBus;
use Symfony\Component\Messenger\Middleware\MiddlewareInterface;
use Symfony\Component\Messenger\Middleware\StackInterface;
use Symfony\Component\Messenger\Envelope;
final class Trace implements MiddlewareInterface
{
public function __construct(private string $tag) {}
public function handle(Envelope $e, StackInterface $stack): Envelope
{
echo $this->tag;
return $stack->next()->handle($e, $stack);
}
}
$bus = new MessageBus([new Trace('M1'), new Trace('M2')]);
$bus->dispatch(new Envelope(new stdClass()));
``` | «m2m1» Пояснение: Middlewares are executed in reverse order (last registered wraps first), so M2's tag echoes before M1's, and dispatch only passes through the middleware stack once in the forward direction.
Raw{"answer": "M2M1", "explanation": "Middlewares are executed in reverse order (last registered wraps first), so M2's tag echoes before M1's, and dispatch only passes through the middleware stack once in the forward direction."} | неверно верный: «m1m2» | The first-added middleware runs first (outermost). |
T16-L10 0.26 c | Symfony: Messenger | What does this code output?
```php
use Symfony\Component\Messenger\MessageBus;
use Symfony\Component\Messenger\Middleware\HandleMessageMiddleware;
use Symfony\Component\Messenger\Handler\HandlersLocator;
use Symfony\Component\Messenger\Handler\HandlerDescriptor;
use Symfony\Component\Messenger\Envelope;
class Ping {}
$n = 0;
$d1 = new HandlerDescriptor(function (Ping $m) use (&$n) { $n += 1; }, ['alias' => 'h1']);
$d2 = new HandlerDescriptor(function (Ping $m) use (&$n) { $n += 10; }, ['alias' => 'h2']);
$bus = new MessageBus([
new HandleMessageMiddleware(new HandlersLocator([Ping::class => [$d1, $d2]])),
]);
$bus->dispatch(new Envelope(new Ping()));
echo $n;
``` | «11» Пояснение: The HandleMessageMiddleware iterates through all registered handlers for the Ping message (d1 adding 1 and d2 adding 10) and invokes each, outputting 11.
Raw{"answer": "11", "explanation": "The HandleMessageMiddleware iterates through all registered handlers for the Ping message (d1 adding 1 and d2 adding 10) and invokes each, outputting 11."} | верно | All registered handlers of the message run: 1 + 10 = 11. |
T17-L9 0.25 c | PostgreSQL: transactions and indexes | What does this SQL query return (PostgreSQL 17)?
```sql
CREATE TEMP TABLE t (a int);
CREATE UNIQUE INDEX ON t (a);
INSERT INTO t VALUES (1) ON CONFLICT DO NOTHING;
INSERT INTO t VALUES (1) ON CONFLICT DO NOTHING;
SELECT count(*) FROM t;
``` | «1» Пояснение: The two inserts of value 1 both target the unique-indexed column 'a', so the second ON CONFLICT DO NOTHING suppresses the duplicate, leaving exactly one row.
Raw{"answer": "1", "explanation": "The two inserts of value 1 both target the unique-indexed column 'a', so the second ON CONFLICT DO NOTHING suppresses the duplicate, leaving exactly one row."} | верно | ON CONFLICT DO NOTHING skips the duplicate: one insert. |
T17-L10 0.31 c | PostgreSQL: transactions and indexes | What does this sequence of psql commands output?
```sql
BEGIN;
CREATE TEMP TABLE t (a int, UNIQUE (a) DEFERRABLE INITIALLY DEFERRED);
INSERT INTO t VALUES (1);
INSERT INTO t VALUES (1);
SELECT count(*) FROM t;
``` | «1» Пояснение: The unique constraint is deferred (DEFERRABLE INITIALLY DEFERRED), so it is not checked until COMMIT; since the transaction never commits, the check never fires, both inserts succeed, and the table contains 1 row.
Raw```json ⏎ { ⏎ "answer": "1", ⏎ "explanation": "The unique constraint is deferred (DEFERRABLE INITIALLY DEFERRED), so it is not checked until COMMIT; since the transaction never commits, the check never fires, both inserts succeed, and the table contains 1 row." ⏎ } ⏎ ``` | неверно верный: «2» | DEFERRED postpones the uniqueness check to COMMIT — count sees 2 rows. |
T18-L9 0.29 c | Testing: PHPUnit | How many tests will this command run?
```php
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\Attributes\DataProvider;
final class CalcTest extends TestCase
{
public static function prov(): array
{
return [[1], [2], [3]];
}
#[DataProvider('prov')]
public function test_sum(int $x): void
{
$this->assertTrue($x > 0);
}
#[DataProvider('prov')]
public function test_sum_abs(int $x): void
{
$this->assertTrue($x > 0);
}
public function test_other(): void
{
$this->assertTrue(true);
}
}
```
Command: `phpunit CalcTest.php --filter test_sum` (PHPUnit 10.5) | «4» Пояснение: The filter 'test_sum' matches both test_sum (3 data provider cases) and test_sum_abs (3 data provider cases), giving 6 total tests, not 4.
Raw```json ⏎ { ⏎ "answer": "4", ⏎ "explanation": "The filter 'test_sum' matches both test_sum (3 data provider cases) and test_sum_abs (3 data provider cases), giving 6 total tests, not 4." ⏎ } ⏎ ``` | неверно верный: «6» | --filter is a substring match: test_sum also matches test_sum_abs (3+3 datasets). |
T18-L10 0.32 c | Testing: PHPUnit | How many tests will this command run, and how many of them will fail? Answer with two comma-separated numbers (ran, failed).
```php
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\Attributes\DataProvider;
final class Calc2Test extends TestCase
{
public function prov(): array
{
return [[1], [-1]];
}
#[DataProvider('prov')]
public function test_x(int $x): void
{
$this->assertTrue($x > 0);
}
}
```
Command: `phpunit Calc2Test.php` (PHPUnit 10.5) | «2, 1» Пояснение: The data provider prov() returns two test cases (x=1 and x=-1), so 2 tests run; x=1 passes assertTrue($x > 0) while x=-1 fails, so exactly 1 test fails.
Raw```json ⏎ {"answer": "2, 1", "explanation": "The data provider prov() returns two test cases (x=1 and x=-1), so 2 tests run; x=1 passes assertTrue($x > 0) while x=-1 fails, so exactly 1 test fails."} ⏎ ``` | верно | A non-static provider is just a deprecation in PHPUnit 10: both datasets run and the [-1] dataset fails the assert — 2 ran, 1 failure. |
T19-L9 0.19 c | HTTP and REST API | Which HTTP method does this command send?
```bash
curl -s -d 'a=1' http://demo.local/api
``` | «post» Пояснение: The -d (--data) option in curl implicitly sets the request method to POST.
Raw```json ⏎ {"answer": "POST", "explanation": "The -d (--data) option in curl implicitly sets the request method to POST."} ⏎ ``` | верно | -d/-F switches curl to POST by default. |
T19-L10 0.22 c | HTTP and REST API | Which HTTP method does this command send?
```bash
curl -s -G -d 'a=1' http://demo.local/api
``` | «get» Пояснение: The -G flag tells curl to move the POST data into the URL query string and send it as a GET request instead of POST.
Raw```json ⏎ { ⏎ "answer": "GET", ⏎ "explanation": "The -G flag tells curl to move the POST data into the URL query string and send it as a GET request instead of POST." ⏎ } ⏎ ``` | верно | -G turns -d data into the query string; the method stays GET. |
T20-L9 0.24 c | Security and OAuth | A client hits the token endpoint (RFC 6749) with a non-existent client_id. What value of the error field does the endpoint return? | «invalid_client» Пояснение: According to RFC 6749 Section 5.2, when a client authentication fails at the token endpoint, the server must return an error response with error="invalid_client".
Raw{"answer": "invalid_client", "explanation": "According to RFC 6749 Section 5.2, when a client authentication fails at the token endpoint, the server must return an error response with error=\"invalid_client\"."} | верно | Unknown client → invalid_client (RFC 6749 §5.2). |
T20-L10 0.23 c | Security and OAuth | OAuth 2.0: the client started the flow with response_type=token. In which part of the redirect_uri does the authorization server pass the access_token? | «fragment» Пояснение: With response_type=token (implicit flow), the access_token is returned in the URL fragment (the part after the #) so it is not sent to the server.
Raw{"answer": "fragment", "explanation": "With response_type=token (implicit flow), the access_token is returned in the URL fragment (the part after the #) so it is not sent to the server."} | верно | The implicit flow passes the token in the URL fragment (#) — it never reaches the server. |
T21-L9 0.2 c | Twig | What does this Twig template output?
```twig
{{ false|default(2) * 3 }}
``` | «0» Пояснение: Twig's default filter returns false itself (not 2) because the value is not null, so false*3 evaluates to 0.
Raw{"answer": "0", "explanation": "Twig's default filter returns false itself (not 2) because the value is not null, so false*3 evaluates to 0."} | неверно верный: «6» | default replaces exactly false/null/''/[] — false becomes 2, 2*3 = 6; the naive 'default is for undefined only' yields 0. |
T21-L10 0.3 c | Twig | What exception class does render() of this template throw?
```twig
{{ 'a' ~ 1 + 2 }}
``` | «twig\error\runtimeerror» Пояснение: The concatenation operator has higher precedence than addition, so Twig tries to add 2 to the resulting string 'a1', which is a non-numeric string, causing Twig\Error\RuntimeError when the expression is evaluated.
Raw```json ⏎ {"answer": "Twig\\Error\\RuntimeError", "explanation": "The concatenation operator has higher precedence than addition, so Twig tries to add 2 to the resulting string 'a1', which is a non-numeric string, causing Twig\\Error\\RuntimeError when the expression is evaluated."} ⏎ ``` | верно | In Twig ~ binds tighter than +: ('a' ~ 1) + 2 → string + int → a render error (RuntimeError). |
T22-L9 0.16 c | Symfony: Security and forms | What does this code output?
```php
use Symfony\Component\Validator\Validation;
use Symfony\Component\Validator\Constraints as Assert;
$v = Validation::createValidator();
echo count($v->validate([''], [new Assert\NotBlank()]));
``` | «1» Пояснение: An empty string violates NotBlank, producing one violation.
Raw{"answer": "1", "explanation": "An empty string violates NotBlank, producing one violation."} | неверно верный: «0» | NotBlank treats null, '', [] as blank — the array [''] is not blank. |
T22-L10 0.28 c | Symfony: Security and forms | What does this code output?
```php
use Symfony\Component\Form\Forms;
use Symfony\Component\Form\Extension\Core\Type\TextType;
$factory = Forms::createFormFactoryBuilder()->getFormFactory();
$form = $factory->create(TextType::class);
try {
echo $form->isValid() ? 'valid' : 'invalid';
} catch (Throwable $e) {
echo get_class($e);
}
``` | «symfony\component\form\exception\unexpectedexception» Пояснение: Calling isValid() on a form that has never been submitted triggers Symfony's unexpected exception because form validation requires the form to have been submitted first (or a token/csrf to be checked).
Raw```json ⏎ {"answer": "Symfony\\Component\\Form\\Exception\\UnexpectedException", "explanation": "Calling isValid() on a form that has never been submitted triggers Symfony's unexpected exception because form validation requires the form to have been submitted first (or a token/csrf to be checked)."} ⏎ ``` | неверно верный: «symfony\component\form\exception\logicexception» | isValid() on a non-submitted form throws LogicException, it does not return false. |
T23-L9 0.22 c | Symfony: configuration and services | What does this code output?
```php
use Symfony\Component\DependencyInjection\ContainerBuilder;
$c = new ContainerBuilder();
$c->register('a', stdClass::class)->setPublic(true);
$c->compile();
echo spl_object_id($c->get('a')) === spl_object_id($c->get('a')) ? 'same' : 'diff';
``` | «same» Пояснение: By default services are singletons (shared), so two calls to get('a') return the same instance.
Raw```json ⏎ {"answer": "same", "explanation": "By default services are singletons (shared), so two calls to get('a') return the same instance."} ⏎ ``` | верно | Container services are shared: two get() calls yield one instance. |
T23-L10 0.29 c | Symfony: configuration and services | What does this code output?
```php
use Symfony\Component\DependencyInjection\ContainerBuilder;
$c = new ContainerBuilder();
$c->setParameter('name', 'Bob');
$c->setParameter('greeting', 'hi %name%');
$c->setParameter('message', '%greeting%!');
$c->compile();
echo $c->getParameter('message');
``` | «hi bob!» Пояснение: The ContainerBuilder recursively parameter substitutions, so '%greeting%\' resolves to 'hi %name%' and '%name%' resolves to 'Bob', resulting in 'hi Bob!'.
Raw```json ⏎ { ⏎ "answer": "hi Bob!", ⏎ "explanation": "The ContainerBuilder recursively parameter substitutions, so '%greeting%\' resolves to 'hi %name%' and '%name%' resolves to 'Bob', resulting in 'hi Bob!'." ⏎ } ⏎ ``` | верно | compile() resolves %-references transitively: %greeting% → 'hi %name%' → 'hi Bob!', the answer assembles over two hops. |
T24-L9 0.25 c | Bootstrap | What is the max-width of .container in Bootstrap 5.3 at a 992px viewport? | «960px» Пояснение: In Bootstrap 5.3, the .container reaches its max-width of 960px at the lg breakpoint (≥992px) because it uses the previous breakpoint's width.
Raw{"answer": "960px", "explanation": "In Bootstrap 5.3, the .container reaches its max-width of 960px at the lg breakpoint (≥992px) because it uses the previous breakpoint's width."} | верно | 5.x container widths: 540/720/960/1140/1320 (sm–xxl); 992 → 960px. |
T24-L10 0.22 c | Bootstrap | Which utility sets the text color in Bootstrap 5.3 for `<p class="text-danger text-primary">…</p>`? Answer with the winning class name. | «text-primary» Пояснение: Since both classes appear in order, text-primary comes later in the source and overrides text-danger due to equal specificity and the last-match-wins rule.
Raw{"answer": "text-primary", "explanation": "Since both classes appear in order, text-primary comes later in the source and overrides text-danger due to equal specificity and the last-match-wins rule."} | неверно верный: «text-danger» | Specificity ties — the later rule wins: text-danger is declared after text-primary. |
T25-L9 0.23 c | Clean architecture | Layers: Domain, Application, Infrastructure. Deptrac rules: Application → Domain; Infrastructure → Domain, Application; Domain → Domain only.
How many violations will deptrac report for this class?
```php
namespace App\Domain;
use App\Application\PlaceOrder;
use App\Infrastructure\Db;
class OrderService
{
public function __construct(
private PlaceOrder $handler,
private Db $db,
) {}
}
``` | «2» Пояснение: OrderService (Domain) imports two classes from forbidden layers: PlaceOrder (Application) and Db (Infrastructure), each counting as one deptrac violation.
Raw{"answer": "2", "explanation": "OrderService (Domain) imports two classes from forbidden layers: PlaceOrder (Application) and Db (Infrastructure), each counting as one deptrac violation."} | верно | Domain may depend only on Domain: PlaceOrder (Application) + Db (Infrastructure) = 2. |
T25-L10 0.22 c | Clean architecture | Layers: Domain, Application, Infrastructure. Deptrac rules: Application → Domain; Infrastructure → Domain, Application; Domain → Domain only.
How many violations will deptrac report for this class?
```php
namespace App\Domain;
use App\Application\PlaceOrder;
use App\Infrastructure\Db;
class BillingService
{
public function __construct(
private PlaceOrder $handler,
private Db $db,
private \App\Infrastructure\Logger $logger,
) {}
}
``` | «2» Пояснение: PlaceOrder (Application) and Db (Infrastructure) are forbidden from depending on the Domain layer, so each import generates one deptrac violation.
Raw```json ⏎ {"answer": "2", "explanation": "PlaceOrder (Application) and Db (Infrastructure) are forbidden from depending on the Domain layer, so each import generates one deptrac violation."} ⏎ ``` | неверно верный: «3» | The inline FQCN \App\Infrastructure\Logger counts too: Application + Db + Logger = 3. |
T26-L10 0.31 c | DDD | What does this code output?
```php
final class Money
{
public function __construct(public readonly int $amount) {}
public function add(Money $o): Money
{
return new self($this->amount + $o->amount);
}
}
$a = new Money(10);
$c = $a->add(new Money(5));
echo $a->amount . ',' . $c->amount;
``` | «10,15» Пояснение: The add() method creates a new Money object with the summed amount (15) without modifying the original, so $a->amount stays 10 and $c->amount becomes 15.
Raw```json ⏎ {"answer": "10,15", "explanation": "The add() method creates a new Money object with the summed amount (15) without modifying the original, so $a->amount stays 10 and $c->amount becomes 15."} ⏎ ``` | верно | The VO is immutable: add() returns a new instance; the original is unchanged. |
T26-L9 0.25 c | DDD | What does this code output?
```php
final class Order
{
private array $items = [];
public function add(string $sku): void
{
$this->items[$sku] = true;
}
public function count(): int
{
return count($this->items);
}
public function remove(string $sku): void
{
if (count($this->items) === 1) {
throw new DomainException('last item');
}
unset($this->items[$sku]);
}
}
$o = new Order;
$o->add('a');
try {
$o->remove('a');
} catch (DomainException) {
}
echo $o->count();
``` | «1» Пояснение: The remove() method throws a DomainException because only one item remains, so the item is never unset, leaving one item in the collection which count() returns.
Raw```json ⏎ {"answer": "1", "explanation": "The remove() method throws a DomainException because only one item remains, so the item is never unset, leaving one item in the collection which count() returns."} ⏎ ``` | верно | The failed remove leaves aggregate state unchanged: the invariant threw before unset — count stays 1. |
VC-L9 0.21 c | PHP 8.4–8.5 | What does this code output on PHP 8.5?
```php
class C
{
public function hi(): string { return 'hi'; }
}
echo new C()->hi();
``` | «hi» Пояснение: The code creates an instance of class C and immediately calls its hi() method which returns the string 'hi', then echoes it.
Raw{"answer": "hi", "explanation": "The code creates an instance of class C and immediately calls its hi() method which returns the string 'hi', then echoes it."} | верно | Since 8.4, new in a method chain works without wrapping parentheses. |
VC-L10 0.25 c | PHP 8.4–8.5 | What does this code output on PHP 8.5?
```php
class Heavy
{
public int $v = 0;
}
$r = new ReflectionClass(Heavy::class);
$o = $r->newLazyGhost(function (Heavy $obj) {
$obj->v = 21;
});
echo $r->isUninitializedLazyObject($o) ? 'yes' : 'no';
$o->v;
echo $r->isUninitializedLazyObject($o) ? 'yes' : 'no';
``` | «yesno» Пояснение: newLazyGhost creates an uninitialized lazy ghost object (isUninitializedLazyObject returns yes), and merely reading $o->v triggers ghost initialization, after which it is no longer uninitialized (returns no).
Raw{"answer": "yesno", "explanation": "newLazyGhost creates an uninitialized lazy ghost object (isUninitializedLazyObject returns yes), and merely reading $o->v triggers ghost initialization, after which it is no longer uninitialized (returns no)."} | верно | newLazyGhost (8.4): the object stays lazy until first access — reading a property initializes it and clears the flag. |
T28-L9 0.3 c | Symfony: versions | The project was upgraded from Symfony 6.4 to 8.1. What does this code output on 8.1?
```php
echo class_exists(\Symfony\Component\Security\Guard\AbstractGuardAuthenticator::class)
? 'yes' : 'no';
``` | «no» Пояснение: The AbstractGuardAuthenticator class was removed in Symfony 5.9 (the Guard component was deprecated in 5.3 and fully removed), so it does not exist in Symfony 8.1.
Raw```json ⏎ { ⏎ "answer": "no", ⏎ "explanation": "The AbstractGuardAuthenticator class was removed in Symfony 5.9 (the Guard component was deprecated in 5.3 and fully removed), so it does not exist in Symfony 8.1." ⏎ } ⏎ ``` | верно | Guard authentication was removed in Symfony 7.0 — the class is gone in 8.1. |
T28-L10 0.24 c | Symfony: versions | The project was upgraded from Symfony 6.4 to 8.1. What does this code output on 8.1?
```php
echo class_exists(\Symfony\Component\Routing\Loader\AnnotationClassLoader::class)
? 'yes' : 'no';
echo class_exists(\Symfony\Component\Routing\Loader\AttributeClassLoader::class)
? 'yes' : 'no';
``` | «noyes» Пояснение: In Symfony 8.x the legacy AnnotationClassLoader was removed and the routing loader now uses attributes via AttributeClassLoader, so the first class no longer exists while the second one does.
Raw```json ⏎ {"answer": "noyes", "explanation": "In Symfony 8.x the legacy AnnotationClassLoader was removed and the routing loader now uses attributes via AttributeClassLoader, so the first class no longer exists while the second one does."} ⏎ ``` | верно | Annotation loaders were removed in 7.0; only attribute loaders remain (Annotation→Attribute). |