<!DOCTYPE html>
<html class="h-100" data-bs-theme="light" data-mantine-color-scheme="light" lang="ru" prefix="og: https://ogp.me/ns#">
<head>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<link crossorigin="true" href="https://cdn.hexlet.io" rel="preconnect">
<link href="https://mc.yandex.ru" rel="preconnect">
<meta content="aa2vrdtq64dub8knuf83lwywit311w" name="facebook-domain-verification">
<link href="/favicon.ico" rel="icon" sizes="any">
<link href="/favicon.svg" rel="icon" type="image/svg+xml">
<link href="/apple-touch-icon.png" rel="apple-touch-icon">
<link href="/manifest.webmanifest" rel="manifest">
<script>
//<![CDATA[
window.gon={};gon.ym_counter="25559621";gon.is_bot=true;gon.applications={};gon.current_user={"id":null,"last_viewed_notification_id":null,"email":null,"state":null,"first_name":"","last_name":"","created_at":"2026-02-26 19:47:12 UTC","current_program":null,"current_team":null,"full_name":"","guest":true,"can_use_paid_features":false,"is_hexlet_employee":false,"sanitized_phone_number":"","can_subscribe":true,"can_renew_education":false};gon.token="wtOov1H_uOFqxql7Q7eCWXY0G-hI9JhauLNxvv5hypQtAmOIo4EVgdyFjeNPuHIutj02QkDDZvgFU-vqrGYt-g";gon.locale="ru";gon.language="ru";gon.theme="light";gon.rails_env="production";gon.mobile=false;gon.google={"analytics_key":"UA-1360700-51","optimize_key":"GTM-5QDVFPF"};gon.captcha={"google_v3_site_key":"6LenGbgZAAAAAM7HbrDbn5JlizCSzPcS767c9vaY","yandex_site_key":"ysc1_Vyob5ZPPUdPBsu0ykt8bVFdzsfpoVjQChLGl2b4g19647a89","verification_failed":null};gon.social_signin=false;gon.typoreporter_google_form_id="1FAIpQLSeibfGq-KvWQ2Fyru-zkFFRVTLBuzXAHAoEyN1p49FtDmNoNA";
//]]>
</script>
<meta charset="utf-8">
<title>Функции первого класса и передача функций как аргументов | PHP: Построение абстракций</title>
<meta name="description" content="Функции первого класса и передача функций как аргументов / PHP: Построение абстракций: Учимся передавать анонимные функции как аргументы других функций">
<link rel="canonical" href="https://ru.hexlet.io/courses/php-sicp/lessons/first_class_as_args/theory_unit">
<meta name="robots" content="noarchive">
<meta property="og:title" content="Функции первого класса и передача функций как аргументов">
<meta property="og:title" content="PHP: Построение абстракций">
<meta property="og:description" content="Функции первого класса и передача функций как аргументов / PHP: Построение абстракций: Учимся передавать анонимные функции как аргументы других функций">
<meta property="og:url" content="https://ru.hexlet.io/courses/php-sicp/lessons/first_class_as_args/theory_unit">
<meta name="csrf-param" content="authenticity_token" />
<meta name="csrf-token" content="kmDRk7WiAZkObdctC3HW0IUyTodlsgCWS38HDSQNAal9sRqkR9ys-bgu87UHfianRTtjLW2F_jT2n51Zdgrmxw" />
<script src="/vite/assets/inertia-DfXos102.js" crossorigin="anonymous" type="module"></script><link rel="modulepreload" href="/vite/assets/chunk-DsPFFUou.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/preload-helper-BJ4cLWpC.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/init-BrRXra1y.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/ahoy-DrlRQ-1D.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/analytics-cb8xch9l.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/ErrorFallbackBlock-naDSYSy9.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/Surface-DL2bpZA-.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/gon-D3e4yh1x.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/mantine-CGMYrt2Y.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/utils-DRqSHbQE.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/routes-CCH8ilKF.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/extends-C-EagtpE.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/inheritsLoose-BBd-DCVI.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/objectWithoutPropertiesLoose-DRHXDhjp.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/index.esm-DAqKOkZ0.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/Button-CGPUux8l.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/CloseButton-D1euiPao.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/Group-BX48WcuU.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/Loader-BQEY8g6v.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/Modal-Cy3HByv7.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/OptionalPortal-1Hza5P2w.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/Stack-CtjJzfw4.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/Textarea-Ck64llAy.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/Box-B5-OOzBf.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/DirectionProvider-Dc9zdUke.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/events-DJQOhap0.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/use-reduced-motion-D2owz4wa.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/use-disclosure-zKtK5W1r.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/use-hotkeys-Cnc_Rwkb.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/random-id-DOQyszCZ.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/notifications.store-C-3AFSMn.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/exports-C_MrNx_T.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/axios-BEvgo0ym.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/dayjs.min-BkKovM-s.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/i18next-BlSq9s7B.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/client-U9M77rxp.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/react-dom-DaLxUz_h.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/useTranslation-Bx1Cdrkz.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/compiler-runtime-6XxiPFnt.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/jsx-runtime-CwjcCKJi.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/react-CkL4ZRHB.js" as="script" crossorigin="anonymous">
<link rel="stylesheet" href="/vite/assets/application-BqhCP46M.js" />
<script src="/vite/assets/application-Df9RExpe.js" crossorigin="anonymous" type="module"></script><link rel="modulepreload" href="/vite/assets/chunk-DsPFFUou.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/autocomplete-VMNbxKGl.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/routes-CCH8ilKF.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/createPopper-C3aM9r1M.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/js.cookie-D1-O8zkX.js" as="script" crossorigin="anonymous"><link rel="stylesheet" href="/vite/assets/application-C8HjmMaq.css" media="screen" />
<script>
window.ym = function(){(ym.a=ym.a||[]).push(arguments)};
window.addEventListener('load', function() {
setTimeout(function() {
ym.l = 1*new Date();
ym(window.gon.ym_counter, "init", {
clickmap: true,
trackLinks: true,
accurateTrackBounce: true,
webvisor: true
});
// Загружаем скрипт
var k = document.createElement('script');
k.async = 1;
k.src = 'https://mc.yandex.ru/metrika/tag.js';
document.head.appendChild(k);
ym(window.gon.ym_counter, 'getClientID', function(clientID) {
window.ymClientId = clientID;
});
}, 1500);
});
</script>
<!-- Google Tag Manager - deferred -->
<script>
// dataLayer stub сразу — пуши работают до загрузки скрипта
window.dataLayer = window.dataLayer || [];
// Сам скрипт — отложенно после load
window.addEventListener('load', function() {
setTimeout(function() {
dataLayer.push({'gtm.start': new Date().getTime(), event: 'gtm.js'});
var j = document.createElement('script');
j.async = true;
j.src = 'https://www.googletagmanager.com/gtm.js?id=GTM-WK88TH';
document.head.appendChild(j);
}, 1500);
});
</script>
<!-- End Google Tag Manager -->
</head>
<body>
<noscript>
<div>
<img alt="" src="https://mc.yandex.ru/watch/25559621" style="position:absolute; left:-9999px;">
</div>
</noscript>
<header class="sticky-top bg-body">
<nav class="navbar navbar-expand-lg">
<div class="container-xxl">
<a class="navbar-brand" href="/"><img alt="Логотип Хекслета" height="24" src="https://ru.hexlet.io/vite/assets/logo_ru_light-BpiEA1LT.svg" width="96">
</a><button aria-controls="collapsable" aria-expanded="false" aria-label="Меню" class="navbar-toggler border-0 mb-0 mt-1" data-bs-target="#collapsable" data-bs-toggle="collapse">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="collapsable">
<ul class="navbar-nav mb-lg-0 mt-lg-1">
<li class="nav-item dropdown">
<button aria-haspopup class="btn nav-link" data-bs-toggle="dropdown" type="button">
Все курсы
<span class="bi bi-chevron-down align-middle ms-1"></span>
</button>
<ul class="dropdown-menu">
<li>
<a class="dropdown-item d-flex py-2" href="/courses"><div class="fw-bold me-auto">Все что есть</div>
<div class="text-muted">117</div>
</a></li>
<li>
<hr class="dropdown-divider">
</li>
<li class="dropdown-item">
<b>Популярные категории</b>
</li>
<li>
<a class="dropdown-item py-2" href="/courses_devops">Курсы по DevOps
</a></li>
<li>
<a class="dropdown-item py-2" href="/courses_data_analytics">Курсы по аналитике данных
</a></li>
<li>
<a class="dropdown-item py-2" href="/courses_programming">Курсы по программированию
</a></li>
<li>
<a class="dropdown-item py-2" href="/courses_testing">Курсы по тестированию
</a></li>
<li>
<hr class="dropdown-divider">
</li>
<li class="dropdown-item">
<b>Популярные курсы</b>
</li>
<li>
<a class="dropdown-item py-2" href="/programs/devops-engineer-from-scratch">DevOps-инженер с нуля
</a></li>
<li>
<a class="dropdown-item py-2" href="/programs/go">Go-разработчик
</a></li>
<li>
<a class="dropdown-item py-2" href="/programs/java">Java-разработчик
</a></li>
<li>
<a class="dropdown-item py-2" href="/programs/python">Python-разработчик
</a></li>
<li>
<a class="dropdown-item py-2" href="/programs/qa-auto-engineer-java">Автоматизатор тестирования на Java
</a></li>
<li>
<a class="dropdown-item py-2" href="/programs/data-analytics">Аналитик данных
</a></li>
<li>
<a class="dropdown-item py-2" href="/programs/frontend">Фронтенд-разработчик
</a></li>
</ul>
</li>
<li class="nav-item dropdown">
<button aria-haspopup class="btn nav-link" data-bs-toggle="dropdown" type="button">
О Хекслете
<span class="bi bi-chevron-down align-middle"></span>
</button>
<ul class="dropdown-menu bg-body">
<li>
<a class="dropdown-item py-2" href="/pages/about">О нас
</a></li>
<li>
<a class="dropdown-item py-2" href="/blog">Блог
</a></li>
<li>
<span class="dropdown-item py-2 external-link" data-href="https://special.hexlet.io/hse-research" role="button">Результаты (Исследование)
</span></li>
<li>
<span class="dropdown-item py-2 external-link" data-href="https://career.hexlet.io" role="button">Хекслет Карьера
</span></li>
<li>
<a class="dropdown-item py-2" href="/testimonials">Отзывы студентов
</a></li>
<li>
<span class="dropdown-item py-2 external-link" data-href="https://t.me/hexlet_help_bot" role="button">Поддержка (В ТГ)
</span></li>
<li>
<span class="dropdown-item py-2 external-link" data-href="https://special.hexlet.io/referal-program/?promo_creative=priglasite-druzei&promo_name=referal-program&promo_position=promo_position&promo_start=010724&promo_type=link" role="button">Реферальная программа
</span></li>
<li>
<span class="dropdown-item py-2 external-link" data-href="https://special.hexlet.io/certificate" role="button">Подарочные сертификаты
</span></li>
<li>
<span class="dropdown-item py-2 external-link" data-href="https://hh.ru/employer/4307094" role="button">Вакансии
</span></li>
<li>
<span class="dropdown-item d-flex external-link" rel="noopener noreferrer nofollow" data-href="https://b2b.hexlet.io" data-target="_blank" role="button">Компаниям
</span></li>
<li>
<span class="dropdown-item d-flex external-link" rel="noopener noreferrer nofollow" data-href="https://hexly.ru/" data-target="_blank" role="button">Колледж
</span></li>
<li>
<span class="dropdown-item d-flex external-link" rel="noopener noreferrer nofollow" data-href="https://hexlyschool.ru/" data-target="_blank" role="button">Частная школа
</span></li>
</ul>
</li>
<li><a class="nav-link" href="/subscription/new">Подписка</a></li>
</ul>
<ul class="navbar-nav flex-lg-row align-items-lg-center gap-2 ms-auto">
<li>
<a class="nav-link" aria-label="Переключить тему" href="/theme/switch?new_theme=dark"><span aria-hidden="true" class="bi bi-moon"></span>
</a></li>
<li>
<span data-target="_self" class="nav-link external-link" data-href="/u/new" role="button"><span>Регистрация</span>
</span></li>
<li>
<span data-target="_self" class="nav-link external-link" data-href="https://ru.hexlet.io/session/new" role="button"><span>Вход</span>
</span></li>
</ul>
</div>
</div>
</nav>
</header>
<div class="x-container-xxxl">
</div>
<main class="mb-6 min-vh-100 h-100">
<link rel="preload" as="image" href="https://hexlet.io/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6Mzc2MywicHVyIjoiYmxvYl9pZCJ9fQ==--61c43d4881ca8feecc6f37dfafdc4e304f34b52f/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbNDAwLDQwMF0sInNhdmVyIjp7InF1YWxpdHkiOjg1fX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--5b6f46dacd1af664f27558553a58076185091823/Software%20engineer-bro.png"/><link rel="preload" as="image" href="https://hexlet.io/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MzkzNSwicHVyIjoiYmxvYl9pZCJ9fQ==--06c469e64c9b6c8429a6a01edd20041dae30ce13/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbNDAwLDQwMF0sInNhdmVyIjp7InF1YWxpdHkiOjg1fX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--5b6f46dacd1af664f27558553a58076185091823/Software%20code%20testing-bro.png"/><link rel="preload" as="image" href="/vite/assets/development-BVihs_d5.png"/><div id="app" data-page="{"component":"web/courses/lessons/theory_unit","props":{"errors":{},"locale":"ru","language":"ru","httpsHost":"https://ru.hexlet.io","host":"ru.hexlet.io","colorScheme":"light","auth":{"user":{"id":null,"last_viewed_notification_id":null,"email":null,"state":null,"first_name":"","last_name":"","created_at":"2026-02-26T19:47:12.722Z","current_program":null,"current_team":null,"full_name":"","guest":true,"can_use_paid_features":false,"is_hexlet_employee":false,"sanitized_phone_number":"","can_subscribe":true,"can_renew_education":false}},"cloudflareTurnstileSiteKey":"0x4AAAAAAA15KmeFXzd2H0Xo","vkIdClientId":"51586979","yandexIdClientId":"88d071f1d3384eb4bd1deb37910235c7","formAuthToken":"hw_bYeE5fHdxLz0KVArLrrg-CT8yNtTVlpd5AE26cSlo3hBWE0fRF8dsGZJYBTvZeDcklToBKncrd-NUH72WRw","topics":[{"id":6229,"title":"Поясните, пожалуйста, в чем ошибка? в задаче про сумму в итеративном стиле. Правильно ли я понимаю суть выполнения данной задачи - выполняется операция из функции над первым элементом, результат помещается в аккумулятор, затем выполняется операция над следующим элементом и результат суммируется с данными в аккумуляторе и там сохраняется (то есть значение аккумулятора перезаписывается?). И так происходит до тех пор, пока значение элемента, над которым выполняется функция, не сравняется со значением конечного элемента. Результат - значение аккумулятора.\nВот мой код\n```\n// removed\n```\n\nОшибка\n1) App\\SolutionTest::testSum\nUndefined variable: func\n\n/usr/src/app/Sum.php:12\n/usr/src/app/Sum.php:15\n/usr/src/app/SolutionsTest.php:18\n\nERRORS!\nTests: 2, Assertions: 5, Errors: 1.\nMakefile:2: recipe for target 'test' failed\nmake: *** [test] Error 2\nmake: Leaving directory '/usr/src/app'","plain_title":"Поясните, пожалуйста, в чем ошибка? в задаче про сумму в итеративном стиле. Правильно ли я понимаю суть выполнения данной задачи - выполняется операция из функции над первым элементом, результат помещается в аккумулятор, затем выполняется операция над следующим элементом и результат суммируется с данными в аккумуляторе и там сохраняется (то есть значение аккумулятора перезаписывается?). И так происходит до тех пор, пока значение элемента, над которым выполняется функция, не сравняется со значением конечного элемента. Результат - значение аккумулятора. Вот мой код // removed Ошибка 1) App\\SolutionTest::testSum Undefined variable: func /usr/src/app/Sum.php:12 /usr/src/app/Sum.php:15 /usr/src/app/SolutionsTest.php:18 ERRORS! Tests: 2, Assertions: 5, Errors: 1. Makefile:2: recipe for target 'test' failed make: *** [test] Error 2 make: Leaving directory '/usr/src/app' ","creator":{"public_name":"Елена Соколова","id":105799,"is_tutor":false},"comments":[{"creator":{"public_name":"Елена Соколова","id":105799,"is_tutor":false},"id":11359,"body":"ошибку нашла. Спасибо за урок.","topic_id":6229}],"communitable":{"parent_entity_name":null,"parent_entity_url":null,"entity_name":"Функции первого класса и передача функций как аргументов","entity_url":null,"active":true}},{"id":1702,"title":"Реализовал [функцию product](https://gist.github.com/LeusMaximus/248e411b39478e46db0b#file-product-php) в итеративном стиле. Подскажите, все ли правильно сделал, или можно что-то улучшить?","plain_title":"Реализовал функцию product (https://gist.github.com/LeusMaximus/248e411b39478e46db0b#file-product-php) в итеративном стиле. Подскажите, все ли правильно сделал, или можно что-то улучшить? ","creator":{"public_name":"Maksym Leonidov","id":63820,"is_tutor":false},"comments":[{"creator":{"public_name":"Maksym Leonidov","id":63820,"is_tutor":false},"id":2943,"body":"Да, посмотрел. Нужно было сделать просто рекурсией, а не итеративной рекурсией. Я немного перемудрил, потому и решил здесь написать, чтобы узнать, имеет ли такое решение право на жизнь?","topic_id":1702},{"creator":{"public_name":"Kirill Mokevnin","id":1,"is_tutor":false},"id":2940,"body":"А вы посмотрели решение учителя?","topic_id":1702},{"creator":{"public_name":"Kirill Mokevnin","id":1,"is_tutor":false},"id":2949,"body":"Конечно имеет. Рекурисвный процесс или Итеративный это ваш выбор.","topic_id":1702}],"communitable":{"parent_entity_name":null,"parent_entity_url":null,"entity_name":"Функции первого класса и передача функций как аргументов","entity_url":null,"active":true}},{"id":5147,"title":"Вариант ф-и сумм без передачи $func в вызов\n```function sum($start, $finish, $func)\n{\n // BEGIN (write your solution here)\n $iter = function($start, $acc) use (&$iter, $finish) {\n if($start > $finish) {\n return $acc;\n }\n\n return $iter($start + 1, $acc + $start);\n };\n return $iter($start, 0);\n // END\n}","plain_title":"Вариант ф-и сумм без передачи $func в вызов ```function sum($start, $finish, $func) { // BEGIN (write your solution here) $iter = function($start, $acc) use (&$iter, $finish) { if($start > $finish) { return $acc; } return $iter($start + 1, $acc + $start); }; return $iter($start, 0); // END } ","creator":{"public_name":"Oles Igorev","id":80760,"is_tutor":false},"comments":[{"creator":{"public_name":"Kirill Mokevnin","id":1,"is_tutor":false},"id":9046,"body":"Привет! Дима, а вопрос то какой? Если это постинг решения, то просьба его удалить.","topic_id":5147},{"creator":{"public_name":"Oles Igorev","id":80760,"is_tutor":false},"id":9060,"body":"Привет! Нет, просто правильно ли я понял, что эту задачу можно решить и без оборота значений в функцию? \n```return $iter($start + 1, $acc + $start);```","topic_id":5147}],"communitable":{"parent_entity_name":null,"parent_entity_url":null,"entity_name":"Функции первого класса и передача функций как аргументов","entity_url":null,"active":true}},{"id":2746,"title":"make: Entering directory `/usr/src/app'\n/bin/sh: 1: /nonexistent/.composer/vendor/bin/phpunit: not found\nmake: *** [test] Error 127\nmake: Leaving directory `/usr/src/app'\n\nЧТО ДЕЛАТЬ?","plain_title":"make: Entering directory /usr/src/app' /bin/sh: 1: /nonexistent/.composer/vendor/bin/phpunit: not found make: *** [test] Error 127 make: Leaving directory/usr/src/app' ЧТО ДЕЛАТЬ? ","creator":{"public_name":"Alexander Suleymanov","id":92508,"is_tutor":false},"comments":[{"creator":{"public_name":"Kirill Mokevnin","id":1,"is_tutor":false},"id":4470,"body":"Спасибо что написали, в коде была ошибка. Попробуйте сбросить прогресс и должно заработать.","topic_id":2746}],"communitable":{"parent_entity_name":null,"parent_entity_url":null,"entity_name":"Функции первого класса и передача функций как аргументов","entity_url":null,"active":true}},{"id":2890,"title":" -4 == product(1, 3, function($first, $second) { return $first - $second; }) // minus\nПочему 1 - 3 = -4? Как тут происходит все?","plain_title":" -4 == product(1, 3, function($first, $second) { return $first - $second; }) // minus Почему 1 - 3 = -4? Как тут происходит все? ","creator":{"public_name":"Rustam Shirinov","id":98277,"is_tutor":false},"comments":[{"creator":{"public_name":"Kirill Mokevnin","id":1,"is_tutor":false},"id":4691,"body":"Спасибо за отзыв. Добавили немного описания.","topic_id":2890},{"creator":{"public_name":"Андрей Пустовалов","id":94274,"is_tutor":false},"id":5577,"body":"// f(f(3, 4), 5) => f(-1, 5) => -1 - 5\n-4 == product(3, 5, function ($first, $second) { return $first - $second; }) // minus\n\n-1 - 5 == -6\n\nЗабыли исправить, видимо.","topic_id":2890},{"creator":{"public_name":"Rustam Shirinov","id":98277,"is_tutor":false},"id":4687,"body":"Понял, просто опишите чуть подробнее задание, а то не понятно, что вы имеете ввиду все числа от первого до второго.","topic_id":2890}],"communitable":{"parent_entity_name":null,"parent_entity_url":null,"entity_name":"Функции первого класса и передача функций как аргументов","entity_url":null,"active":true}},{"id":3305,"title":"Прошу помочь. Почему лямбда $func не может вернуться с результатом?\n```\nfunction product($num1, $num2, $func)\n{\n // BEGIN (write your solution here)\n $productIter = function ($num1, $num2, $func) use (&$productIter) {\n if ($num1 > $num2) {return $func;}\n return $productIter ($num1 + 1, $num2, $func($num1, $num1 + 1));\n };\n return $productIter($num1, $num2, $func);\n // END\n}\n``` ","plain_title":"Прошу помочь. Почему лямбда $func не может вернуться с результатом? function product($num1, $num2, $func) { // BEGIN (write your solution here) $productIter = function ($num1, $num2, $func) use (&$productIter) { if ($num1 > $num2) {return $func;} return $productIter ($num1 + 1, $num2, $func($num1, $num1 + 1)); }; return $productIter($num1, $num2, $func); // END } ","creator":{"public_name":"Владимир Тарановский","id":83372,"is_tutor":false},"comments":[{"creator":{"public_name":"Kirill Mokevnin","id":1,"is_tutor":false},"id":5418,"body":"Не понял вопрос.","topic_id":3305},{"creator":{"public_name":"Владимир Тарановский","id":83372,"is_tutor":false},"id":5419,"body":"Верно ли \"вербальное\" решение задачи? : \nфункция product наращивает стэк, т.е. product пошагово сворачивает последовательность от $num1 до $num2; а лямбда $func, которую мы передали как аргумент в product , \"связывает\" каждый $num1 и $num1 + 1 пока мы не дойдём до $num2 (внутри $func находится инструмент для связывания, но он нам не важен). \n","topic_id":3305},{"creator":{"public_name":"Владимир Тарановский","id":83372,"is_tutor":false},"id":5410,"body":"Как должен выглядеть процесс на мой взгляд: необходимо последовательно применять переданную как аргумент лямбду с аргументами ($num1, $num1 + 1), в каждой итерации увеличивать $num1 на 1 пока не выполниться if. Как только это произойдёт - возвращаем $func, в которой аккумулировался результат.\nЯ предполагаю, что в $func результат не может накапливаться, но как сделать аккумулятор, для всех возможных арифметических ф-ций ума не приложу...","topic_id":3305},{"creator":{"public_name":"Владимир Тарановский","id":83372,"is_tutor":false},"id":5413,"body":"Блин, закрываю глаза и прям вижу решение:\n```\nfunction(function(function($num, $num + 1), $num + 2), $ num + n)\n```\nА как в код оформить - не знаю! (","topic_id":3305}],"communitable":{"parent_entity_name":null,"parent_entity_url":null,"entity_name":"Функции первого класса и передача функций как аргументов","entity_url":null,"active":true}},{"id":966,"title":"Первый раз сталкиваюсь с передачей аргументов и снова в голову не приходит лаконичное решение, а тест убивает процесс из-за бесконечной рекурсии.\nЯ соорудил вот такую конструкцию:\n```\n if ($num1 > $num2) { return 0; } \n \treturn product($num1-1, $num2, $func);\n```\nВ первой сточке смысл очевиден, а вот рекурсией проблема. Если я правильно понял, я просто уменьшаю первое число без каких либо действий. Но если я напишу по аналогии с видео\n```\n$func($num1) + product($num1-1, $num2, $func);\n```\nТо здесь уже явно заданно сложение, а нам надо не только складывать. Или надо в этом направлении думать.\n```\n$func($num1, product($num1-1, $num2, $func));;\n```\nСложно сформулировать вопрос, но в каком направлении думать? Откровенно говоря, я с трудом представляю даже первую итерацию моей функции в тесте.","plain_title":"Первый раз сталкиваюсь с передачей аргументов и снова в голову не приходит лаконичное решение, а тест убивает процесс из-за бесконечной рекурсии. Я соорудил вот такую конструкцию: if ($num1 > $num2) { return 0; } return product($num1-1, $num2, $func); В первой сточке смысл очевиден, а вот рекурсией проблема. Если я правильно понял, я просто уменьшаю первое число без каких либо действий. Но если я напишу по аналогии с видео $func($num1) + product($num1-1, $num2, $func); То здесь уже явно заданно сложение, а нам надо не только складывать. Или надо в этом направлении думать. $func($num1, product($num1-1, $num2, $func));; Сложно сформулировать вопрос, но в каком направлении думать? Откровенно говоря, я с трудом представляю даже первую итерацию моей функции в тесте. ","creator":{"public_name":"Aram Saakyan","id":56166,"is_tutor":false},"comments":[{"creator":{"public_name":"Aram Saakyan","id":56166,"is_tutor":false},"id":1746,"body":"Спасибо, направление примерно понял, погуглил немного. Пока правда не работает, завтра продолжу изучение :)\n```\n if ($num1 > $num2) { return 0; } \n \treturn function plus($num1, $num2) { \n return product($num1 - 1, $num2, $func);\n\t\t};\n```","topic_id":966},{"creator":{"public_name":"Kirill Mokevnin","id":1,"is_tutor":false},"id":1747,"body":"А вот функцию в функцию вкладывать не надо, `plus` только складывает. Помните что мы работаем с энергичным языком и вычисление аргументов происходит до их передачи в функцию?","topic_id":966},{"creator":{"public_name":"Kirill Mokevnin","id":1,"is_tutor":false},"id":1743,"body":"Вот по этому лиспы намного больше подходят для изучения программирования).\n\nА вы представьте что `+` это функция и вызывается она вот так `+($num1, $num2)`. м?)","topic_id":966},{"creator":{"public_name":"Kirill Mokevnin","id":1,"is_tutor":false},"id":1744,"body":"Если этого не достаточно, то вы можете сделать так, напишите где-нибудь у себя локально функцию из видео и вместо `+` используйте функцию которую `plus`, которая принимает на вход два числа и возвращает результат сложения. После этого должно стать очевидным как решать задачу.","topic_id":966},{"creator":{"public_name":"Kirill Mokevnin","id":1,"is_tutor":false},"id":1745,"body":"Чувствуете как мозг кипит?) На самом деле это не от сложности, а от того что такой взгляд на вещи для мозга непривычен (это касается не новичков, а тех кто начинал с императивной парадигмы) и нужно действительно начать по другому думать. Учиться разбивать задачу на подзадачи и развивать абстрактное мышление.","topic_id":966}],"communitable":{"parent_entity_name":null,"parent_entity_url":null,"entity_name":"Функции первого класса и передача функций как аргументов","entity_url":null,"active":true}},{"id":2642,"title":"Понял урок, но не понял как происходят вычисления, попытался разобраться в изначальных примерах. \n```\n$cube = function($num) {\n return $num * $num * $num;\n};\n```\nЗдесь все понятно, мы передаем к примеру цифру 5 и получаем 5 на 5 на 5 = 125.\nДалее: \n```\n$sumIntegers = function($a, $b) {\n if ($a > $b) { return 0; }\n return $a + $sumIntegers($a + 1, $b);\n};\n```\nЕсли что-то передать, то получается ошибка \"Fatal error: Function name must be a string in ...\", за исключением если a будет больше b, \nтакже это касается и примера с кубами. В чем кроется ошибка? Я так понял PHP пытается сказать что имя функции может быть строкой, но как это исправить? ","plain_title":"Понял урок, но не понял как происходят вычисления, попытался разобраться в изначальных примерах. $cube = function($num) { return $num * $num * $num; }; Здесь все понятно, мы передаем к примеру цифру 5 и получаем 5 на 5 на 5 = 125. Далее: $sumIntegers = function($a, $b) { if ($a > $b) { return 0; } return $a + $sumIntegers($a + 1, $b); }; Если что-то передать, то получается ошибка \"Fatal error: Function name must be a string in ...\", за исключением если a будет больше b, также это касается и примера с кубами. В чем кроется ошибка? Я так понял PHP пытается сказать что имя функции может быть строкой, но как это исправить? ","creator":{"public_name":"Александр Моргунов","id":1425,"is_tutor":false},"comments":[{"creator":{"public_name":"Александр Моргунов","id":1425,"is_tutor":false},"id":4296,"body":"Помедитировав на код =) я видимо понял как попадают данные, при передаче переменной $identity в функцию sum в качестве аргумента она становится $identity == $func, я правильно понял? В таком случае мне не понятно что происходит в этом участке кода: \n```\nsum($a + 1, $b, $func);\n```\nНе понятно конкретно что делает переменная $b и $func ","topic_id":2642},{"creator":{"public_name":"Александр Моргунов","id":1425,"is_tutor":false},"id":4335,"body":"Спасибо большое Владиславу, натолкнул меня как я надеюсь на правильную мысль.","topic_id":2642},{"creator":{"public_name":"Александр Моргунов","id":1425,"is_tutor":false},"id":4333,"body":"Я понял как это работает: \n1. Сперва вычисляется рекурсия - ```sum($a + 1, $b, $func); - (1 * 1) + (2 * 2) + (3 * 3) + (4 * 4) == 30``` \n2. т.к. 5 не соответствует условию, то она просто записывается в начало ```$func($a)``` и не попадает сюда ```sum($a + 1, $b, $func); и поэтому получается (5 * 5 == 25) + (1 * 1) + (2 * 2) + (3 * 3) + (4 * 4) == 55``` 5 попадает в вычисление, т.к. условие не проверяет функцию в переменной $identity и поэтому результат ее выполнения попадает в ```$func($a)```","topic_id":2642},{"creator":{"public_name":"Александр Моргунов","id":1425,"is_tutor":false},"id":4334,"body":"Отсюда вытекает другой вопрос, каким образом хранятся данные во время вычисления, куда он сохраняет результат итерации? Создает массив? Пересмотрю еще раз видео, надеюсь не прослушал =) ","topic_id":2642},{"creator":{"public_name":"Александр Моргунов","id":1425,"is_tutor":false},"id":4297,"body":"И если Вам не сложно не могли бы вы показать поэтапно как мы получаем результат 55. Также как в уроке \"Линейно-итеративный процесс\"\n","topic_id":2642},{"creator":{"public_name":"Александр Моргунов","id":1425,"is_tutor":false},"id":4332,"body":"5 не подходит, т.к. 5 не может быть больше 5, в таком случае условие должно быть таким: `if ($a >= $b) { return 0; }`","topic_id":2642},{"creator":{"public_name":"Kirill Mokevnin","id":1,"is_tutor":false},"id":4293,"body":"Во втором примере ошибка. Вы не передали `$sumIntegers` внутрь как замыкание. Об этом рассказывалось в видео про рекурсивные функции.","topic_id":2642},{"creator":{"public_name":"Владислав Савельев","id":53733,"is_tutor":false},"id":4331,"body":"1. В **$func($a)** попадает цифра 1 из sum**(1, 5, function($x)** , умножается сама на себя так как**{return $x * $x;}** на выходе имеем 1, потом начинается рекурсивный вызов функции и суммирование его.\n2. 2 х 2 = 4 + функция \n3. 3 х 3 = 9 + функция\n4. 4 х 4 = 16 + функция\n5. 5 х 5 = 25 + функция\n6. выход из рекурсии **($a > $b)** // 6 > 5 = **TRUE** потом возвращаем 0 и прибавляем его к куче. \n7. 1 + 4 + 9 + 16 + 25 + 0 = 55\n\nПС: Ну как я понял, вроде как верно ;D","topic_id":2642},{"creator":{"public_name":"Александр Моргунов","id":1425,"is_tutor":false},"id":4295,"body":"Хорошо, пересмотрю, просто пример то Ваш был и получается в нем ошибка. =)\nТеперь другой вопрос, про вычисления. В примере который Вы описывали суть понятна, но мне совершенно не понятно каким образом там происходит вычисление, к примеру: \n```\nfunction sum($a, $b, $func) {\n if ($a > $b) { return 0; }\n return $func($a) + sum($a + 1, $b, $func);\n}\n\n$identity = function($x) { return $x * $x; };\necho sum(1, 5, $identity);\n```\nВ функцию sum мы передаем функцию в переменной $identity, но откуда она берет данные? Как в переменную $x попадают данные? ","topic_id":2642}],"communitable":{"parent_entity_name":null,"parent_entity_url":null,"entity_name":"Функции первого класса и передача функций как аргументов","entity_url":null,"active":true}},{"id":7303,"title":"Мозги подкипают.\nВроде решение автора понятно, но не могу понять один момент\n```\n<?php\nfunction sum($start, $finish, $func)\n{\n $iter = function ($current, $acc) use ($finish, $func, &$iter) {\n if ($current > $finish) {\n return $acc;\n }\n\n return $iter($current + 1, $acc + $func($current));\n };\n\n return $iter($start, 0);\n}\necho sum(5, 10, function($x) { return $x * $x; });\t\n\n?>\n```\nВот эта строчка\n```\n$iter = function ($current, $acc) use ($finish, $func, &$iter)\n```\nПочему мы не написали так \n```\nfunction ($current, $acc, $finish, $func) use (&$iter)\n```","plain_title":"Мозги подкипают. Вроде решение автора понятно, но не могу понять один момент ``` <?php function sum($start, $finish, $func) { $iter = function ($current, $acc) use ($finish, $func, &$iter) { if ($current > $finish) { return $acc; } return $iter($current + 1, $acc + $func($current)); }; return $iter($start, 0); } echo sum(5, 10, function($x) { return $x * $x; }); ?> Вот эта строчка $iter = function ($current, $acc) use ($finish, $func, &$iter) Почему мы не написали так function ($current, $acc, $finish, $func) use (&$iter) ``` ","creator":{"public_name":"Иван Синевич","id":133435,"is_tutor":false},"comments":[{"creator":{"public_name":"Иван Синевич","id":133435,"is_tutor":false},"id":13559,"body":"Да согласен, глупый вопрос. Просто уже мозг пере\nгрелся","topic_id":7303},{"creator":{"public_name":"Иван Синевич","id":133435,"is_tutor":false},"id":13556,"body":"У меня такой код тоже работает\n```\n<?php\nfunction sum($start, $finish, $func)\n{\n $iter = function ($current, $acc, $finish, $func) use (&$iter) {\n if ($current > $finish) {\n return $acc;\n }\n\n return $iter($current + 1, $acc + $func($current), $finish, $func);\n };\n\n return $iter($start, 0, $finish, $func);\n}\necho sum(5, 10, function($x) { return $x * $X; });\t\n\n?>\n```\n","topic_id":7303},{"creator":{"public_name":"Kirill Grafov","id":102252,"is_tutor":false},"id":13558,"body":"Есть ли смысл каждый раз гонять аргументы туда-сюда, если они не меняются? ","topic_id":7303}],"communitable":{"parent_entity_name":null,"parent_entity_url":null,"entity_name":"Функции первого класса и передача функций как аргументов","entity_url":null,"active":true}},{"id":2040,"title":"Поясните, пожалуйста. Применима ли в тестовом задании реализация передаваемой в product() функции как возведение первого аргумента в степень второго?\n```\n$func = function ($a, $b) { return pow($a, $b); };\n```\nЕсли да, то при product(2, 4, $func) должно получиться\n```\npow(pow(2, 3), 4) = 2 ^ 12\n```\nНо по решению автора рекурсия разворачивается в\n```\npow(2, pow(3, 4)) = 2 ^ 81\n```","plain_title":"Поясните, пожалуйста. Применима ли в тестовом задании реализация передаваемой в product() функции как возведение первого аргумента в степень второго? $func = function ($a, $b) { return pow($a, $b); }; Если да, то при product(2, 4, $func) должно получиться pow(pow(2, 3), 4) = 2 ^ 12 Но по решению автора рекурсия разворачивается в pow(2, pow(3, 4)) = 2 ^ 81 ","creator":{"public_name":"Andrey Bogomolov","id":46923,"is_tutor":false},"comments":[{"creator":{"public_name":"Kirill Mokevnin","id":1,"is_tutor":false},"id":3395,"body":"Отличная находка. В решении действительно ошибка, по умолчанию операции являются левоассоциативными, а мой код делает правую ассоциативность. Такое решение работает с операциями у которых порядок применения не важен (умножение, сложение), но не работает в остальных случаях. Спасибо за внимательность! Упражнение правлю","topic_id":2040},{"creator":{"public_name":"Andrey Bogomolov","id":46923,"is_tutor":false},"id":3398,"body":"Спасибо за ответ и за курс! )","topic_id":2040}],"communitable":{"parent_entity_name":null,"parent_entity_url":null,"entity_name":"Функции первого класса и передача функций как аргументов","entity_url":null,"active":true}}],"lesson":{"exercise":{"id":191,"slug":"php_sicp_function_in_args_exercise","name":null,"state":"active","kind":"exercise","language":"php","locale":"ru","has_web_view":false,"has_test_view":false,"reviewable":true,"readme":"## src/App/Sum.php\n\nРеализуйте функцию `sum()` из видео, используя итеративный процесс.\n\n## scr/App/Product.php\n\nРеализуйте функцию `product()`, которая сворачивает последовательность с помощью переданной функции.\nПоследовательность задается первыми двумя аргументами. Первый это начало последовательности,\nвторой это окончание. Например, последовательность `[1, 4]` это 1, 2, 3, 4. Свертка это сведение\nпоследовательности к какому-то значению. Само значение зависит от того, какая операция применяется при свертке. Обратите внимание, что последовательность, типа `[$x, $x]`, состоит из одного числа `$x` и свертке не подлежит, функция в этом случае должна вернуть само число `$x`.\n\n'С помощью переданной функции' означает то, что мы применяем эту функцию к элементам последовательности и\nиспользуем ее результат, как аккумулятор (накопитель результата).\n\n### Примеры\n\n```php\n// f(1, 2) => 1 + 2\n3 === product(1, 2, fn($first, $second) => $first + $second) // sum\n\n// f(f(3, 4), 5) => f(-1, 5) => -1 - 5\n-6 === product(3, 5, fn($first, $second) => $first - $second) // minus\n```\n\nПо последнему примеру видно, что операция является левоассоциативной. Рассмотрим данное свойство подробнее на последовательности `[1, 4]`:\n\nПоследовательность: 1, 2, 3, 4.\nОперация: `f` - внутренности не важны, главное, что это некая функция.\n\nРазложим операцию с учетом ее левоассоциативности:\n\n```php\nf($left1, $right1); // $right1 = 4\nf(f($left2, $right2), $right1); // $right2 = 3\nf(f(f($left3, $right3), $right2), $right1); // $right3 = 2\n\n// f = function ($first, $second) { return $first - $second; };\nf(f(f(1, 2), 3), 4);\nf(f(-1, 3), 4);\nf(-4, 4); // -8\n```\n","prepared_readme":"## src/App/Sum.php\n\nРеализуйте функцию `sum()` из видео, используя итеративный процесс.\n\n## scr/App/Product.php\n\nРеализуйте функцию `product()`, которая сворачивает последовательность с помощью переданной функции.\nПоследовательность задается первыми двумя аргументами. Первый это начало последовательности,\nвторой это окончание. Например, последовательность `[1, 4]` это 1, 2, 3, 4. Свертка это сведение\nпоследовательности к какому-то значению. Само значение зависит от того, какая операция применяется при свертке. Обратите внимание, что последовательность, типа `[$x, $x]`, состоит из одного числа `$x` и свертке не подлежит, функция в этом случае должна вернуть само число `$x`.\n\n'С помощью переданной функции' означает то, что мы применяем эту функцию к элементам последовательности и\nиспользуем ее результат, как аккумулятор (накопитель результата).\n\n### Примеры\n\n```php\n// f(1, 2) => 1 + 2\n3 === product(1, 2, fn($first, $second) => $first + $second) // sum\n\n// f(f(3, 4), 5) => f(-1, 5) => -1 - 5\n-6 === product(3, 5, fn($first, $second) => $first - $second) // minus\n```\n\nПо последнему примеру видно, что операция является левоассоциативной. Рассмотрим данное свойство подробнее на последовательности `[1, 4]`:\n\nПоследовательность: 1, 2, 3, 4.\nОперация: `f` - внутренности не важны, главное, что это некая функция.\n\nРазложим операцию с учетом ее левоассоциативности:\n\n```php\nf($left1, $right1); // $right1 = 4\nf(f($left2, $right2), $right1); // $right2 = 3\nf(f(f($left3, $right3), $right2), $right1); // $right3 = 2\n\n// f = function ($first, $second) { return $first - $second; };\nf(f(f(1, 2), 3), 4);\nf(f(-1, 3), 4);\nf(-4, 4); // -8\n```\n","has_solution":true,"entity_name":"Функции первого класса и передача функций как аргументов"},"units":[{"id":603,"name":"theory","url":"/courses/php-sicp/lessons/first_class_as_args/theory_unit"},{"id":605,"name":"quiz","url":"/courses/php-sicp/lessons/first_class_as_args/quiz_unit"},{"id":604,"name":"exercise","url":"/courses/php-sicp/lessons/first_class_as_args/exercise_unit"}],"links":[],"ordered_units":[{"id":603,"name":"theory","url":"/courses/php-sicp/lessons/first_class_as_args/theory_unit"},{"id":605,"name":"quiz","url":"/courses/php-sicp/lessons/first_class_as_args/quiz_unit"},{"id":604,"name":"exercise","url":"/courses/php-sicp/lessons/first_class_as_args/exercise_unit"}],"id":363,"slug":"first_class_as_args","state":"approved","name":"Функции первого класса и передача функций как аргументов","course_order":70,"goal":"Учимся передавать анонимные функции как аргументы других функций","self_study":null,"theory_video_provider":"vimeo","theory_video_uid":"130719464","theory":"## Поправки к видео\n\n```php\n<?php\n\n$sumIntegers = function ($a, $b) use (&$sumIntegers) {\n // ...\n}\n```\n\n```php\n<?php\n\n$sumCubes = function ($a, $b) use (&$sumCubes) {\n // ...\n}\n```\n"},"lessonMember":null,"courseMember":null,"course":{"start_lesson":{"exercise":null,"units":[{"id":1211,"name":"theory","url":"/courses/php-sicp/lessons/intro/theory_unit"}],"links":[],"ordered_units":[{"id":1211,"name":"theory","url":"/courses/php-sicp/lessons/intro/theory_unit"}],"id":624,"slug":"intro","state":"approved","name":"Введение","course_order":0,"goal":"Знакомимся с курсом, декларативным программированием и других парадигмах","self_study":null,"theory_video_provider":"vimeo","theory_video_uid":"156405268","theory":""},"id":75,"slug":"php-sicp","challenges_count":5,"name":"PHP: Построение абстракций","allow_indexing":true,"state":"approved","course_state":"finished","pricing_type":"paid","description":"На этом курсе вы познакомитесь с основами функционального программирования и понятием декларативного программирования. Вы узнаете, как использовать функции высшего порядка и работать с лямбда-функциями. Еще вы научитесь комбинировать функции, строить рекурсии с аккумулятором и оптимизировать хвостовую рекурсию.\nТакже вы изучите структуры данных и научитесь использовать функции высшего порядка: map, filter и свертка. Вы познакомитесь с концепцией разделения программы на функциональные блоки и научитесь работать с общей структурой данных.\nВ конце курса вы узнаете о присваивании и изменении состояния, а также о создании объектов. Вы рассмотрите преимущества и недостатки присваивания и сохранения состояния, чтобы лучше понимать, как использовать эти концепции в своих программах. Полученные знания помогут разрабатывать более эффективные и чистые программы.\nЭтот курс является адаптацией под php знаменитого курса «Структура и интерпретация компьютерных программ», который преподается на первом курсе МИТ (Massachusetts Institute of Technology) с 70-х годов.","kind":"additional","updated_at":"2026-01-20T11:55:16.759Z","language":"php","duration_cache":90240,"skills":["Применять функциональное и декларативное программирование","Создавать гибкие алгоритмы с помощью функции высшего порядка и лямбда-функции","Обрабатывать сложные задачи с помощью рекурсивных функций с аккумулятором","Улучшать читаемость, разделяя программу на модули и функциональные блоки","Обрабатывать коллекции данных с помощью структуры данных и функции высшего порядка"],"keywords":["абстрации","рекурсия","функции высшего порядка","интерфейсы","присваивание","свёртка"],"lessons_count":20,"cover":"https://hexlet.io/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6OTEzMSwicHVyIjoiYmxvYl9pZCJ9fQ==--3ba3584f2fa679f478641d2f93050edfe2ceb7e0/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJwbmciLCJyZXNpemVfdG9fZmlsbCI6WzYwMCw0MDBdfSwicHVyIjoidmFyaWF0aW9uIn19--6067466c2912ca31a17eddee04b8cf2a38c6ad17/image.png"},"recommendedLandings":[{"stack":{"id":28,"slug":"php-sicp","title":"СИКП на PHP","audience":"for_programmers","start_type":"anytime","pricing_model":"subscription","priority":"medium","kind":"track","state":"published","stack_state":"finished","order":4010,"duration_in_months":1},"id":44,"slug":"php-sicp","title":"СИКП на PHP","subtitle":"Навык понимать программы на глубоком уровне, уверенно проходить собеседования и решать сложные задачи","subtitle_for_lists":"Навык фундаментального понимания программ на PHP","locale":"ru","current":true,"duration_in_months_text":"1 месяц","stack_slug":"php-sicp","price_text":"от 3 900 ₽","duration_text":"1 месяц","cover_list_variant":"https://hexlet.io/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6Mzc2MywicHVyIjoiYmxvYl9pZCJ9fQ==--61c43d4881ca8feecc6f37dfafdc4e304f34b52f/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbNDAwLDQwMF0sInNhdmVyIjp7InF1YWxpdHkiOjg1fX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--5b6f46dacd1af664f27558553a58076185091823/Software%20engineer-bro.png"},{"stack":{"id":39,"slug":"php-phpunit-testing","title":"Автоматизация тестирования на PHP","audience":"for_programmers","start_type":"anytime","pricing_model":"subscription","priority":"medium","kind":"track","state":"published","stack_state":"finished","order":1900,"duration_in_months":4},"id":66,"slug":"php-phpunit-testing","title":"Автоматизация тестирования на PHP","subtitle":"Навык написания тестов и применения продвинутых подходов, повышающий качество кода","subtitle_for_lists":"Навык тестирования на PHP","locale":"ru","current":true,"duration_in_months_text":"4 месяца","stack_slug":"php-phpunit-testing","price_text":"от 3 900 ₽","duration_text":"4 месяца","cover_list_variant":"https://hexlet.io/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MzkzNSwicHVyIjoiYmxvYl9pZCJ9fQ==--06c469e64c9b6c8429a6a01edd20041dae30ce13/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbNDAwLDQwMF0sInNhdmVyIjp7InF1YWxpdHkiOjg1fX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--5b6f46dacd1af664f27558553a58076185091823/Software%20code%20testing-bro.png"}],"lessonMemberUnit":null,"accessToLearnUnitExists":false,"accessToCourseExists":false},"url":"/courses/php-sicp/lessons/first_class_as_args/theory_unit","version":"8f286f6358a90a7bef2263b3a6edf5a90a94fa42","encryptHistory":false,"clearHistory":false}"><style data-mantine-styles="true">:root, :host{--mantine-font-family: Arial, sans-serif;--mantine-font-family-headings: Arial, sans-serif;--mantine-heading-font-weight: normal;--mantine-radius-default: 0rem;--mantine-primary-color-filled: var(--mantine-color-indigo-filled);--mantine-primary-color-filled-hover: var(--mantine-color-indigo-filled-hover);--mantine-primary-color-light: var(--mantine-color-indigo-light);--mantine-primary-color-light-hover: var(--mantine-color-indigo-light-hover);--mantine-primary-color-light-color: var(--mantine-color-indigo-light-color);--mantine-spacing-xxl: calc(4rem * var(--mantine-scale));--mantine-font-size-xs: 12px;--mantine-font-size-sm: 14px;--mantine-font-size-md: 16px;--mantine-font-size-lg: clamp(16.0000px, calc(15.2727px + 0.2273vw), 18.0000px);--mantine-font-size-xl: clamp(16.0000px, calc(14.5455px + 0.4545vw), 20.0000px);--mantine-font-size-display-3: clamp(32.0000px, calc(26.1818px + 1.8182vw), 48.0000px);--mantine-font-size-display-2: clamp(36.0000px, calc(25.8182px + 3.1818vw), 64.0000px);--mantine-font-size-display-1: clamp(40.0000px, calc(25.4545px + 4.5455vw), 80.0000px);--mantine-font-size-h1: clamp(28.0000px, calc(23.6364px + 1.3636vw), 40.0000px);--mantine-font-size-h2: clamp(24.0000px, calc(21.0909px + 0.9091vw), 32.0000px);--mantine-font-size-h3: clamp(20.0000px, calc(17.0909px + 0.9091vw), 28.0000px);--mantine-font-size-h4: clamp(16.0000px, calc(13.0909px + 0.9091vw), 24.0000px);--mantine-font-size-h5: clamp(16.0000px, calc(14.5455px + 0.4545vw), 20.0000px);--mantine-font-size-h6: 1rem;--mantine-primary-color-0: var(--mantine-color-indigo-0);--mantine-primary-color-1: var(--mantine-color-indigo-1);--mantine-primary-color-2: var(--mantine-color-indigo-2);--mantine-primary-color-3: var(--mantine-color-indigo-3);--mantine-primary-color-4: var(--mantine-color-indigo-4);--mantine-primary-color-5: var(--mantine-color-indigo-5);--mantine-primary-color-6: var(--mantine-color-indigo-6);--mantine-primary-color-7: var(--mantine-color-indigo-7);--mantine-primary-color-8: var(--mantine-color-indigo-8);--mantine-primary-color-9: var(--mantine-color-indigo-9);--mantine-color-red-0: #ffeaea;--mantine-color-red-1: #fed4d4;--mantine-color-red-2: #f4a7a8;--mantine-color-red-3: #ec7878;--mantine-color-red-4: #e55050;--mantine-color-red-5: #e03131;--mantine-color-red-6: #e02829;--mantine-color-red-7: #c71a1c;--mantine-color-red-8: #b21218;--mantine-color-red-9: #9c0411;--mantine-color-violet-0: #fce9ff;--mantine-color-violet-1: #f1cfff;--mantine-color-violet-2: #e09bff;--mantine-color-violet-3: #d16fff;--mantine-color-violet-4: #be37fe;--mantine-color-violet-5: #b51afe;--mantine-color-violet-6: #b009ff;--mantine-color-violet-7: #9b00e4;--mantine-color-violet-8: #8a00cc;--mantine-color-violet-9: #7800b3;--mantine-color-indigo-0: #edecff;--mantine-color-indigo-1: #d6d5fe;--mantine-color-indigo-2: #aaa9f4;--mantine-color-indigo-3: #7b79eb;--mantine-color-indigo-4: #5451e4;--mantine-color-indigo-5: #3b37e0;--mantine-color-indigo-6: #2d2adf;--mantine-color-indigo-7: #1f1ec7;--mantine-color-indigo-8: #1819b2;--mantine-color-indigo-9: #0c149e;--mantine-color-cyan-0: #dffdff;--mantine-color-cyan-1: #caf5ff;--mantine-color-cyan-2: #99e8ff;--mantine-color-cyan-3: #64daff;--mantine-color-cyan-4: #3ccffe;--mantine-color-cyan-5: #24c8fe;--mantine-color-cyan-6: #00c2ff;--mantine-color-cyan-7: #00ade4;--mantine-color-cyan-8: #009acd;--mantine-color-cyan-9: #0085b5;--mantine-color-green-0: #e9fdec;--mantine-color-green-1: #d7f6dc;--mantine-color-green-2: #b0eab9;--mantine-color-green-3: #86df94;--mantine-color-green-4: #62d574;--mantine-color-green-5: #4ccf5f;--mantine-color-green-6: #3fcc54;--mantine-color-green-7: #2fb344;--mantine-color-green-8: #25a03b;--mantine-color-green-9: #138a2e;--mantine-color-yellow-0: #fff7e2;--mantine-color-yellow-1: #ffeecd;--mantine-color-yellow-2: #ffdc9c;--mantine-color-yellow-3: #ffc966;--mantine-color-yellow-4: #feb93a;--mantine-color-yellow-5: #feae1e;--mantine-color-yellow-6: #ffa90f;--mantine-color-yellow-8: #ca8200;--mantine-color-yellow-9: #af7000;--mantine-h1-font-size: clamp(28.0000px, calc(23.6364px + 1.3636vw), 40.0000px);--mantine-h1-font-weight: normal;--mantine-h2-font-size: clamp(24.0000px, calc(21.0909px + 0.9091vw), 32.0000px);--mantine-h2-font-weight: normal;--mantine-h3-font-size: clamp(20.0000px, calc(17.0909px + 0.9091vw), 28.0000px);--mantine-h3-font-weight: normal;--mantine-h4-font-size: clamp(16.0000px, calc(13.0909px + 0.9091vw), 24.0000px);--mantine-h4-font-weight: normal;--mantine-h5-font-size: clamp(16.0000px, calc(14.5455px + 0.4545vw), 20.0000px);--mantine-h5-font-weight: normal;--mantine-h6-font-size: 1rem;--mantine-h6-font-weight: normal;}
:root[data-mantine-color-scheme="dark"], :host([data-mantine-color-scheme="dark"]){--mantine-color-anchor: var(--mantine-color-text);--mantine-color-dimmed: #495057;--mantine-color-dark-filled: var(--mantine-color-dark-5);--mantine-color-dark-filled-hover: var(--mantine-color-dark-6);--mantine-color-dark-light: rgba(105, 105, 105, 0.15);--mantine-color-dark-light-hover: rgba(105, 105, 105, 0.2);--mantine-color-dark-light-color: var(--mantine-color-dark-0);--mantine-color-dark-outline: var(--mantine-color-dark-1);--mantine-color-dark-outline-hover: rgba(184, 184, 184, 0.05);--mantine-color-gray-filled: var(--mantine-color-gray-5);--mantine-color-gray-filled-hover: var(--mantine-color-gray-6);--mantine-color-gray-light: rgba(222, 226, 230, 0.15);--mantine-color-gray-light-hover: rgba(222, 226, 230, 0.2);--mantine-color-gray-light-color: var(--mantine-color-gray-0);--mantine-color-gray-outline: var(--mantine-color-gray-1);--mantine-color-gray-outline-hover: rgba(241, 243, 245, 0.05);--mantine-color-red-filled: var(--mantine-color-red-5);--mantine-color-red-filled-hover: var(--mantine-color-red-6);--mantine-color-red-light: rgba(236, 120, 120, 0.15);--mantine-color-red-light-hover: rgba(236, 120, 120, 0.2);--mantine-color-red-light-color: var(--mantine-color-red-0);--mantine-color-red-outline: var(--mantine-color-red-1);--mantine-color-red-outline-hover: rgba(254, 212, 212, 0.05);--mantine-color-pink-filled: var(--mantine-color-pink-5);--mantine-color-pink-filled-hover: var(--mantine-color-pink-6);--mantine-color-pink-light: rgba(250, 162, 193, 0.15);--mantine-color-pink-light-hover: rgba(250, 162, 193, 0.2);--mantine-color-pink-light-color: var(--mantine-color-pink-0);--mantine-color-pink-outline: var(--mantine-color-pink-1);--mantine-color-pink-outline-hover: rgba(255, 222, 235, 0.05);--mantine-color-grape-filled: var(--mantine-color-grape-5);--mantine-color-grape-filled-hover: var(--mantine-color-grape-6);--mantine-color-grape-light: rgba(229, 153, 247, 0.15);--mantine-color-grape-light-hover: rgba(229, 153, 247, 0.2);--mantine-color-grape-light-color: var(--mantine-color-grape-0);--mantine-color-grape-outline: var(--mantine-color-grape-1);--mantine-color-grape-outline-hover: rgba(243, 217, 250, 0.05);--mantine-color-violet-filled: var(--mantine-color-violet-5);--mantine-color-violet-filled-hover: var(--mantine-color-violet-6);--mantine-color-violet-light: rgba(209, 111, 255, 0.15);--mantine-color-violet-light-hover: rgba(209, 111, 255, 0.2);--mantine-color-violet-light-color: var(--mantine-color-violet-0);--mantine-color-violet-outline: var(--mantine-color-violet-1);--mantine-color-violet-outline-hover: rgba(241, 207, 255, 0.05);--mantine-color-indigo-filled: var(--mantine-color-indigo-5);--mantine-color-indigo-filled-hover: var(--mantine-color-indigo-6);--mantine-color-indigo-light: rgba(123, 121, 235, 0.15);--mantine-color-indigo-light-hover: rgba(123, 121, 235, 0.2);--mantine-color-indigo-light-color: var(--mantine-color-indigo-0);--mantine-color-indigo-outline: var(--mantine-color-indigo-1);--mantine-color-indigo-outline-hover: rgba(214, 213, 254, 0.05);--mantine-color-blue-filled: var(--mantine-color-blue-5);--mantine-color-blue-filled-hover: var(--mantine-color-blue-6);--mantine-color-blue-light: rgba(116, 192, 252, 0.15);--mantine-color-blue-light-hover: rgba(116, 192, 252, 0.2);--mantine-color-blue-light-color: var(--mantine-color-blue-0);--mantine-color-blue-outline: var(--mantine-color-blue-1);--mantine-color-blue-outline-hover: rgba(208, 235, 255, 0.05);--mantine-color-cyan-filled: var(--mantine-color-cyan-5);--mantine-color-cyan-filled-hover: var(--mantine-color-cyan-6);--mantine-color-cyan-light: rgba(100, 218, 255, 0.15);--mantine-color-cyan-light-hover: rgba(100, 218, 255, 0.2);--mantine-color-cyan-light-color: var(--mantine-color-cyan-0);--mantine-color-cyan-outline: var(--mantine-color-cyan-1);--mantine-color-cyan-outline-hover: rgba(202, 245, 255, 0.05);--mantine-color-teal-filled: var(--mantine-color-teal-5);--mantine-color-teal-filled-hover: var(--mantine-color-teal-6);--mantine-color-teal-light: rgba(99, 230, 190, 0.15);--mantine-color-teal-light-hover: rgba(99, 230, 190, 0.2);--mantine-color-teal-light-color: var(--mantine-color-teal-0);--mantine-color-teal-outline: var(--mantine-color-teal-1);--mantine-color-teal-outline-hover: rgba(195, 250, 232, 0.05);--mantine-color-green-filled: var(--mantine-color-green-5);--mantine-color-green-filled-hover: var(--mantine-color-green-6);--mantine-color-green-light: rgba(134, 223, 148, 0.15);--mantine-color-green-light-hover: rgba(134, 223, 148, 0.2);--mantine-color-green-light-color: var(--mantine-color-green-0);--mantine-color-green-outline: var(--mantine-color-green-1);--mantine-color-green-outline-hover: rgba(215, 246, 220, 0.05);--mantine-color-lime-filled: var(--mantine-color-lime-5);--mantine-color-lime-filled-hover: var(--mantine-color-lime-6);--mantine-color-lime-light: rgba(192, 235, 117, 0.15);--mantine-color-lime-light-hover: rgba(192, 235, 117, 0.2);--mantine-color-lime-light-color: var(--mantine-color-lime-0);--mantine-color-lime-outline: var(--mantine-color-lime-1);--mantine-color-lime-outline-hover: rgba(233, 250, 200, 0.05);--mantine-color-yellow-filled: var(--mantine-color-yellow-5);--mantine-color-yellow-filled-hover: var(--mantine-color-yellow-6);--mantine-color-yellow-light: rgba(255, 201, 102, 0.15);--mantine-color-yellow-light-hover: rgba(255, 201, 102, 0.2);--mantine-color-yellow-light-color: var(--mantine-color-yellow-0);--mantine-color-yellow-outline: var(--mantine-color-yellow-1);--mantine-color-yellow-outline-hover: rgba(255, 238, 205, 0.05);--mantine-color-orange-filled: var(--mantine-color-orange-5);--mantine-color-orange-filled-hover: var(--mantine-color-orange-6);--mantine-color-orange-light: rgba(255, 192, 120, 0.15);--mantine-color-orange-light-hover: rgba(255, 192, 120, 0.2);--mantine-color-orange-light-color: var(--mantine-color-orange-0);--mantine-color-orange-outline: var(--mantine-color-orange-1);--mantine-color-orange-outline-hover: rgba(255, 232, 204, 0.05);--app-cta-gradient: linear-gradient(90deg, var(--mantine-color-blue-9) 0%, var(--mantine-color-cyan-7) 100%);--app-color-surface: #2e2e2e;}
:root[data-mantine-color-scheme="light"], :host([data-mantine-color-scheme="light"]){--mantine-color-anchor: var(--mantine-color-text);--mantine-color-dimmed: #495057;--mantine-color-red-light: rgba(224, 40, 41, 0.1);--mantine-color-red-light-hover: rgba(224, 40, 41, 0.12);--mantine-color-red-outline-hover: rgba(224, 40, 41, 0.05);--mantine-color-violet-light: rgba(176, 9, 255, 0.1);--mantine-color-violet-light-hover: rgba(176, 9, 255, 0.12);--mantine-color-violet-outline-hover: rgba(176, 9, 255, 0.05);--mantine-color-indigo-light: rgba(45, 42, 223, 0.1);--mantine-color-indigo-light-hover: rgba(45, 42, 223, 0.12);--mantine-color-indigo-outline-hover: rgba(45, 42, 223, 0.05);--mantine-color-cyan-light: rgba(0, 194, 255, 0.1);--mantine-color-cyan-light-hover: rgba(0, 194, 255, 0.12);--mantine-color-cyan-outline-hover: rgba(0, 194, 255, 0.05);--mantine-color-green-light: rgba(63, 204, 84, 0.1);--mantine-color-green-light-hover: rgba(63, 204, 84, 0.12);--mantine-color-green-outline-hover: rgba(63, 204, 84, 0.05);--mantine-color-yellow-light: rgba(255, 169, 15, 0.1);--mantine-color-yellow-light-hover: rgba(255, 169, 15, 0.12);--mantine-color-yellow-outline-hover: rgba(255, 169, 15, 0.05);--app-color-surface: #f1f3f5;--app-cta-gradient: linear-gradient(90deg, var(--mantine-color-blue-filled) 0%, var(--mantine-color-cyan-5) 100%);}</style><style data-mantine-styles="classes">@media (max-width: 35.99375em) {.mantine-visible-from-xs {display: none !important;}}@media (min-width: 36em) {.mantine-hidden-from-xs {display: none !important;}}@media (max-width: 47.99375em) {.mantine-visible-from-sm {display: none !important;}}@media (min-width: 48em) {.mantine-hidden-from-sm {display: none !important;}}@media (max-width: 61.99375em) {.mantine-visible-from-md {display: none !important;}}@media (min-width: 62em) {.mantine-hidden-from-md {display: none !important;}}@media (max-width: 74.99375em) {.mantine-visible-from-lg {display: none !important;}}@media (min-width: 75em) {.mantine-hidden-from-lg {display: none !important;}}@media (max-width: 87.99375em) {.mantine-visible-from-xl {display: none !important;}}@media (min-width: 88em) {.mantine-hidden-from-xl {display: none !important;}}</style><div style="position:absolute;top:0rem" class=""></div><div style="max-width:var(--container-size-xl);height:100%;min-height:0rem" class=""><style data-mantine-styles="inline">.__m__-_R_5ub_{--grid-gutter:0rem;}</style><div style="height:100%;min-height:0rem" class="m_410352e9 mantine-Grid-root __m__-_R_5ub_"><div class="m_dee7bd2f mantine-Grid-inner" style="height:100%"><style data-mantine-styles="inline">.__m__-_R_rdub_{--col-flex-grow:auto;--col-flex-basis:91.66666666666667%;--col-max-width:91.66666666666667%;}@media(min-width: 48em){.__m__-_R_rdub_{--col-flex-grow:auto;--col-flex-basis:83.33333333333334%;--col-max-width:83.33333333333334%;}}</style><div style="min-width:0rem;height:100%;min-height:0rem;display:flex" class="m_96bdd299 mantine-Grid-col __m__-_R_rdub_"><style data-mantine-styles="inline">.__m__-_R_6qrdub_{margin-top:0rem;padding-inline:var(--mantine-spacing-xs);width:100%;}@media(min-width: 48em){.__m__-_R_6qrdub_{margin-top:var(--mantine-spacing-xl);width:80%;}}@media(min-width: 62em){.__m__-_R_6qrdub_{padding-inline:var(--mantine-spacing-xl);}}</style><div style="margin-inline:auto;max-width:var(--mantine-breakpoint-xl)" class="__m__-_R_6qrdub_"><div style="color:var(--mantine-color-dimmed)" class="m_4451eb3a mantine-Center-root" data-inline="true"><div style="--ti-size:var(--ti-size-xs);--ti-bg:transparent;--ti-color:var(--mantine-color-indigo-light-color);--ti-bd:calc(0.0625rem * var(--mantine-scale)) solid transparent;margin-inline-end:calc(0.125rem * var(--mantine-scale));color:inherit" class="m_7341320d mantine-ThemeIcon-root" data-variant="transparent" data-size="xs"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-lock "><path d="M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6"></path><path d="M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0"></path><path d="M8 11v-4a4 4 0 1 1 8 0v4"></path></svg></div><p style="font-size:var(--mantine-font-size-sm)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">PHP: Построение абстракций</p></div><h1 style="--title-fw:var(--mantine-h1-font-weight);--title-lh:var(--mantine-h1-line-height);--title-fz:var(--mantine-h1-font-size);margin-bottom:var(--mantine-spacing-xl)" class="m_8a5d1357 mantine-Title-root" data-order="1">Теория: Функции первого класса и передача функций как аргументов</h1><script type="application/ld+json">{"@context":"https://schema.org","@type":"LearningResource","name":"Функции первого класса и передача функций как аргументов","inLanguage":"ru","isPartOf":{"@type":"LearningResource","name":"PHP: Построение абстракций"},"isAccessibleForFree":"False","hasPart":{"@type":"WebPageElement","isAccessibleForFree":"False","cssSelector":".paywalled"}}</script><div class=""><div style="--alert-color:var(--mantine-color-indigo-light-color);margin-bottom:var(--mantine-spacing-lg);font-size:var(--mantine-font-size-lg)" class="m_66836ed3 mantine-Alert-root" id="mantine-_R_remqrdub_" role="alert" aria-describedby="mantine-_R_remqrdub_-body" aria-labelledby="mantine-_R_remqrdub_-title"><div class="m_a5d60502 mantine-Alert-wrapper"><div class="m_667f2a6a mantine-Alert-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-rocket "><path d="M4 13a8 8 0 0 1 7 7a6 6 0 0 0 3 -5a9 9 0 0 0 6 -8a3 3 0 0 0 -3 -3a9 9 0 0 0 -8 6a6 6 0 0 0 -5 3"></path><path d="M7 14a6 6 0 0 0 -3 6a6 6 0 0 0 6 -3"></path><path d="M14 9a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"></path></svg></div><div class="m_667c2793 mantine-Alert-body"><div class="m_6a03f287 mantine-Alert-title"><span id="mantine-_R_remqrdub_-title" class="m_698f4f23 mantine-Alert-label">Полный доступ к материалам</span></div><div id="mantine-_R_remqrdub_-body" class="m_7fa78076 mantine-Alert-message"><div style="--group-gap:var(--mantine-spacing-md);--group-align:center;--group-justify:space-between;--group-wrap:wrap" class="m_4081bf90 mantine-Group-root"><p class="mantine-focus-auto m_b6d8b162 mantine-Text-root">Зарегистрируйтесь и получите доступ к этому и десяткам других курсов</p><a style="--button-height:var(--button-height-xs);--button-padding-x:var(--button-padding-x-xs);--button-fz:var(--mantine-font-size-xs);--button-bg:linear-gradient(45deg, var(--mantine-color-blue-filled) 0%, var(--mantine-color-cyan-filled) 100%);--button-hover:linear-gradient(45deg, var(--mantine-color-blue-filled) 0%, var(--mantine-color-cyan-filled) 100%);--button-color:var(--mantine-color-white);--button-bd:none" class="mantine-focus-auto mantine-active m_77c9d27d mantine-Button-root m_87cf2631 mantine-UnstyledButton-root" data-variant="gradient" data-size="xs" href="/u/new"><span class="m_80f1301b mantine-Button-inner"><span class="m_811560b9 mantine-Button-label">Зарегистрироваться</span></span></a></div></div></div></div></div><div class="paywalled m_d08caa0 mantine-Typography-root"><h2 id="heading-2-1">Поправки к видео</h2>
<div class="m_5cb1b9c8 mantine-CodeHighlightTabs-root"><div style="--sa-corner-width:0px;--sa-corner-height:0px" class="m_7b14120b mantine-CodeHighlightTabs-filesScrollarea m_d57069b5 mantine-ScrollArea-root" dir="ltr"><div style="overflow-x:hidden;overflow-y:hidden" class="m_c0783ff9 mantine-ScrollArea-viewport" data-scrollbars="xy"><div class="m_b1336c6 mantine-ScrollArea-content"><div class="m_38d99e51 mantine-CodeHighlightTabs-files"><button class="mantine-focus-auto m_5cac2e62 mantine-CodeHighlightTabs-file m_87cf2631 mantine-UnstyledButton-root" data-active="true" type="button"><span>php</span></button><button class="mantine-focus-auto m_5cac2e62 mantine-CodeHighlightTabs-file m_87cf2631 mantine-UnstyledButton-root" type="button"><span>php</span></button></div></div></div><div data-orientation="horizontal" class="m_c44ba933 mantine-ScrollArea-scrollbar" data-hidden="true" style="position:absolute;--sa-thumb-width:18px" data-mantine-scrollbar="true"></div><div class="m_c44ba933 mantine-ScrollArea-scrollbar" data-hidden="true" data-orientation="vertical" style="position:absolute;--sa-thumb-height:18px" data-mantine-scrollbar="true"></div></div><div style="margin-bottom:var(--mantine-spacing-lg)" class="m_e597c321 mantine-CodeHighlightTabs-codeHighlight" dir="ltr"><div class="m_be7e9c9c mantine-CodeHighlightTabs-controls" data-with-offset="true"><button style="--ai-bg:transparent;--ai-hover:transparent;--ai-color:inherit;--ai-bd:none" class="mantine-focus-auto mantine-active m_d498bab7 mantine-CodeHighlightTabs-control m_8d3f4000 mantine-ActionIcon-root m_87cf2631 mantine-UnstyledButton-root" data-variant="none" type="button" aria-label="Copy code"><span class="m_8d3afb97 mantine-ActionIcon-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"></path><path d="M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"></path></svg></span></button></div><div style="--scrollarea-scrollbar-size:calc(0.25rem * var(--mantine-scale));--sa-corner-width:0px;--sa-corner-height:0px" class="m_f744fd40 mantine-CodeHighlightTabs-scrollarea m_d57069b5 mantine-ScrollArea-root" dir="ltr"><div style="overflow-x:hidden;overflow-y:hidden;overscroll-behavior-inline:none" class="m_c0783ff9 mantine-ScrollArea-viewport" data-scrollbars="xy"><div class="m_b1336c6 mantine-ScrollArea-content"><pre class="m_2c47c4fd mantine-CodeHighlightTabs-pre" data-with-offset="true"><code class="m_5caae6d3 mantine-CodeHighlightTabs-code"><?php
$sumIntegers = function ($a, $b) use (&$sumIntegers) {
// ...
}</code></pre></div></div></div><button class="mantine-focus-auto m_c9378bc2 mantine-CodeHighlightTabs-showCodeButton m_87cf2631 mantine-UnstyledButton-root" data-hidden="true" type="button">Expand code</button></div></div></div><div style="margin-block:var(--mantine-spacing-xl)" class=""><h2 style="--title-fw:var(--mantine-h2-font-weight);--title-lh:var(--mantine-h2-line-height);--title-fz:var(--mantine-h2-font-size);margin-bottom:var(--mantine-spacing-md)" class="m_8a5d1357 mantine-Title-root" data-order="2">Рекомендуемые программы</h2><style data-mantine-styles="inline">.__m__-_R_2mremqrdub_{--carousel-slide-gap:var(--mantine-spacing-xs);--carousel-slide-size:70%;}@media(min-width: 36em){.__m__-_R_2mremqrdub_{--carousel-slide-gap:var(--mantine-spacing-xl);--carousel-slide-size:50%;}}</style><div style="--carousel-control-size:calc(2.5rem * var(--mantine-scale));--carousel-controls-offset:var(--mantine-spacing-sm);margin-bottom:var(--mantine-spacing-lg);padding-block:var(--mantine-spacing-sm);background:var(--app-color-surface)" class="m_17884d0f mantine-Carousel-root responsiveClassName" data-orientation="horizontal" data-include-gap-in-size="true"><div class="m_39bc3463 mantine-Carousel-controls" data-orientation="horizontal"><button class="mantine-focus-auto m_64f58e10 mantine-Carousel-control m_87cf2631 mantine-UnstyledButton-root" type="button" data-inactive="true" data-type="previous" tabindex="-1"><svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" style="transform:rotate(90deg);width:calc(1rem * var(--mantine-scale));height:calc(1rem * var(--mantine-scale));display:block"><path d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg></button><button class="mantine-focus-auto m_64f58e10 mantine-Carousel-control m_87cf2631 mantine-UnstyledButton-root" type="button" data-inactive="true" data-type="next" tabindex="-1"><svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" style="transform:rotate(-90deg);width:calc(1rem * var(--mantine-scale));height:calc(1rem * var(--mantine-scale));display:block"><path d="M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg></button></div><div class="m_a2dae653 mantine-Carousel-viewport" data-type="media"><div class="m_fcd81474 mantine-Carousel-container __m__-_R_2mremqrdub_" data-orientation="horizontal"><div class="m_d98df724 mantine-Carousel-slide" data-orientation="horizontal"><div tabindex="0" style="cursor:pointer;height:100%"><a style="text-decoration:none" class="mantine-focus-auto m_849cf0da m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" href="/programs/php-sicp?promo_name=programs_list&promo_position=course&promo_creative=catalog_card&promo_type=card" target="_blank"><div style="height:100%" class="m_e615b15f mantine-Card-root m_1b7284a3 mantine-Paper-root" data-with-border="true"><div style="--group-gap:calc(0.25rem * var(--mantine-scale));--group-align:center;--group-justify:flex-start;--group-wrap:nowrap" class="m_4081bf90 mantine-Group-root"><span style="font-size:var(--mantine-font-size-sm)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">1 месяц</span><span class="mantine-focus-auto m_b6d8b162 mantine-Text-root">·</span><span style="font-size:var(--mantine-font-size-sm)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">Для продвинутых</span></div><p style="margin-bottom:var(--mantine-spacing-sm);font-size:var(--mantine-font-size-h5);font-weight:bold" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">СИКП на PHP</p><p class="mantine-focus-auto m_b6d8b162 mantine-Text-root">Навык фундаментального понимания программ на PHP</p><div style="margin-top:auto" class=""><div class="m_4451eb3a mantine-Center-root"><img style="opacity:0.8;width:70%" class="m_9e117634 mantine-Image-root mantine-visible-from-xs" src="https://hexlet.io/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6Mzc2MywicHVyIjoiYmxvYl9pZCJ9fQ==--61c43d4881ca8feecc6f37dfafdc4e304f34b52f/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbNDAwLDQwMF0sInNhdmVyIjp7InF1YWxpdHkiOjg1fX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--5b6f46dacd1af664f27558553a58076185091823/Software%20engineer-bro.png" alt="СИКП на PHP" loading="eager"/></div><div style="--group-gap:var(--mantine-spacing-md);--group-align:end;--group-justify:space-between;--group-wrap:wrap;margin-top:var(--mantine-spacing-xs)" class="m_4081bf90 mantine-Group-root"><p style="font-size:var(--mantine-font-size-xl)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">от 3 900 ₽</p><p style="font-size:var(--mantine-font-size-sm)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">Посмотреть →</p></div></div></div></a></div></div><div class="m_d98df724 mantine-Carousel-slide" data-orientation="horizontal"><div tabindex="0" style="cursor:pointer;height:100%"><a style="text-decoration:none" class="mantine-focus-auto m_849cf0da m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" href="/programs/php-phpunit-testing?promo_name=programs_list&promo_position=course&promo_creative=catalog_card&promo_type=card" target="_blank"><div style="height:100%" class="m_e615b15f mantine-Card-root m_1b7284a3 mantine-Paper-root" data-with-border="true"><div style="--group-gap:calc(0.25rem * var(--mantine-scale));--group-align:center;--group-justify:flex-start;--group-wrap:nowrap" class="m_4081bf90 mantine-Group-root"><span style="font-size:var(--mantine-font-size-sm)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">4 месяца</span><span class="mantine-focus-auto m_b6d8b162 mantine-Text-root">·</span><span style="font-size:var(--mantine-font-size-sm)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">Для продвинутых</span></div><p style="margin-bottom:var(--mantine-spacing-sm);font-size:var(--mantine-font-size-h5);font-weight:bold" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">Автоматизация тестирования на PHP</p><p class="mantine-focus-auto m_b6d8b162 mantine-Text-root">Навык тестирования на PHP</p><div style="margin-top:auto" class=""><div class="m_4451eb3a mantine-Center-root"><img style="opacity:0.8;width:70%" class="m_9e117634 mantine-Image-root mantine-visible-from-xs" src="https://hexlet.io/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MzkzNSwicHVyIjoiYmxvYl9pZCJ9fQ==--06c469e64c9b6c8429a6a01edd20041dae30ce13/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJ3ZWJwIiwicmVzaXplX3RvX2xpbWl0IjpbNDAwLDQwMF0sInNhdmVyIjp7InF1YWxpdHkiOjg1fX0sInB1ciI6InZhcmlhdGlvbiJ9fQ==--5b6f46dacd1af664f27558553a58076185091823/Software%20code%20testing-bro.png" alt="Автоматизация тестирования на PHP" loading="eager"/></div><div style="--group-gap:var(--mantine-spacing-md);--group-align:end;--group-justify:space-between;--group-wrap:wrap;margin-top:var(--mantine-spacing-xs)" class="m_4081bf90 mantine-Group-root"><p style="font-size:var(--mantine-font-size-xl)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">от 3 900 ₽</p><p style="font-size:var(--mantine-font-size-sm)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">Посмотреть →</p></div></div></div></a></div></div><div class="m_d98df724 mantine-Carousel-slide" data-orientation="horizontal"><div tabindex="0" style="cursor:pointer;height:100%"><a style="text-decoration:none" class="mantine-focus-auto m_849cf0da m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" href="/courses?promo_name=programs_list&promo_position=course&promo_creative=catalog_card&promo_type=card"><div style="height:100%" class="m_e615b15f mantine-Card-root m_1b7284a3 mantine-Paper-root" data-with-border="true"><h2 style="--title-fw:var(--mantine-h2-font-weight);--title-lh:var(--mantine-h2-line-height);--title-fz:var(--mantine-h2-font-size);margin-bottom:var(--mantine-spacing-md);font-size:var(--mantine-font-size-h3)" class="m_8a5d1357 mantine-Title-root" data-order="2" data-responsive="true">Каталог</h2><p style="margin-bottom:auto" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">Полный список доступных курсов по разным направлениям</p><div style="margin-top:auto" class=""><div class="m_4451eb3a mantine-Center-root"><img style="opacity:0.8;width:70%" class="m_9e117634 mantine-Image-root mantine-visible-from-xs" src="/vite/assets/development-BVihs_d5.png" alt="Orientation"/></div></div></div></a></div></div></div></div></div></div></div></div></div><style data-mantine-styles="inline">.__m__-_R_1bdub_{--col-flex-grow:auto;--col-flex-basis:8.333333333333334%;--col-max-width:8.333333333333334%;}@media(min-width: 48em){.__m__-_R_1bdub_{--col-flex-grow:auto;--col-flex-basis:16.666666666666668%;--col-max-width:16.666666666666668%;}}</style><div style="min-width:0rem;height:100%;min-height:0rem" class="m_96bdd299 mantine-Grid-col __m__-_R_1bdub_"><div style="margin-inline:var(--mantine-spacing-xs)" class="mantine-visible-from-sm"><a style="--button-color:var(--mantine-color-white);margin-bottom:var(--mantine-spacing-lg);text-decoration:none" class="mantine-focus-auto m_849cf0da mantine-focus-auto m_77c9d27d mantine-Button-root m_87cf2631 mantine-UnstyledButton-root m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" href="/courses/php-sicp/lessons/first_class_as_args/finish_unit?unit=theory" data-disabled="true" data-block="true" disabled=""><span class="m_80f1301b mantine-Button-inner"><span class="m_811560b9 mantine-Button-label"><span style="margin-inline-end:var(--mantine-spacing-xs)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">Дальше</span>→</span></span></a><a style="padding-inline:0rem" class="mantine-focus-auto m_f0824112 mantine-NavLink-root m_87cf2631 mantine-UnstyledButton-root"><span class="m_690090b5 mantine-NavLink-section" data-position="left"><div style="--ti-size:var(--ti-size-sm);--ti-bg:transparent;--ti-color:var(--mantine-color-indigo-light-color);--ti-bd:calc(0.0625rem * var(--mantine-scale)) solid transparent;color:inherit" class="m_7341320d mantine-ThemeIcon-root" data-variant="transparent" data-size="sm"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-list-numbers "><path d="M11 6h9"></path><path d="M11 12h9"></path><path d="M12 18h8"></path><path d="M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4"></path><path d="M6 10v-6l-2 2"></path></svg></div></span><div class="m_f07af9d2 mantine-NavLink-body"><span class="m_1f6ac4c4 mantine-NavLink-label">Навигация по теме</span><span class="m_57492dcc mantine-NavLink-description">Теория</span></div><span class="m_690090b5 mantine-NavLink-section" data-position="right"></span></a><div style="margin-block:var(--mantine-spacing-lg)" class="m_3eebeb36 mantine-Divider-root" data-orientation="horizontal" role="separator"></div><div style="margin-block:var(--mantine-spacing-lg)" class=""><div style="justify-content:space-between;margin-bottom:calc(0.1875rem * var(--mantine-scale));color:var(--mantine-color-dimmed);font-size:var(--mantine-font-size-xs)" class="m_8bffd616 mantine-Flex-root __m__-_R_qimrbdub_"><p style="font-size:var(--mantine-font-size-xs)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">Завершено</p><p style="font-size:var(--mantine-font-size-xs)" class="mantine-focus-auto m_b6d8b162 mantine-Text-root">0 / 20</p></div><div style="--progress-size:var(--progress-size-sm)" class="m_db6d6462 mantine-Progress-root" data-size="sm"><div style="--progress-section-size:0%;--progress-section-color:var(--mantine-color-gray-filled)" class="m_2242eb65 mantine-Progress-section" role="progressbar" aria-valuemax="100" aria-valuemin="0" aria-valuenow="0" aria-valuetext="0%"></div></div></div><button style="padding-inline:0rem" class="mantine-focus-auto m_f0824112 mantine-NavLink-root m_87cf2631 mantine-UnstyledButton-root" type="button"><span class="m_690090b5 mantine-NavLink-section" data-position="left"><div style="--ti-size:var(--ti-size-sm);--ti-bg:transparent;--ti-color:var(--mantine-color-indigo-light-color);--ti-bd:calc(0.0625rem * var(--mantine-scale)) solid transparent;color:inherit" class="m_7341320d mantine-ThemeIcon-root" data-variant="transparent" data-size="sm"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-message "><path d="M8 9h8"></path><path d="M8 13h6"></path><path d="M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12"></path></svg></div></span><div class="m_f07af9d2 mantine-NavLink-body"><span class="m_1f6ac4c4 mantine-NavLink-label">Обсуждения (архив)</span><span class="m_57492dcc mantine-NavLink-description"></span></div></button><div style="--toc-bg:var(--mantine-color-blue-light);--toc-color:var(--mantine-color-blue-light-color);--toc-size:var(--mantine-font-size-sm);--toc-radius:var(--mantine-radius-sm);margin-top:var(--mantine-spacing-xl)" class="m_bcaa9990 mantine-TableOfContents-root" data-variant="light" data-size="sm"></div></div><div class="mantine-hidden-from-sm"><div style="--stack-gap:0rem;--stack-align:stretch;--stack-justify:flex-start" class="m_6d731127 mantine-Stack-root"><a style="--button-color:var(--mantine-color-white);margin-bottom:var(--mantine-spacing-xs);padding:0rem;text-decoration:none" class="mantine-focus-auto m_849cf0da mantine-focus-auto m_77c9d27d mantine-Button-root m_87cf2631 mantine-UnstyledButton-root m_b6d8b162 mantine-Text-root mantine-Anchor-root" data-underline="hover" href="/courses/php-sicp/lessons/first_class_as_args/finish_unit?unit=theory" data-disabled="true" data-block="true" disabled=""><span class="m_80f1301b mantine-Button-inner"><span class="m_811560b9 mantine-Button-label">→</span></span></a><button style="--ai-size:var(--ai-size-sm);--ai-bg:transparent;--ai-hover:var(--mantine-color-indigo-light-hover);--ai-color:var(--mantine-color-indigo-light-color);--ai-bd:calc(0.0625rem * var(--mantine-scale)) solid transparent;padding-block:var(--mantine-spacing-lg);color:inherit;width:100%" class="mantine-focus-auto m_8d3f4000 mantine-ActionIcon-root m_87cf2631 mantine-UnstyledButton-root" data-variant="subtle" data-size="sm" data-disabled="true" type="button" disabled=""><span class="m_8d3afb97 mantine-ActionIcon-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-list-numbers "><path d="M11 6h9"></path><path d="M11 12h9"></path><path d="M12 18h8"></path><path d="M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4"></path><path d="M6 10v-6l-2 2"></path></svg></span></button><button style="--ai-size:var(--ai-size-sm);--ai-bg:transparent;--ai-hover:var(--mantine-color-indigo-light-hover);--ai-color:var(--mantine-color-indigo-light-color);--ai-bd:calc(0.0625rem * var(--mantine-scale)) solid transparent;padding-block:var(--mantine-spacing-lg);color:inherit;width:100%" class="mantine-focus-auto mantine-active m_8d3f4000 mantine-ActionIcon-root m_87cf2631 mantine-UnstyledButton-root" data-variant="subtle" data-size="sm" type="button"><span class="m_8d3afb97 mantine-ActionIcon-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" class="tabler-icon tabler-icon-message "><path d="M8 9h8"></path><path d="M8 13h6"></path><path d="M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12"></path></svg></span></button></div></div></div></div></div></div></div>
</main>
<footer class="bg-dark fw-light text-light px-3 py-5">
<div class="row small">
<div class="col-12 col-sm-6 col-md-3">
<div class="h5 mb-3">Хекслет</div>
<ul class="list-unstyled">
<li>
<a class="nav-link link-light py-1 ps-0" href="/pages/about">О нас</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/testimonials">Отзывы</a>
</li>
<li>
<span class="nav-link link-light py-1 ps-0 external-link" data-href="https://b2b.hexlet.io" role="button">Корпоративное обучение</span>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/blog">Блог</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/qna">Вопросы и ответы</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/glossary">Глоссарий</a>
</li>
<li>
<span class="nav-link link-light py-1 ps-0 external-link" data-href="https://help.hexlet.io" data-target="_blank" role="button">Справка</span>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" target="_blank" rel="noopener noreferrer" href="/map">Карта сайта</a>
</li>
</ul>
</div>
<div class="col-12 col-sm-6 col-md-3">
<div class="h5 fw-normal mb-3">Направления</div>
<ul class="list-unstyled">
<li>
<a class="nav-link link-light py-1 ps-0" href="/courses_devops">DevOps
</a></li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/courses_data_analytics">Аналитика
</a></li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/courses_backend_development">Бэкенд
</a></li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/courses_programming">Программирование
</a></li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/courses_testing">Тестирование
</a></li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/courses_front_end_dev">Фронтенд
</a></li>
</ul>
</div>
<div class="col-12 col-sm-6 col-md-3">
<div class="h5">Профессии</div>
<ul class="list-unstyled">
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/devops-engineer-from-scratch">DevOps-инженер с нуля</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/go">Go-разработчик</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/java">Java-разработчик</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/python">Python-разработчик </a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/data-analytics">Аналитик данных</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/qa-engineer">Инженер по ручному тестированию</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/php">РНР-разработчик</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/frontend">Фронтенд-разработчик</a>
</li>
</ul>
</div>
<div class="col-12 col-sm-6 col-md-3">
<div class="h5">Навыки</div>
<ul class="list-unstyled">
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/python-django-developer">Django</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/docker">Docker</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/php-laravel-developer">Laravel</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/postman">Postman</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/js-react-developer">React</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/js-rest-api">REST API в Node.js</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/spring-boot">Spring Boot</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/programs/typescript">Typescript</a>
</li>
</ul>
</div>
</div>
<hr>
<div class="row">
<div class="col-12 col-sm-4 col-md-2">
<div class="fs-4">
<ul class="list-unstyled d-flex">
<li class="me-3">
<a aria-label="Telegram" target="_blank" class="link-light" rel="noopener noreferrer nofollow" href="https://t.me/hexlet_ru"><span class="bi bi-telegram"></span>
</a></li>
<li>
<a aria-label="Youtube" target="_blank" class="link-light" rel="noopener noreferrer nofollow" href="https://www.youtube.com/user/HexletUniversity"><span class="bi bi-youtube"></span>
</a></li>
</ul>
</div>
<div class="mb-2 d-flex flex-column">
<a class="link-light text-decoration-none" rel="nofollow" href="mailto:support@hexlet.io">support@hexlet.io</a>
<a class="link-light text-decoration-none py-2" target="_blank" href="https://t.me/hexlet_help_bot">t.me/hexlet_help_bot</a>
</div>
<ul class="list-unstyled d-flex">
<li class="me-3">
<span class="link-light text-decoration-none opacity-50 x-font-size-18 external-link" rel="nofollow" data-href="https://hexlet.io/locale/switch?new_locale=en" data-target="_self" role="button"><span class="my-auto">EN</span>
</span></li>
<li class="me-3">
<span class="link-light text-decoration-none opacity-50 x-font-size-18 opacity-100 external-link" rel="nofollow" data-href="https://ru.hexlet.io/locale/switch?new_locale=ru" data-target="_self" role="button"><span class="my-auto">RU</span>
</span></li>
<li class="me-3">
<span class="link-light text-decoration-none opacity-50 x-font-size-18 external-link" rel="nofollow" data-href="https://kz.hexlet.io/locale/switch?new_locale=kz" data-target="_self" role="button"><span class="my-auto">KZ</span>
</span></li>
</ul>
</div>
<div class="col-12 col-sm-4 col-md-3">
<ul class="list-unstyled fs-4">
<li class="mb-3">
<a class="link-light text-decoration-none" href="tel:8%20800%20100%2022%2047">8 800 100 22 47</a>
<span class="d-block opacity-50 small">бесплатно по РФ</span>
</li>
<li>
<a class="link-light text-decoration-none" href="tel:%2B7%20495%20085%2021%2062">+7 495 085 21 62</a>
<span class="d-block opacity-50 small">бесплатно по Москве</span>
</li>
</ul>
</div>
<div class="col-12 col-sm-4 col-md-3">
<div class="small mb-3">Образовательные услуги оказываются на основании Л035-01298-77/01989008 от 14.03.2025</div>
<ul class="list-unstyled small">
<li>
<a class="nav-link link-light py-1 ps-0" href="/pages/legal">Правовая информация</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/pages/offer">Оферта</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/pages/license">Лицензия</a>
</li>
<li>
<a class="nav-link link-light py-1 ps-0" href="/pages/contacts">Контакты</a>
</li>
</ul>
</div>
<div class="col-12 col-sm-12 col-md-4 small">
<div class="mb-2">
<div>ООО «<a href="/" class="text-decoration-none link-light">Хекслет Рус</a>»</div>
<div>108813 г. Москва, вн.тер.г. поселение Московский,</div>
<div>г. Московский, ул. Солнечная, д. 3А, стр. 1, помещ. 20Б/3</div>
<div>ОГРН 1217300010476</div>
<div>ИНН 7325174845</div>
</div>
<hr>
<div>АНО ДПО «<a href="/" class="text-decoration-none link-light">Учебный центр «Хекслет</a>»</div>
<div>119331 г. Москва, вн. тер. г. муниципальный округ</div>
<div>Ломоносовский, пр-кт Вернадского, д. 29</div>
<div>ОГРН 1247700712390</div>
<div>ИНН 7736364948</div>
</div>
</div>
</footer>
<div id="root-assistant-offcanvas"></div>
<script src="/vite/assets/assistant-Bukl1lYy.js" crossorigin="anonymous" type="module"></script><link rel="modulepreload" href="/vite/assets/chunk-DsPFFUou.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/init-BrRXra1y.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/ErrorFallbackBlock-naDSYSy9.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/MarkdownBlock-DbyKWoR_.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/gon-D3e4yh1x.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/mantine-CGMYrt2Y.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/shiki-V011pkdv.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/utils-DRqSHbQE.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/routes-CCH8ilKF.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/lib-XR8Qr8kR.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/dist-GCHh59xr.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/Box-B5-OOzBf.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/notifications.store-C-3AFSMn.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/useIsomorphicEffect-HJ6VK0D3.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/lib-KSp6QbZ0.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/axios-BEvgo0ym.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/classnames-l6ipYlLR.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/dayjs.min-BkKovM-s.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/debounce-jMQ_Cf4f.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/i18next-BlSq9s7B.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/client-U9M77rxp.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/react-dom-DaLxUz_h.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/useTranslation-Bx1Cdrkz.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/compiler-runtime-6XxiPFnt.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/jsx-runtime-CwjcCKJi.js" as="script" crossorigin="anonymous">
<link rel="modulepreload" href="/vite/assets/react-CkL4ZRHB.js" as="script" crossorigin="anonymous">
<script defer src="https://static.cloudflareinsights.com/beacon.min.js/v67327c56f0bb4ef8b305cae61679db8f1769101564043" integrity="sha512-rdcWY47ByXd76cbCFzznIcEaCN71jqkWBBqlwhF1SY7KubdLKZiEGeP7AyieKZlGP9hbY/MhGrwXzJC/HulNyg==" data-cf-beacon='{"version":"2024.11.0","token":"d11015b65d11429ea6b4a2ef37dd7e0b","server_timing":{"name":{"cfCacheStatus":true,"cfEdge":true,"cfExtPri":true,"cfL4":true,"cfOrigin":true,"cfSpeedBrain":true},"location_startswith":null}}' crossorigin="anonymous"></script>
</body>
</html>