{"id":258400,"date":"2015-06-01T15:21:02","date_gmt":"2015-06-01T11:21:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=258400"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=258400","title":{"rendered":"LINQ \u0434\u043b\u044f PHP: \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435"},"content":{"rendered":"<p>     \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/a88\/804\/a0d\/a88804a0d87bfaf21b6817ade48e772b.png\" align=\"right\"\/>\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0437\u043d\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 LINQ, \u0438 \u0437\u0430\u0447\u0435\u043c \u043e\u043d \u0441\u0434\u0430\u043b\u0441\u044f \u043d\u0430 PHP, \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 <a href=\"http:\/\/habrahabr.ru\/post\/229763\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u043e YaLinqo<\/a>.<\/p>\n<p>  \u0421 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c. \u0421\u0440\u0430\u0437\u0443 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u044e: \u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u2014 \u044d\u0442\u043e \u043d\u0435\u043d\u0443\u0436\u043d\u0430\u044f \u0448\u0442\u0443\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0437\u0430\u0447\u0435\u043c-\u0442\u043e \u043f\u0440\u0438\u0442\u0430\u0449\u0438\u043b\u0438 \u0432 PHP, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u0437-\u0437\u0430 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u043d\u043e\u0432\u043e\u043c\u043e\u0434\u043d\u044b\u0445 \u0448\u0442\u0443\u0447\u0435\u043a \u0441 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0437\u0432\u0435\u0440\u0441\u043a\u0438 \u043f\u0440\u043e\u0441\u0435\u0434\u0430\u0435\u0442, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043c\u0435\u0440\u044f\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434\u0443, \u0447\u0442\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043b\u0443\u0447\u0448\u0435 \u0441\u0442\u0430\u0440\u043e\u0433\u043e-\u0434\u043e\u0431\u0440\u043e\u0433\u043e for \u043d\u0435 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043d\u043e \u2014 \u0442\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u0435 \u043c\u0438\u043c\u043e. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0438 \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u0434\u043b\u044f \u0432\u0430\u0441.<\/p>\n<p>  \u0421 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c. LINQ \u2014 \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0441\u0435\u0434\u0430\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u0442 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f? \u0415\u0441\u043b\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0441 \u0433\u043e\u043b\u044b\u043c\u0438 \u0446\u0438\u043a\u043b\u0430\u043c\u0438, \u0442\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435 \u0440\u0430\u0437 \u0432 3-5. \u0415\u0441\u043b\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0434\u043b\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0442\u043e \u0440\u0430\u0437\u0430 \u0432 2-4. \u0422\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 (\u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u043c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u0435), \u0442\u043e \u043d\u0430 \u0434\u0435\u043b\u0435 \u0432 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0430\u0445 \u0432\u0441\u0435\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u043e\u0442\u0435\u0440\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435. \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c.<\/p>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <a href=\"https:\/\/github.com\/Athari\/YaLinqo\">YaLinqo<\/a> \u043d\u0430 \u0441\u0432\u0435\u0442 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u0435\u0449\u0451 \u0434\u0432\u0430 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f LINQ (\u0442\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u043b\u0435\u043d\u0438\u0432\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438), \u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u043f\u043e\u0437\u044b\u0432\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c. \u0421\u0430\u043c\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0438 \u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0435 \u2014 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u044d\u0442\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u0431\u0438\u0435\u043d\u0438\u0435\u043c \u043c\u043b\u0430\u0434\u0435\u043d\u0446\u0435\u0432, \u043a\u0430\u043a \u0432 <a href=\"http:\/\/habrahabr.ru\/post\/147612\/\">\u043f\u0440\u043e\u0448\u043b\u043e\u043c \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438<\/a>.<\/p>\n<p>  (\u0410 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043e\u0432 \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u043c\u043e\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043b\u043e \u043c\u0435\u043d\u044f \u0432\u044b\u043b\u043e\u0436\u0438\u0442\u044c <a href=\"http:\/\/athari.github.io\/YaLinqo\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e YaLinqo \u043e\u043d\u043b\u0430\u0439\u043d<\/a>.)<\/p>\n<p>  <i>\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440:<\/i> \u044d\u0442\u043e \u0442\u0435\u0441\u0442\u044b \u00ab\u043d\u0430 \u043a\u043e\u043b\u0435\u043d\u043a\u0435\u00bb. \u041e\u043d\u0438 \u043d\u0435 \u0434\u0430\u044e\u0442 \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u0442\u0435\u0440\u0438 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u044f \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438. \u041e\u0442\u0447\u0430\u0441\u0442\u0438 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044f \u043d\u0435 \u0437\u043d\u0430\u044e, \u043a\u0430\u043a \u044d\u0442\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u0415\u0441\u043b\u0438 \u0447\u0442\u043e, <a href=\"https:\/\/github.com\/Athari\/YaLinqoPerf\">pull requests are welcome<\/a>, \u0447\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>  <a name=\"habracut\"><\/a><b>\u041a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u044b<\/b><\/p>\n<p>  <a href=\"https:\/\/github.com\/Athari\/YaLinqo\"><b>YaLinqo<\/b><\/a> \u2014 <i>Yet Another LINQ to Objects for PHP<\/i>. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c: \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c \u0438 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c. \u0418\u043c\u0435\u0435\u0442 \u0434\u0432\u0435 \u0432\u0435\u0440\u0441\u0438\u0438: \u0434\u043b\u044f PHP 5.3+ (\u0431\u0435\u0437 yield) \u0438 \u0434\u043b\u044f PHP 5.5+ (\u0441 yield). \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430 yield \u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u0412 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u00ab\u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u043b\u044f\u043c\u0431\u0434\u044b\u00bb. \u0421\u0430\u043c\u0430\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u0430\u044f \u0438\u0437 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a: \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c 4 \u043a\u043b\u0430\u0441\u0441\u0430. \u0418\u0437 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u2014 \u0432\u0435\u0441\u044c\u043c\u0430 <a href=\"https:\/\/github.com\/Athari\/YaLinqoPerf\">\u043c\u0430\u0441\u0441\u0438\u0432\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f, \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0438\u0437 MSDN<\/a>.<\/p>\n<p>  <a href=\"https:\/\/github.com\/akanehara\/ginq\"><b>Ginq<\/b><\/a> \u2014 <i>&#8216;LINQ to Object&#8217; inspired DSL for PHP <\/i>. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c. \u041e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u0445 SPL, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u0445 PHP 5.3+. \u0412 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u00abproperty access\u00bb \u0438\u0437 Symfony. \u0421\u0440\u0435\u0434\u043d\u044f\u044f \u043f\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u043d\u043e\u0441\u0442\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430: \u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u043a\u043e\u043c\u043f\u0430\u0440\u0435\u0440\u044b, \u043f\u0430\u0440\u044b \u043a\u043b\u044e\u0447-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u043e\u0447\u0435\u0435 \u0434\u043e\u0431\u0440\u043e \u0438\u0437 .NET; \u0438\u0442\u043e\u0433\u043e 70 \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0441\u0440\u0435\u0434\u043d\u0435\u0439 \u043f\u0430\u0440\u0448\u0438\u0432\u043e\u0441\u0442\u0438: \u0432 \u043b\u0443\u0447\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b. \u0413\u043b\u0430\u0432\u043d\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u2014 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u044b, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0432\u0438\u0434\u0435 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432.<\/p>\n<p>  <a href=\"https:\/\/github.com\/TimeToogo\/Pinq\"><b>Pinq<\/b><\/a> \u2014 <i>PHP Integrated Query, a real LINQ library for PHP<\/i>. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438, \u0438 \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 (\u043d\u0443\u2026 <i>\u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438<\/i> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442). \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u043e \u0443\u043c\u0435\u0435\u0442 \u043f\u0430\u0440\u0441\u0438\u0442\u044c \u043a\u043e\u0434 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/github.com\/nikic\/PHP-Parser\">PHP-Parser<\/a>. \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043d\u0435 \u0441\u0430\u043c\u0430\u044f \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u0430\u044f (\u0435\u0441\u043b\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0435\u0441\u0442\u044c), \u043d\u043e \u0437\u0430\u0442\u043e \u0438\u043c\u0435\u0435\u0442 \u0441\u0438\u043c\u043f\u0430\u0442\u0438\u0447\u043d\u044b\u0439 \u0441\u0430\u0439\u0442\u0438\u043a. \u0421\u0430\u043c\u0430\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0438\u0437 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445: \u0431\u043e\u043b\u044c\u0448\u0435 500 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u044f 150 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0442\u0435\u0441\u0442\u043e\u0432 (\u0435\u0441\u043b\u0438 \u0447\u0435\u0441\u0442\u043d\u043e, \u0432 \u043a\u043e\u0434 \u044f \u0434\u0430\u0436\u0435 \u043d\u0435 \u043b\u0435\u0437, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u0442\u0440\u0430\u0448\u043d\u043e).<\/p>\n<p>  \u0423 \u0432\u0441\u0435\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0441 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0438 \u043f\u0440\u043e\u0447\u0438\u043c\u0438 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430\u043c\u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0432\u0441\u0451 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435. \u041b\u0438\u0446\u0435\u043d\u0437\u0438\u0438 \u043f\u0435\u0440\u043c\u0438\u0441\u0441\u0438\u0432\u043d\u044b\u0435: BSD, MIT. \u0412\u0441\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 Composer \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u0430 Packagist.<\/p>\n<p>  <b>\u0422\u0435\u0441\u0442\u044b<\/b><\/p>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0438 \u0434\u0430\u043b\u0435\u0435 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>benchmark_linq_groups<\/code> \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u043c\u0430\u0441\u0441\u0438\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439: \u0434\u043b\u044f \u0433\u043e\u043b\u043e\u0433\u043e PHP, YaLinqo, Ginq \u0438 Pinq, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p>  \u0422\u0435\u0441\u0442\u044b \u0433\u043e\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 PHP 5.5.14, Windows 7 SP1. \u0422\u0430\u043a \u043a\u0430\u043a \u0442\u0435\u0441\u0442\u044b \u00ab\u043d\u0430 \u043a\u043e\u043b\u0435\u043d\u043a\u0435\u00bb, \u0442\u043e \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0436\u0443 \u0441\u043f\u0435\u043a\u0438 \u0436\u0435\u043b\u0435\u0437\u0430 \u2014 \u0437\u0430\u0434\u0430\u0447\u0430 \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043f\u043e\u0442\u0435\u0440\u0438 \u043d\u0430 \u0433\u043b\u0430\u0437, \u0430 \u043d\u0435 \u0438\u0437\u043c\u0435\u0440\u0438\u0442\u044c \u0432\u0441\u0451 \u0434\u043e \u043c\u0438\u043b\u043b\u0438\u043c\u0435\u0442\u0440\u0430. \u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u0442\u043e\u0447\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432, \u0442\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435, \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u043b\u0443\u0447\u0448\u0430\u0442\u044c, \u043f\u0443\u043b\u043b-\u0440\u0435\u043a\u0432\u0435\u0441\u0442\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f.<\/p>\n<p>  \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043f\u043b\u043e\u0445\u043e\u0433\u043e \u2014 \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u043e\u0432\u0435\u0440\u0445\u0435\u0434\u0430.<\/p>\n<pre><code class=\"php\">benchmark_linq_groups(&quot;Iterating over $ITER_MAX ints&quot;, 100, null,     [         &quot;for&quot; =&gt; function () use ($ITER_MAX) {             $j = null;             for ($i = 0; $i &lt; $ITER_MAX; $i++)                 $j = $i;             return $j;         },         &quot;array functions&quot; =&gt; function () use ($ITER_MAX) {             $j = null;             foreach (range(0, $ITER_MAX - 1) as $i)                 $j = $i;             return $j;         },     ],     [         function () use ($ITER_MAX) {             $j = null;             foreach (E::range(0, $ITER_MAX) as $i)                 $j = $i;             return $j;         },     ],     [         function () use ($ITER_MAX) {             $j = null;             foreach (G::range(0, $ITER_MAX - 1) as $i)                 $j = $i;             return $j;         },     ],     [         function () use ($ITER_MAX) {             $j = null;             foreach (P::from(range(0, $ITER_MAX - 1)) as $i)                 $j = $i;             return $j;         },     ]);<\/code><\/pre>\n<p>  \u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0449\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>range<\/code> \u0432 Pinq \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442, \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439. \u0427\u0442\u043e, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043c\u044b \u0438 \u0434\u0435\u043b\u0430\u0435\u043c.<\/p>\n<p>  \u0418 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/p>\n<pre>Iterating over 1000 ints ------------------------   PHP     [for]               0.00006 sec   x1.0 (100%)   PHP     [array functions]   0.00011 sec   x1.8 (+83%)   YaLinqo                     0.00041 sec   x6.8 (+583%)   Ginq                        0.00075 sec   x12.5 (+1150%)   Pinq                        0.00169 sec   x28.2 (+2717%)<\/pre>\n<p>  \u0418\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u043d\u0435\u0449\u0430\u0434\u043d\u043e \u0441\u044a\u0435\u0434\u0430\u044e\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c.<\/p>\n<p>  \u041d\u043e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0441\u0438\u043b\u044c\u043d\u0435\u0435 \u0431\u0440\u043e\u0441\u0430\u0435\u0442\u0441\u044f \u0432 \u0433\u043b\u0430\u0437\u0430 \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0435\u0434\u0430\u043d\u0438\u0435 \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0443 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u2014 \u0432 30 \u0440\u0430\u0437. \u0414\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u0442\u044c: \u044d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0435\u0449\u0451 \u0443\u0441\u043f\u0435\u0435\u0442 \u043f\u043e\u043f\u0443\u0433\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u0430\u043c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443\u0434\u0438\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0440\u0430\u043d\u043e.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b.<\/p>\n<pre><code class=\"php\">benchmark_linq_groups(&quot;Generating array of $ITER_MAX integers&quot;, 100, 'consume',     [         &quot;for&quot; =&gt;             function () use ($ITER_MAX) {                 $a = [ ];                 for ($i = 0; $i &lt; $ITER_MAX; $i++)                     $a[] = $i;                 return $a;             },         &quot;array functions&quot; =&gt;             function () use ($ITER_MAX) {                 return range(0, $ITER_MAX - 1);             },     ],     [         function () use ($ITER_MAX) {             return E::range(0, $ITER_MAX)-&gt;toArray();         },     ],     [         function () use ($ITER_MAX) {             return G::range(0, $ITER_MAX - 1)-&gt;toArray();         },     ],     [         function () use ($ITER_MAX) {             return P::from(range(0, $ITER_MAX - 1))-&gt;asArray();         },     ]);<\/code><\/pre>\n<p>  \u0418 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/p>\n<pre>Generating array of 1000 integers ---------------------------------   PHP     [for]               0.00025 sec   x1.3 (+32%)   PHP     [array functions]   0.00019 sec   x1.0 (100%)   YaLinqo                     0.00060 sec   x3.2 (+216%)   Ginq                        0.00107 sec   x5.6 (+463%)   Pinq                        0.00183 sec   x9.6 (+863%)<\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c YaLinqo \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432 \u043b\u043e\u0431 \u043d\u0430 \u0446\u0438\u043a\u043b\u0435. \u0423 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u043e\u0445\u0443\u0436\u0435, \u043d\u043e \u0436\u0438\u0442\u044c \u043c\u043e\u0436\u043d\u043e.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0439\u043c\u0451\u043c\u0441\u044f \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u043e\u043c \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445: \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0437\u0430\u043a\u0430\u0437\u044b \u0441 \u0431\u043e\u043b\u0435\u0435, \u0447\u0435\u043c \u043f\u044f\u0442\u044c\u044e \u043f\u0443\u043d\u043a\u0442\u0430\u043c\u0438 \u0437\u0430\u043a\u0430\u0437\u0430; \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0437\u0430\u043a\u0430\u0437\u044b, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u043e\u043b\u0435\u0435 \u0434\u0432\u0443\u0445 \u043f\u0443\u043d\u043a\u0442\u043e\u0432 \u0441 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0431\u043e\u043b\u0435\u0435 \u043f\u044f\u0442\u0438.<\/p>\n<pre><code class=\"php\">benchmark_linq_groups(&quot;Counting values in arrays&quot;, 100, null,     [         &quot;for&quot; =&gt; function () use ($DATA) {             $numberOrders = 0;             foreach ($DATA-&gt;orders as $order) {                 if (count($order['items']) &gt; 5)                     $numberOrders++;             }             return $numberOrders;         },         &quot;array functions&quot; =&gt; function () use ($DATA) {             return count(                 array_filter(                     $DATA-&gt;orders,                     function ($order) { return count($order['items']) &gt; 5; }                 )             );         },     ],     [         function () use ($DATA) {             return E::from($DATA-&gt;orders)                 -&gt;count(function ($order) { return count($order['items']) &gt; 5; });         },         &quot;string lambda&quot; =&gt; function () use ($DATA) {             return E::from($DATA-&gt;orders)                 -&gt;count('$o ==&gt; count($o[&quot;items&quot;]) &gt; 5');         },     ],     [         function () use ($DATA) {             return G::from($DATA-&gt;orders)                 -&gt;count(function ($order) { return count($order['items']) &gt; 5; });         },     ],     [         function () use ($DATA) {             return P::from($DATA-&gt;orders)                 -&gt;where(function ($order) { return count($order['items']) &gt; 5; })                 -&gt;count();         },     ]);  benchmark_linq_groups(&quot;Counting values in arrays deep&quot;, 100, null,     [         &quot;for&quot; =&gt; function () use ($DATA) {             $numberOrders = 0;             foreach ($DATA-&gt;orders as $order) {                 $numberItems = 0;                 foreach ($order['items'] as $item) {                     if ($item['quantity'] &gt; 5)                         $numberItems++;                 }                 if ($numberItems &gt; 2)                     $numberOrders++;             }             return $numberOrders;         },         &quot;array functions&quot; =&gt; function () use ($DATA) {             return count(                 array_filter(                     $DATA-&gt;orders,                     function ($order) {                         return count(                             array_filter(                                 $order['items'],                                 function ($item) { return $item['quantity'] &gt; 5; }                             )                         ) &gt; 2;                     })             );         },     ],     [         function () use ($DATA) {             return E::from($DATA-&gt;orders)                 -&gt;count(function ($order) {                     return E::from($order['items'])                         -&gt;count(function ($item) { return $item['quantity'] &gt; 5; }) &gt; 2;                 });         },     ],     [         function () use ($DATA) {             return G::from($DATA-&gt;orders)                 -&gt;count(function ($order) {                     return G::from($order['items'])                         -&gt;count(function ($item) { return $item['quantity'] &gt; 5; }) &gt; 2;                 });         },     ],     [         function () use ($DATA) {             return P::from($DATA-&gt;orders)                 -&gt;where(function ($order) {                     return P::from($order['items'])                         -&gt;where(function ($item) { return $item['quantity'] &gt; 5; })                         -&gt;count() &gt; 2;                 })                 -&gt;count();         },     ]);<\/code><\/pre>\n<p>  \u0417\u0430\u043c\u0435\u0442\u043d\u043e \u0442\u0440\u0438 \u043d\u044e\u0430\u043d\u0441\u0430. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0438\u043b\u044c \u043d\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 \u0434\u043b\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u0434 \u0432 \u0437\u0430\u0431\u0430\u0432\u043d\u0443\u044e \u043d\u0435\u0447\u0438\u0442\u0430\u0435\u043c\u0443\u044e \u043b\u0435\u0441\u0435\u043d\u043a\u0443. \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u043c\u0438 \u043b\u044f\u043c\u0431\u0434\u0430\u043c\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0443\u0434\u0430\u0451\u0442\u0441\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u2014 \u044d\u0442\u043e \u0432\u044b\u043d\u043e\u0441 \u043c\u043e\u0437\u0433\u0430. \u0412-\u0442\u0440\u0435\u0442\u044c\u0438\u0445, Pinq \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>count<\/code>, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0439 \u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u041a\u0430\u043a \u043f\u043e\u0437\u0436\u0435 \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u0441\u044f, \u044d\u0442\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 Pinq: \u0432 \u043d\u0435\u0439 \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u043e\u043d\u0438 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b.<\/p>\n<p>  \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/p>\n<pre>Counting values in arrays -------------------------   PHP     [for]               0.00023 sec   x1.0 (100%)   PHP     [array functions]   0.00052 sec   x2.3 (+126%)   YaLinqo                     0.00056 sec   x2.4 (+143%)   YaLinqo [string lambda]     0.00059 sec   x2.6 (+157%)   Ginq                        0.00129 sec   x5.6 (+461%)   Pinq                        0.00382 sec   x16.6 (+1561%)  Counting values in arrays deep ------------------------------   PHP     [for]               0.00064 sec   x1.0 (100%)   PHP     [array functions]   0.00323 sec   x5.0 (+405%)   YaLinqo                     0.00798 sec   x12.5 (+1147%)   Ginq                        0.01416 sec   x22.1 (+2113%)   Pinq                        0.04928 sec   x77.0 (+7600%)<\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0443\u0433\u0430\u044e\u0449\u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 Pinq. \u042f \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043a\u043e\u0434. \u0422\u0430\u043c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u0441\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f, \u0430 \u043f\u043e\u0442\u043e\u043c \u043d\u0430 \u043d\u0435\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>count()<\/code>\u2026 \u041d\u043e \u0443\u0434\u0438\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0432\u0441\u0451 \u0435\u0449\u0451 \u0440\u0430\u043d\u043e!<\/p>\n<p>  \u0417\u0430\u0439\u043c\u0451\u043c\u0441\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0435\u0439. \u0412\u0441\u0451 \u043a\u0430\u043a \u0432 \u043f\u0440\u043e\u0448\u043b\u044b\u0439 \u0440\u0430\u0437, \u043d\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438.<\/p>\n<pre><code class=\"php\">benchmark_linq_groups(&quot;Filtering values in arrays&quot;, 100, 'consume',     [         &quot;for&quot; =&gt; function () use ($DATA) {             $filteredOrders = [ ];             foreach ($DATA-&gt;orders as $order) {                 if (count($order['items']) &gt; 5)                     $filteredOrders[] = $order;             }             return $filteredOrders;         },         &quot;array functions&quot; =&gt; function () use ($DATA) {             return array_filter(                 $DATA-&gt;orders,                 function ($order) { return count($order['items']) &gt; 5; }             );         },     ],     [         function () use ($DATA) {             return E::from($DATA-&gt;orders)                 -&gt;where(function ($order) { return count($order['items']) &gt; 5; });         },         &quot;string lambda&quot; =&gt; function () use ($DATA) {             return E::from($DATA-&gt;orders)                 -&gt;where('$order ==&gt; count($order[&quot;items&quot;]) &gt; 5');         },     ],     [         function () use ($DATA) {             return G::from($DATA-&gt;orders)                 -&gt;where(function ($order) { return count($order['items']) &gt; 5; });         },     ],     [         function () use ($DATA) {             return P::from($DATA-&gt;orders)                 -&gt;where(function ($order) { return count($order['items']) &gt; 5; });         },     ]);  benchmark_linq_groups(&quot;Filtering values in arrays deep&quot;, 100,     function ($e) { consume($e, [ 'items' =&gt; null ]); },     [         &quot;for&quot; =&gt; function () use ($DATA) {             $filteredOrders = [ ];             foreach ($DATA-&gt;orders as $order) {                 $filteredItems = [ ];                 foreach ($order['items'] as $item) {                     if ($item['quantity'] &gt; 5)                         $filteredItems[] = $item;                 }                 if (count($filteredItems) &gt; 0) {                     $order['items'] = $filteredItems;                     $filteredOrders[] = [                         'id' =&gt; $order['id'],                         'items' =&gt; $filteredItems,                     ];                 }             }             return $filteredOrders;         },         &quot;array functions&quot; =&gt; function () use ($DATA) {             return array_filter(                 array_map(                     function ($order) {                         return [                             'id' =&gt; $order['id'],                             'items' =&gt; array_filter(                                 $order['items'],                                 function ($item) { return $item['quantity'] &gt; 5; }                             )                         ];                     },                     $DATA-&gt;orders                 ),                 function ($order) {                     return count($order['items']) &gt; 0;                 }             );         },     ],     [         function () use ($DATA) {             return E::from($DATA-&gt;orders)                 -&gt;select(function ($order) {                     return [                         'id' =&gt; $order['id'],                         'items' =&gt; E::from($order['items'])                             -&gt;where(function ($item) { return $item['quantity'] &gt; 5; })                             -&gt;toArray()                     ];                 })                 -&gt;where(function ($order) {                     return count($order['items']) &gt; 0;                 });         },         &quot;string lambda&quot; =&gt; function () use ($DATA) {             return E::from($DATA-&gt;orders)                 -&gt;select(function ($order) {                     return [                         'id' =&gt; $order['id'],                         'items' =&gt; E::from($order['items'])-&gt;where('$v[&quot;quantity&quot;] &gt; 5')-&gt;toArray()                     ];                 })                 -&gt;where('count($v[&quot;items&quot;]) &gt; 0');         },     ],     [         function () use ($DATA) {             return G::from($DATA-&gt;orders)                 -&gt;select(function ($order) {                     return [                         'id' =&gt; $order['id'],                         'items' =&gt; G::from($order['items'])                             -&gt;where(function ($item) { return $item['quantity'] &gt; 5; })                             -&gt;toArray()                     ];                 })                 -&gt;where(function ($order) {                     return count($order['items']) &gt; 0;                 });         },     ],     [         function () use ($DATA) {             return P::from($DATA-&gt;orders)                 -&gt;select(function ($order) {                     return [                         'id' =&gt; $order['id'],                         'items' =&gt; P::from($order['items'])                             -&gt;where(function ($item) { return $item['quantity'] &gt; 5; })                             -&gt;asArray()                     ];                 })                 -&gt;where(function ($order) {                     return count($order['items']) &gt; 0;                 });         },     ]);<\/code><\/pre>\n<p>  \u041a\u043e\u0434 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 \u0434\u043b\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0443\u0436\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u043f\u043e\u043f\u0430\u0445\u0438\u0432\u0430\u0442\u044c. \u041d\u0435 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443 <code>array_map<\/code> \u0438 <code>array_filter<\/code> \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432 \u0440\u0430\u0437\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0441\u043b\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442.<\/p>\n<p>  \u041a\u043e\u0434 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u043c\u0435\u043d\u0435\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439: \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u043f\u043e\u0442\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u043d\u044b. \u042d\u0442\u043e, \u0432 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e, \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u044f LINQ, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043e \u043f\u0443\u0442\u0438 \u00ab\u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432\u00bb \u0441 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u043c\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439.<\/p>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u0435\u0441\u043b\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0440\u043e\u0432\u043d\u044b\u0435:<\/p>\n<pre>Filtering values in arrays --------------------------   PHP     [for]               0.00049 sec   x1.0 (100%)   PHP     [array functions]   0.00072 sec   x1.5 (+47%)   YaLinqo                     0.00094 sec   x1.9 (+92%)   YaLinqo [string lambda]     0.00094 sec   x1.9 (+92%)   Ginq                        0.00295 sec   x6.0 (+502%)   Pinq                        0.00328 sec   x6.7 (+569%)  Filtering values in arrays deep -------------------------------   PHP     [for]               0.00514 sec   x1.0 (100%)   PHP     [array functions]   0.00739 sec   x1.4 (+44%)   YaLinqo                     0.01556 sec   x3.0 (+203%)   YaLinqo [string lambda]     0.01750 sec   x3.4 (+240%)   Ginq                        0.03101 sec   x6.0 (+503%)   Pinq                        0.05435 sec   x10.6 (+957%)<\/pre>\n<p>  \u041f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0435:<\/p>\n<pre><code class=\"php\">benchmark_linq_groups(&quot;Sorting arrays&quot;, 100, 'consume',     [         function () use ($DATA) {             $orderedUsers = $DATA-&gt;users;             usort(                 $orderedUsers,                 function ($a, $b) {                     $diff = $a['rating'] - $b['rating'];                     if ($diff !== 0)                         return -$diff;                     $diff = strcmp($a['name'], $b['name']);                     if ($diff !== 0)                         return $diff;                     $diff = $a['id'] - $b['id'];                     return $diff;                 });             return $orderedUsers;         },     ],     [         function () use ($DATA) {             return E::from($DATA-&gt;users)                 -&gt;orderByDescending(function ($u) { return $u['rating']; })                 -&gt;thenBy(function ($u) { return $u['name']; })                 -&gt;thenBy(function ($u) { return $u['id']; });         },         &quot;string lambda&quot; =&gt; function () use ($DATA) {             return E::from($DATA-&gt;users)-&gt;orderByDescending('$v[&quot;rating&quot;]')-&gt;thenBy('$v[&quot;name&quot;]')-&gt;thenBy('$v[&quot;id&quot;]');         },     ],     [         function () use ($DATA) {             return G::from($DATA-&gt;users)                 -&gt;orderByDesc(function ($u) { return $u['rating']; })                 -&gt;thenBy(function ($u) { return $u['name']; })                 -&gt;thenBy(function ($u) { return $u['id']; });         },         &quot;property path&quot; =&gt; function () use ($DATA) {             return G::from($DATA-&gt;users)-&gt;orderByDesc('[rating]')-&gt;thenBy('[name]')-&gt;thenBy('[id]');         },     ],     [         function () use ($DATA) {             return P::from($DATA-&gt;users)                 -&gt;orderByDescending(function ($u) { return $u['rating']; })                 -&gt;thenByAscending(function ($u) { return $u['name']; })                 -&gt;thenByAscending(function ($u) { return $u['id']; });         },     ]);<\/code><\/pre>\n<p>  \u041a\u043e\u0434 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0449\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f <code>usort<\/code> \u0441\u0442\u0440\u0430\u0448\u043d\u0435\u043d\u044c\u043a\u0438\u0439, \u043d\u043e, \u043f\u0440\u0438\u043d\u043e\u0440\u043e\u0432\u0438\u0432\u0448\u0438\u0441\u044c, \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u0435 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u044f\u0441\u044c. \u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e LINQ \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u0447\u0438\u0441\u0442\u043e. \u0422\u0430\u043a\u0436\u0435 \u044d\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0435\u043b\u0435\u0441\u0442\u044f\u043c\u0438 \u00ab\u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u00bb \u0432 Ginq \u2014 \u043a\u0440\u0430\u0441\u0438\u0432\u0435\u0435 \u043a\u043e\u0434 \u0443\u0436\u0435 \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0443\u0434\u0438\u0432\u043b\u044f\u044e\u0442:<\/p>\n<pre>Sorting arrays --------------   PHP                         0.00037 sec   x1.0 (100%)   YaLinqo                     0.00161 sec   x4.4 (+335%)   YaLinqo [string lambda]     0.00163 sec   x4.4 (+341%)   Ginq                        0.00402 sec   x10.9 (+986%)   Ginq    [property path]     0.01998 sec   x54.0 (+5300%)   Pinq                        0.00132 sec   x3.6 (+257%)<\/pre>\n<p>  \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, Pinq \u0432\u044b\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043f\u0435\u0440\u0451\u0434, \u0445\u043e\u0442\u044c \u0438 \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u0421\u043f\u043e\u0439\u043b\u0435\u0440: \u044d\u0442\u043e \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0440\u0430\u0437.<\/p>\n<p>  \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c \u0432 Ginq \u0443\u0436\u0430\u0441\u0430\u044e\u0449\u0435 \u043f\u0440\u043e\u0441\u0430\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u044d\u0442\u043e\u0439 \u0444\u0438\u0447\u0435\u0439 \u0443\u0436\u0435 \u043d\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0448\u044c\u0441\u044f. \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0442\u0435\u0440\u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0432 50 \u0440\u0430\u0437.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0432\u0435\u0441\u0451\u043b\u043e\u043c\u0443 \u2014 \u043a \u0434\u0436\u043e\u0439\u043d\u0430\u043c, \u0430\u043a\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044e \u0434\u0432\u0443\u0445 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 \u043f\u043e \u043a\u043b\u044e\u0447\u0443.<\/p>\n<pre><code class=\"php\">benchmark_linq_groups(&quot;Joining arrays&quot;, 100, 'consume',     [         function () use ($DATA) {             $usersByIds = [ ];             foreach ($DATA-&gt;users as $user)                 $usersByIds[$user['id']][] = $user;             $pairs = [ ];             foreach ($DATA-&gt;orders as $order) {                 $id = $order['customerId'];                 if (isset($usersByIds[$id])) {                     foreach ($usersByIds[$id] as $user) {                         $pairs[] = [                             'order' =&gt; $order,                             'user' =&gt; $user,                         ];                     }                 }             }             return $pairs;         },     ],     [         function () use ($DATA) {             return E::from($DATA-&gt;orders)                 -&gt;join($DATA-&gt;users,                     function ($o) { return $o['customerId']; },                     function ($u) { return $u['id']; },                     function ($o, $u) {                         return [                             'order' =&gt; $o,                             'user' =&gt; $u,                         ];                     });         },         &quot;string lambda&quot; =&gt; function () use ($DATA) {             return E::from($DATA-&gt;orders)                 -&gt;join($DATA-&gt;users,                     '$o ==&gt; $o[&quot;customerId&quot;]', '$u ==&gt; $u[&quot;id&quot;]',                     '($o, $u) ==&gt; [                         &quot;order&quot; =&gt; $o,                         &quot;user&quot; =&gt; $u,                     ]');         },     ],     [         function () use ($DATA) {             return G::from($DATA-&gt;orders)                 -&gt;join($DATA-&gt;users,                     function ($o) { return $o['customerId']; },                     function ($u) { return $u['id']; },                     function ($o, $u) {                         return [                             'order' =&gt; $o,                             'user' =&gt; $u,                         ];                     });         },         &quot;property path&quot; =&gt; function () use ($DATA) {             return G::from($DATA-&gt;orders)                 -&gt;join($DATA-&gt;users,                     '[customerId]', '[id]',                     function ($o, $u) {                         return [                             'order' =&gt; $o,                             'user' =&gt; $u,                         ];                     });         },     ],     [         function () use ($DATA) {             return P::from($DATA-&gt;orders)                 -&gt;join($DATA-&gt;users)                 -&gt;onEquality(                     function ($o) { return $o['customerId']; },                     function ($u) { return $u['id']; }                 )                 -&gt;to(function ($o, $u) {                     return [                         'order' =&gt; $o,                         'user' =&gt; $u,                     ];                 });         },     ]);<\/code><\/pre>\n<p>  \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u0434\u0435\u043b\u0438\u043b\u0430\u0441\u044c Pinq, \u0433\u0434\u0435 \u043e\u0434\u043d\u0430 \u043f\u043e \u0441\u0443\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0430 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0437\u043e\u0432\u043e\u0432. \u041f\u043e\u0436\u0430\u043b\u0443\u0439, \u0442\u0430\u043a \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u043e, \u043d\u043e \u0434\u043b\u044f \u043f\u0440\u0438\u0432\u044b\u043a\u0448\u0438\u0445 \u043a \u0446\u0435\u043f\u043e\u0447\u043a\u0430\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0432 LINQ \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u0435\u043d\u0435\u0435 \u043f\u0440\u0438\u0432\u044b\u0447\u0435\u043d.<\/p>\n<p>  \u0418\u2026 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/p>\n<pre>Joining arrays --------------   PHP                         0.00021 sec   x1.0 (100%)   YaLinqo                     0.00065 sec   x3.1 (+210%)   YaLinqo [string lambda]     0.00070 sec   x3.3 (+233%)   Ginq                        0.00103 sec   x4.9 (+390%)   Ginq    [property path]     0.00200 sec   x9.5 (+852%)   Pinq                        1.24155 sec   x5,911.8 (+591084%)<\/pre>\n<p>  \u041d\u0435\u0442, \u0437\u0434\u0435\u0441\u044c \u043d\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0438. Pinq \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0431\u0438\u0432\u0430\u0435\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432 \u0448\u0435\u0441\u0442\u044c \u0442\u044b\u0441\u044f\u0447 \u0440\u0430\u0437. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u043e\u0432\u0438\u0441, \u043d\u043e \u0432 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u043d\u0446\u043e\u0432 \u043e\u043d \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0441\u044f, \u0438 \u0432\u044b\u0434\u0430\u043b \u044d\u0442\u043e \u043d\u0435\u0432\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u043c\u043e\u0435 \u0447\u0438\u0441\u043b\u043e. \u042f \u043d\u0435 \u043d\u0430\u0448\u0451\u043b, \u0433\u0434\u0435 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445 Pinq \u043a\u043e\u0434 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043d\u043e \u0443 \u043c\u0435\u043d\u044f \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0442\u0430\u043c for-for-if \u0431\u0435\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432-\u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439. \u0412\u043e\u0442 \u0432\u0430\u043c \u0438 \u041e\u041e\u041f.<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0442\u0435\u0441\u0442 \u2014 \u0430\u0433\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044e (\u0438\u043b\u0438 \u0430\u043a\u043a\u0443\u043c\u0443\u043b\u044f\u0446\u0438\u044e, \u0438\u043b\u0438 \u0441\u0432\u0451\u0440\u0442\u043a\u0443 \u2014 \u043a\u0430\u043a \u0443\u0433\u043e\u0434\u043d\u043e):<\/p>\n<pre><code class=\"php\">benchmark_linq_groups(&quot;Aggregating arrays&quot;, 100, null,     [         &quot;for&quot; =&gt; function () use ($DATA) {             $sum = 0;             foreach ($DATA-&gt;products as $p)                 $sum += $p['quantity'];             $avg = 0;             foreach ($DATA-&gt;products as $p)                 $avg += $p['quantity'];             $avg \/= count($DATA-&gt;products);             $min = PHP_INT_MAX;             foreach ($DATA-&gt;products as $p)                 $min = min($min, $p['quantity']);             $max = -PHP_INT_MAX;             foreach ($DATA-&gt;products as $p)                 $max = max($max, $p['quantity']);             return &quot;$sum-$avg-$min-$max&quot;;         },         &quot;array functions&quot; =&gt; function () use ($DATA) {             $sum = array_sum(array_map(function ($p) { return $p['quantity']; }, $DATA-&gt;products));             $avg = array_sum(array_map(function ($p) { return $p['quantity']; }, $DATA-&gt;products)) \/ count($DATA-&gt;products);             $min = min(array_map(function ($p) { return $p['quantity']; }, $DATA-&gt;products));             $max = max(array_map(function ($p) { return $p['quantity']; }, $DATA-&gt;products));             return &quot;$sum-$avg-$min-$max&quot;;         },     ],     [         function () use ($DATA) {             $sum = E::from($DATA-&gt;products)-&gt;sum(function ($p) { return $p['quantity']; });             $avg = E::from($DATA-&gt;products)-&gt;average(function ($p) { return $p['quantity']; });             $min = E::from($DATA-&gt;products)-&gt;min(function ($p) { return $p['quantity']; });             $max = E::from($DATA-&gt;products)-&gt;max(function ($p) { return $p['quantity']; });             return &quot;$sum-$avg-$min-$max&quot;;         },         &quot;string lambda&quot; =&gt; function () use ($DATA) {             $sum = E::from($DATA-&gt;products)-&gt;sum('$v[&quot;quantity&quot;]');             $avg = E::from($DATA-&gt;products)-&gt;average('$v[&quot;quantity&quot;]');             $min = E::from($DATA-&gt;products)-&gt;min('$v[&quot;quantity&quot;]');             $max = E::from($DATA-&gt;products)-&gt;max('$v[&quot;quantity&quot;]');             return &quot;$sum-$avg-$min-$max&quot;;         },     ],     [         function () use ($DATA) {             $sum = G::from($DATA-&gt;products)-&gt;sum(function ($p) { return $p['quantity']; });             $avg = G::from($DATA-&gt;products)-&gt;average(function ($p) { return $p['quantity']; });             $min = G::from($DATA-&gt;products)-&gt;min(function ($p) { return $p['quantity']; });             $max = G::from($DATA-&gt;products)-&gt;max(function ($p) { return $p['quantity']; });             return &quot;$sum-$avg-$min-$max&quot;;         },         &quot;property path&quot; =&gt; function () use ($DATA) {             $sum = G::from($DATA-&gt;products)-&gt;sum('[quantity]');             $avg = G::from($DATA-&gt;products)-&gt;average('[quantity]');             $min = G::from($DATA-&gt;products)-&gt;min('[quantity]');             $max = G::from($DATA-&gt;products)-&gt;max('[quantity]');             return &quot;$sum-$avg-$min-$max&quot;;         },     ],     [         function () use ($DATA) {             $sum = P::from($DATA-&gt;products)-&gt;sum(function ($p) { return $p['quantity']; });             $avg = P::from($DATA-&gt;products)-&gt;average(function ($p) { return $p['quantity']; });             $min = P::from($DATA-&gt;products)-&gt;minimum(function ($p) { return $p['quantity']; });             $max = P::from($DATA-&gt;products)-&gt;maximum(function ($p) { return $p['quantity']; });             return &quot;$sum-$avg-$min-$max&quot;;         },     ]);  benchmark_linq_groups(&quot;Aggregating arrays custom&quot;, 100, null,     [         function () use ($DATA) {             $mult = 1;             foreach ($DATA-&gt;products as $p)                 $mult *= $p['quantity'];             return $mult;         },     ],     [         function () use ($DATA) {             return E::from($DATA-&gt;products)-&gt;aggregate(function ($a, $p) { return $a * $p['quantity']; }, 1);         },         &quot;string lambda&quot; =&gt; function () use ($DATA) {             return E::from($DATA-&gt;products)-&gt;aggregate('$a * $v[&quot;quantity&quot;]', 1);         },     ],     [         function () use ($DATA) {             return G::from($DATA-&gt;products)-&gt;aggregate(1, function ($a, $p) { return $a * $p['quantity']; });         },     ],     [         function () use ($DATA) {             return P::from($DATA-&gt;products)                 -&gt;select(function ($p) { return $p['quantity']; })                 -&gt;aggregate(function ($a, $q) { return $a * $q; });         },     ]);<\/code><\/pre>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0442\u044c \u043e\u0441\u043e\u0431\u043e \u043d\u0435\u0447\u0435\u0433\u043e. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0447\u0442\u043e, \u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u044b \u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445.<\/p>\n<p>  \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435. Pinq \u043e\u043f\u044f\u0442\u044c \u043f\u043e\u0434\u0432\u0435\u043b\u0430: \u043e\u043d\u0430 \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0443\u044e \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0435\u0440\u0451\u0442 \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 (\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 null \u043f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0430 \u043d\u0435 \u0431\u0440\u043e\u0441\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435&#8230;), \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u0430\u043f\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/p>\n<pre>Aggregating arrays ------------------   PHP     [for]               0.00059 sec   x1.0 (100%)   PHP     [array functions]   0.00193 sec   x3.3 (+227%)   YaLinqo                     0.00475 sec   x8.1 (+705%)   YaLinqo [string lambda]     0.00515 sec   x8.7 (+773%)   Ginq                        0.00669 sec   x11.3 (+1034%)   Ginq    [property path]     0.03955 sec   x67.0 (+6603%)   Pinq                        0.03226 sec   x54.7 (+5368%)  Aggregating arrays custom -------------------------   PHP                         0.00007 sec   x1.0 (100%)   YaLinqo                     0.00046 sec   x6.6 (+557%)   YaLinqo [string lambda]     0.00057 sec   x8.1 (+714%)   Ginq                        0.00046 sec   x6.6 (+557%)   Pinq                        0.00610 sec   x87.1 (+8615%)<\/pre>\n<p>  Pinq \u0438 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 Ginq \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 \u0441\u0442\u0440\u0430\u0448\u043d\u0435\u043d\u044c\u043a\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, YaLinqo \u043e\u043f\u0435\u0447\u0430\u043b\u0438\u043b, \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u043f\u0435\u0447\u0430\u043b\u0438\u043b\u0438 \u043d\u0435 \u043c\u0435\u043d\u044c\u0448\u0435. For \u0440\u0443\u043b\u0438\u0442.<\/p>\n<p>  \u041d\u0443 \u0438 \u043d\u0430 \u0434\u0435\u0441\u0435\u0440\u0442, \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 ReadMe YaLinqo \u2014 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u0432\u0437\u044f\u0442\u044b\u043c\u0438:<\/p>\n<pre><code class=\"php\">benchmark_linq_groups(&quot;Process data from ReadMe example&quot;, 5,     function ($e) { consume($e, [ 'products' =&gt; null ]); },     [         function () use ($DATA) {             $productsSorted = [ ];             foreach ($DATA-&gt;products as $product) {                 if ($product['quantity'] &gt; 0) {                     if (empty($productsSorted[$product['catId']]))                         $productsSorted[$product['catId']] = [ ];                     $productsSorted[$product['catId']][] = $product;                 }             }             foreach ($productsSorted as $catId =&gt; $products) {                 usort($productsSorted[$catId], function ($a, $b) {                     $diff = $a['quantity'] - $b['quantity'];                     if ($diff != 0)                         return -$diff;                     $diff = strcmp($a['name'], $b['name']);                     return $diff;                 });             }             $result = [ ];             $categoriesSorted = $DATA-&gt;categories;             usort($categoriesSorted, function ($a, $b) {                 return strcmp($a['name'], $b['name']);             });             foreach ($categoriesSorted as $category) {                 $categoryId = $category['id'];                 $result[$category['id']] = [                     'name' =&gt; $category['name'],                     'products' =&gt; isset($productsSorted[$categoryId]) ? $productsSorted[$categoryId] : [ ],                 ];             }             return $result;         },     ],     [         function () use ($DATA) {             return E::from($DATA-&gt;categories)                 -&gt;orderBy(function ($cat) { return $cat['name']; })                 -&gt;groupJoin(                     from($DATA-&gt;products)                         -&gt;where(function ($prod) { return $prod['quantity'] &gt; 0; })                         -&gt;orderByDescending(function ($prod) { return $prod['quantity']; })                         -&gt;thenBy(function ($prod) { return $prod['name']; }),                     function ($cat) { return $cat['id']; },                     function ($prod) { return $prod['catId']; },                     function ($cat, $prods) {                         return array(                             'name' =&gt; $cat['name'],                             'products' =&gt; $prods                         );                     }                 );         },         &quot;string lambda&quot; =&gt; function () use ($DATA) {             return E::from($DATA-&gt;categories)                 -&gt;orderBy('$cat ==&gt; $cat[&quot;name&quot;]')                 -&gt;groupJoin(                     from($DATA-&gt;products)                         -&gt;where('$prod ==&gt; $prod[&quot;quantity&quot;] &gt; 0')                         -&gt;orderByDescending('$prod ==&gt; $prod[&quot;quantity&quot;]')                         -&gt;thenBy('$prod ==&gt; $prod[&quot;name&quot;]'),                     '$cat ==&gt; $cat[&quot;id&quot;]', '$prod ==&gt; $prod[&quot;catId&quot;]',                     '($cat, $prods) ==&gt; [                             &quot;name&quot; =&gt; $cat[&quot;name&quot;],                             &quot;products&quot; =&gt; $prods                         ]');         },     ],     [         function () use ($DATA) {             return G::from($DATA-&gt;categories)                 -&gt;orderBy(function ($cat) { return $cat['name']; })                 -&gt;groupJoin(                     G::from($DATA-&gt;products)                         -&gt;where(function ($prod) { return $prod['quantity'] &gt; 0; })                         -&gt;orderByDesc(function ($prod) { return $prod['quantity']; })                         -&gt;thenBy(function ($prod) { return $prod['name']; }),                     function ($cat) { return $cat['id']; },                     function ($prod) { return $prod['catId']; },                     function ($cat, $prods) {                         return array(                             'name' =&gt; $cat['name'],                             'products' =&gt; $prods                         );                     }                 );         },     ],     [         function () use ($DATA) {             return P::from($DATA-&gt;categories)                 -&gt;orderByAscending(function ($cat) { return $cat['name']; })                 -&gt;groupJoin(                     P::from($DATA-&gt;products)                         -&gt;where(function ($prod) { return $prod['quantity'] &gt; 0; })                         -&gt;orderByDescending(function ($prod) { return $prod['quantity']; })                         -&gt;thenByAscending(function ($prod) { return $prod['name']; })                 )                 -&gt;onEquality(                     function ($cat) { return $cat['id']; },                     function ($prod) { return $prod['catId']; }                 )                 -&gt;to(function ($cat, $prods) {                     return array(                         'name' =&gt; $cat['name'],                         'products' =&gt; $prods                     );                 });         },     ]);<\/code><\/pre>\n<p>  \u041a\u043e\u0434 \u043d\u0430 \u0433\u043e\u043b\u043e\u043c PHP \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043e\u0431\u0449\u0438\u043c\u0438 \u0443\u0441\u0438\u043b\u0438\u044f\u043c\u0438 \u0437\u0434\u0435\u0441\u044c \u043d\u0430 \u0425\u0430\u0431\u0440\u0435.<\/p>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/p>\n<pre>Process data from ReadMe example --------------------------------   PHP                         0.00620 sec   x1.0 (100%)   YaLinqo                     0.02840 sec   x4.6 (+358%)   YaLinqo [string lambda]     0.02920 sec   x4.7 (+371%)   Ginq                        0.07720 sec   x12.5 (+1145%)   Pinq                        2.71616 sec   x438.1 (+43707%)<\/pre>\n<p>  GroupJoin \u0443\u0431\u0438\u043b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c Pinq. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b.<\/p>\n<p>  <b>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445<\/b><\/p>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a Pinq \u2014 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0438\u0437 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043c\u0435\u0435\u0442 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b SQL, \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u0432\u0430\u044f PHP, \u0442\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043f\u043e\u043b\u043d\u043e\u0439, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u044d\u0442\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043a\u0430\u043a \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u2014 \u0434\u043b\u044f MySQL, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u043d \u0432 \u0432\u0438\u0434\u0435 \u00ab\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438\u00bb. \u041f\u043e \u0441\u0443\u0442\u0438, \u044d\u0442\u0430 \u0444\u0438\u0447\u0430 \u0437\u0430\u044f\u0432\u043b\u0435\u043d\u0430 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u0431\u0430\u0437\u0435 Pinq, \u043d\u043e \u043d\u0430 \u0434\u0435\u043b\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0435\u0439 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/p>\n<p>  <b>\u0412\u044b\u0432\u043e\u0434\u044b<\/b><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u043d\u044c\u043a\u043e \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0442\u043d\u044e-\u0434\u0440\u0443\u0433\u0443\u044e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u043e\u0442 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 LINQ \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u0442\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>  \u0421\u0440\u0435\u0434\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0431\u0435\u0437\u043e\u0433\u043e\u0432\u043e\u0440\u043e\u0447\u043d\u044b\u0439 \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u0435\u043b\u044c \u043f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u2014 YaLinqo. \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0442\u043e \u044d\u0442\u043e \u0441\u0430\u043c\u044b\u0439 \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440.<\/p>\n<p>  Ginq \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0442\u0435\u043c, \u043a\u0442\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0446\u0435\u043f\u043e\u0447\u043a\u0430\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u0430 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c\u0438 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438. \u041d\u0435 \u0437\u043d\u0430\u044e, \u0435\u0441\u0442\u044c \u043b\u0438 \u0442\u0430\u043a\u0438\u0435 \u0446\u0435\u043d\u0438\u0442\u0435\u043b\u0438 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 SPL.<\/p>\n<p>  Pinq \u043d\u0430 \u043f\u043e\u0432\u0435\u0440\u043a\u0443 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043c\u043e\u043d\u0441\u0442\u0440\u0443\u043e\u0437\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u043b\u043e\u0451\u0432 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438. \u0423 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0435\u0441\u0442\u044c \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b \u0437\u0430 \u0441\u0447\u0451\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0411\u0414, \u043d\u043e \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u043d \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043d\u0435\u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u0411\u0414, \u0442\u043e \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2014 PHPLinq. \u041d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0432\u0435\u0441\u044c\u043c\u0430 \u0441\u043e\u043c\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0435 ORM \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<\/p>\n<p>  <b>\u0421\u0441\u044b\u043b\u043a\u0438<\/b><\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/Athari\/YaLinqo\"><b>YaLinqo<\/b><\/a> \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 YaLinqo<\/li>\n<li><a href=\"http:\/\/athari.github.io\/YaLinqo\"><b>YaLinqo Docs<\/b><\/a> \u2014 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043a \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 YaLinqo<\/li>\n<li><a href=\"https:\/\/github.com\/Athari\/YaLinqoPerf\">YaLinqo Perf<\/a> \u2014 \u0442\u0435\u0441\u0442\u044b \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c YaLinqo, Ginq, Pinq<\/li>\n<li><a href=\"https:\/\/github.com\/akanehara\/ginq\">Ginq<\/a> \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 Ginq<\/li>\n<li><a href=\"https:\/\/github.com\/TimeToogo\/Pinq\">Pinq<\/a> \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 Pinq<\/li>\n<\/ul>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/259155\/\"> http:\/\/habrahabr.ru\/post\/259155\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/a88\/804\/a0d\/a88804a0d87bfaf21b6817ade48e772b.png\" align=\"right\"\/>\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0437\u043d\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 LINQ, \u0438 \u0437\u0430\u0447\u0435\u043c \u043e\u043d \u0441\u0434\u0430\u043b\u0441\u044f \u043d\u0430 PHP, \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 <a href=\"http:\/\/habrahabr.ru\/post\/229763\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u043e YaLinqo<\/a>.<\/p>\n<p>  \u0421 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c. \u0421\u0440\u0430\u0437\u0443 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u044e: \u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u2014 \u044d\u0442\u043e \u043d\u0435\u043d\u0443\u0436\u043d\u0430\u044f \u0448\u0442\u0443\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0437\u0430\u0447\u0435\u043c-\u0442\u043e \u043f\u0440\u0438\u0442\u0430\u0449\u0438\u043b\u0438 \u0432 PHP, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u0437-\u0437\u0430 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u043d\u043e\u0432\u043e\u043c\u043e\u0434\u043d\u044b\u0445 \u0448\u0442\u0443\u0447\u0435\u043a \u0441 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0437\u0432\u0435\u0440\u0441\u043a\u0438 \u043f\u0440\u043e\u0441\u0435\u0434\u0430\u0435\u0442, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043c\u0435\u0440\u044f\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434\u0443, \u0447\u0442\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043b\u0443\u0447\u0448\u0435 \u0441\u0442\u0430\u0440\u043e\u0433\u043e-\u0434\u043e\u0431\u0440\u043e\u0433\u043e for \u043d\u0435 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043d\u043e \u2014 \u0442\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u0435 \u043c\u0438\u043c\u043e. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0438 \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u0434\u043b\u044f \u0432\u0430\u0441.<\/p>\n<p>  \u0421 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c. LINQ \u2014 \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0441\u0435\u0434\u0430\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u0442 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f? \u0415\u0441\u043b\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0441 \u0433\u043e\u043b\u044b\u043c\u0438 \u0446\u0438\u043a\u043b\u0430\u043c\u0438, \u0442\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435 \u0440\u0430\u0437 \u0432 3-5. \u0415\u0441\u043b\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0434\u043b\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0442\u043e \u0440\u0430\u0437\u0430 \u0432 2-4. \u0422\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 (\u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u043c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u0435), \u0442\u043e \u043d\u0430 \u0434\u0435\u043b\u0435 \u0432 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0430\u0445 \u0432\u0441\u0435\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u043e\u0442\u0435\u0440\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435. \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c.<\/p>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <a href=\"https:\/\/github.com\/Athari\/YaLinqo\">YaLinqo<\/a> \u043d\u0430 \u0441\u0432\u0435\u0442 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u0435\u0449\u0451 \u0434\u0432\u0430 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f LINQ (\u0442\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u043b\u0435\u043d\u0438\u0432\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438), \u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u043f\u043e\u0437\u044b\u0432\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c. \u0421\u0430\u043c\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0438 \u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0435 \u2014 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u044d\u0442\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u0431\u0438\u0435\u043d\u0438\u0435\u043c \u043c\u043b\u0430\u0434\u0435\u043d\u0446\u0435\u0432, \u043a\u0430\u043a \u0432 <a href=\"http:\/\/habrahabr.ru\/post\/147612\/\">\u043f\u0440\u043e\u0448\u043b\u043e\u043c \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438<\/a>.<\/p>\n<p>  (\u0410 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043e\u0432 \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u043c\u043e\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043b\u043e \u043c\u0435\u043d\u044f \u0432\u044b\u043b\u043e\u0436\u0438\u0442\u044c <a href=\"http:\/\/athari.github.io\/YaLinqo\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e YaLinqo \u043e\u043d\u043b\u0430\u0439\u043d<\/a>.)<\/p>\n<p>  <i>\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440:<\/i> \u044d\u0442\u043e \u0442\u0435\u0441\u0442\u044b \u00ab\u043d\u0430 \u043a\u043e\u043b\u0435\u043d\u043a\u0435\u00bb. \u041e\u043d\u0438 \u043d\u0435 \u0434\u0430\u044e\u0442 \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u0442\u0435\u0440\u0438 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u044f \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438. \u041e\u0442\u0447\u0430\u0441\u0442\u0438 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044f \u043d\u0435 \u0437\u043d\u0430\u044e, \u043a\u0430\u043a \u044d\u0442\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u0415\u0441\u043b\u0438 \u0447\u0442\u043e, <a href=\"https:\/\/github.com\/Athari\/YaLinqoPerf\">pull requests are welcome<\/a>, \u0447\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-258400","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/258400","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=258400"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/258400\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=258400"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=258400"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=258400"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}