{"id":401396,"date":"2024-06-29T15:49:48","date_gmt":"2024-06-29T15:49:48","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=401396"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=401396","title":{"rendered":"<span>PHP \u2013 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u044f\u0437\u044b\u043a?! PVS-Studio \u0438\u0449\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 PeachPie<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/qh\/bk\/gs\/qhbkgsxgbuebwyyn9tkhiruq8tg.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/qh\/bk\/gs\/qhbkgsxgbuebwyyn9tkhiruq8tg.jpeg\" data-blurred=\"true\"\/>  <\/p>\n<p>PHP \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u043a\u0430\u043a \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439\u0441\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0430\u0439\u0442\u043e\u0432. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u0438\u0435 \u0437\u043d\u0430\u044e\u0442, \u0447\u0442\u043e \u0434\u043b\u044f PHP \u0435\u0441\u0442\u044c \u0435\u0449\u0451 \u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u043e\u0434 .NET \u2014 PeachPie. \u041d\u043e \u0432\u043e\u0442 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043d \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u043d? \u0421\u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043d\u0430\u0439\u0442\u0438 \u0432 \u044d\u0442\u043e\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0436\u0435 \u0443\u0437\u043d\u0430\u0435\u043c!<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u0414\u0430\u0432\u043d\u0435\u043d\u044c\u043a\u043e \u043d\u0435 \u0432\u044b\u0445\u043e\u0434\u0438\u043b\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u0445 C#-\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PVS-Studio\u2026 \u0410 \u0432\u0435\u0434\u044c \u043d\u0430\u043c \u0435\u0449\u0451 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u043e\u043f \u043e\u0448\u0438\u0431\u043e\u043a \u0437\u0430 2021 \u0433\u043e\u0434 (\u0442\u043e\u043f \u0437\u0430 2020 \u0433\u043e\u0434, \u043a\u0441\u0442\u0430\u0442\u0438, \u043c\u043e\u0436\u043d\u043e \u0433\u043b\u044f\u043d\u0443\u0442\u044c <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/csharp\/0787\/\">\u0442\u0443\u0442<\/a>)! \u0427\u0442\u043e \u0436, \u043d\u0443\u0436\u043d\u043e \u0441\u0440\u043e\u0447\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f. \u042f \u0440\u0430\u0434 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0430\u043c \u043e\u0431\u0437\u043e\u0440 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 <a href=\"https:\/\/www.peachpie.io\/\">PeachPie<\/a>.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/9f7\/27e\/0f1\/9f727e0f1afd35befa0e13309bf27459.png\" alt=\"0855_Peachpie_check_ru\/image2.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/9f7\/27e\/0f1\/9f727e0f1afd35befa0e13309bf27459.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. PeachPie \u2014 \u044d\u0442\u043e \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u044f\u0437\u044b\u043a\u0430 PHP \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0438 \u0441\u0440\u0435\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u044f .NET Framework \u0438 .NET. \u041e\u043d \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 Microsoft Roslyn \u0438 \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 <a href=\"https:\/\/github.com\/DEVSENSE\/Phalanger\">Phalanger<\/a> \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u043e\u043a\u043e\u043b\u0435\u043d\u0438\u044f. \u0421 \u0438\u044e\u043b\u044f 2017 \u0433\u043e\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0442\u0430\u043a\u0436\u0435 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 <a href=\"https:\/\/dotnetfoundation.org\/\">.NET Foundation<\/a>. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 <a href=\"https:\/\/github.com\/peachpiecompiler\/peachpie\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043d\u0430 GitHub<\/a>.<\/p>\n<p>  <\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u043d\u0430\u0448 C#-\u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0442\u043e\u0436\u0435 \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 <a href=\"https:\/\/github.com\/dotnet\/roslyn\">Roslyn<\/a>, \u0442\u0430\u043a \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0443 PeachPie \u0438 PVS-Studio \u0435\u0441\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043e\u0431\u0449\u0435\u0435 :). \u0412\u043e\u043e\u0431\u0449\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Roslyn \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0446\u0435\u043b\u0430\u044f <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/csharp\/0399\/\">\u0441\u0442\u0430\u0442\u044c\u044f<\/a>, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u043a\u0430\u043a \u0440\u0430\u0437 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u043e\u043f\u044b\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u044d\u0442\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0439. <\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 PeachPie \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440, \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 Visual Studio \u0438\u043b\u0438 Rider \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u043b\u0430\u0433\u0438\u043d PVS-Studio. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>. <\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0438 \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u044b\u043b\u043e \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043c\u043e\u0439 \u043e\u0431\u0437\u043e\u0440 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u0432 PeachPie \u043e\u0448\u0438\u0431\u043e\u043a \u0432\u0430\u043c \u043f\u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c. \u041f\u0440\u0438\u044f\u0442\u043d\u043e\u0433\u043e \u0447\u0442\u0435\u043d\u0438\u044f!<\/p>\n<p>  <\/p>\n<h2 id=\"problemy-s-writeline\">\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 WriteLine<\/h2>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \ud83d\ude42 \u041f\u043e\u0440\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0442\u044c \u0432 \u0441\u0430\u043c\u044b\u0445 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0430\u043c\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0448\u0438\u0431\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u0436\u0435 \u0432 \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>WriteLine<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public static bool mail(....) {   \/\/ to and subject cannot contain newlines, replace with spaces   to = (to != null) ? to.Replace(\"\\r\\n\", \" \").Replace('\\n', ' ') : \"\";   subject = (subject != null) ? subject.Replace(\"\\r\\n\", \" \").Replace('\\n', ' ')                               : \"\";    Debug.WriteLine(\"MAILER\",                   \"mail('{0}','{1}','{2}','{3}')\",                   to,                   subject,                   message,                    additional_headers);    var config = ctx.Configuration.Core;    .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3025\/\">V3025<\/a>: Incorrect format. A different number of format items is expected while calling &#8216;WriteLine&#8217; function. Arguments not used: 1st, 2nd, 3rd, 4th, 5th. Mail.cs 25<\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0430 \u0447\u0442\u043e \u0436\u0435 \u0442\u0443\u0442 \u043d\u0435 \u0442\u0430\u043a? \u0412\u0440\u043e\u0434\u0435 \u0431\u044b \u0432\u0441\u0451 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e. \u0425\u043e\u0442\u044f, \u043f\u043e\u0441\u0442\u043e\u0439\u0442\u0435-\u043a\u0430! \u0410 \u043a\u0430\u043a\u0438\u043c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u0442?<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0436, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 <em>Debug.WriteLine<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public static void WriteLine(string format, params object[] args);<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c, \u0430 \u0432 \u043a\u043e\u0434\u0435 \u043f\u0435\u0440\u0432\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <em>&#171;MAILER&#187;<\/em>. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0435\u0440\u0435\u043f\u0443\u0442\u0430\u043b \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043b \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<p>  <\/p>\n<h2 id=\"odinakovye-case-v-switch\">\u041e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 case \u0432 switch<\/h2>\n<p>  <\/p>\n<p>\u041e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0440\u0430\u0437\u0434\u0435\u043b \u043f\u043e\u0441\u0432\u044f\u0449\u0430\u0435\u0442\u0441\u044f \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f\u043c, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c \u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 case-\u0432\u0435\u0442\u043a\u0430\u0445:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">private static FlowAnalysisAnnotations DecodeFlowAnalysisAttributes(....) {   var result = FlowAnalysisAnnotations.None;    foreach (var attr in attributes)   {     switch (attr.AttributeType.FullName)     {       case \"System.Diagnostics.CodeAnalysis.AllowNullAttribute\":         result |= FlowAnalysisAnnotations.AllowNull;         break;       case \"System.Diagnostics.CodeAnalysis.DisallowNullAttribute\":         result |= FlowAnalysisAnnotations.DisallowNull;         break;       case \"System.Diagnostics.CodeAnalysis.MaybeNullAttribute\":         result |= FlowAnalysisAnnotations.MaybeNull;         break;       case \"System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute\":         if (TryGetBoolArgument(attr, out bool maybeNullWhen))         {           result |= maybeNullWhen ? FlowAnalysisAnnotations.MaybeNullWhenTrue                                   : FlowAnalysisAnnotations.MaybeNullWhenFalse;         }         break;       case \"System.Diagnostics.CodeAnalysis.NotNullAttribute\":         result |= FlowAnalysisAnnotations.AllowNull;         break;     }   } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u0437\u0430\u043a\u0440\u0430\u043b\u0430\u0441\u044c \u0435\u0441\u043b\u0438 \u043d\u0435 \u043e\u0448\u0438\u0431\u043a\u0430, \u0442\u043e \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0441\u0442\u044c. \u041a\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0435\u0451 \u043d\u0430\u0439\u0442\u0438?<\/p>\n<p>  <\/p>\n<p>\u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u043d\u0438 \u043a \u0447\u0435\u043c\u0443 \u0442\u0435\u0440\u044f\u0442\u044c \u0432\u0440\u0435\u043c\u044f, \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u0441\u0451 \u043d\u0430\u0448\u0451\u043b \u0437\u0430 \u043d\u0430\u0441:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">private static FlowAnalysisAnnotations DecodeFlowAnalysisAttributes(....) {   var result = FlowAnalysisAnnotations.None;    foreach (var attr in attributes)   {     switch (attr.AttributeType.FullName)     {       case \"System.Diagnostics.CodeAnalysis.AllowNullAttribute\":         result |= FlowAnalysisAnnotations.AllowNull;         break;       ....       case \"System.Diagnostics.CodeAnalysis.NotNullAttribute\":         result |= FlowAnalysisAnnotations.AllowNull;              \/\/ &lt;=         break;     }   } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3139\/\">V3139<\/a>: Two or more case-branches perform the same actions. ReflectionUtils.Nullability.cs 170<\/p>\n<p>  <\/p>\n<p>\u041d\u0435 \u043f\u0440\u0430\u0432\u0434\u0430 \u043b\u0438, \u0441\u0442\u0440\u0430\u043d\u043d\u043e, \u0447\u0442\u043e \u0434\u0432\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e? \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0435\u0442, \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0442\u0430\u043a\u043e\u0435 \u0431\u044b\u0432\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0447\u0430\u0441\u0442\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u0442\u044c 2 &#171;\u043d\u043e&#187;.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u0432\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">switch (attr.AttributeType.FullName) {   case \"System.Diagnostics.CodeAnalysis.AllowNullAttribute\":   case \"System.Diagnostics.CodeAnalysis.NotNullAttribute\":     result |= FlowAnalysisAnnotations.AllowNull;     break;   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043d\u0435\u0440\u0435\u0434\u043a\u043e \u043f\u0440\u0435\u043d\u0435\u0431\u0440\u0435\u0433\u0430\u044e\u0442 \u044d\u0442\u0438\u043c \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c, \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044f \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442. \u0418\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0434\u0432\u0443\u0445 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0432\u0435\u0442\u043e\u043a \u0441\u0430\u043c\u043e \u043f\u043e \u0441\u0435\u0431\u0435 \u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u043c \u0443\u0436 \u0441\u0442\u0440\u0430\u0448\u043d\u044b\u043c. \u041a\u0443\u0434\u0430 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u043e\u0442 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 <em>FlowAnalysisAnnotations<\/em> \u0438\u043c\u0435\u0435\u0442 \u0441\u0440\u0435\u0434\u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>FlowAnalysisAnnotations.NotNull<\/em>. \u0421\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <em>&#171;System.Diagnostics.CodeAnalysis.NotNullAttribute&#187;<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">switch (attr.AttributeType.FullName) {   case \"System.Diagnostics.CodeAnalysis.AllowNullAttribute\":     result |= FlowAnalysisAnnotations.AllowNull;     break;   ....   case \"System.Diagnostics.CodeAnalysis.NotNullAttribute\":     result |= FlowAnalysisAnnotations.NotNull;              \/\/ &lt;=     break; }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"immutabelnyy-datetime\">\u0418\u043c\u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u0439 DateTime<\/h2>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/examples\/v3010\/\">\u0447\u0430\u0441\u0442\u0435\u043d\u044c\u043a\u043e \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044e\u0442 \u043e\u0448\u0438\u0431\u043a\u0438<\/a>, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u043c \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435\u043c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b &#171;\u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0449\u0438\u0445&#187; \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u041d\u0438\u0436\u0435 \u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0430, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u0430\u044f \u0432 PeachPie:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">using System_DateTime = System.DateTime;  internal static System_DateTime MakeDateTime(....) { .... }  public static long mktime(....) {   var zone = PhpTimeZone.GetCurrentTimeZone(ctx);   var local = MakeDateTime(hour, minute, second, month, day, year);    switch (daylightSaving)   {     case -1:       if (zone.IsDaylightSavingTime(local))         local.AddHours(-1);                   \/\/ &lt;=       break;     case 0:       break;     case 1:       local.AddHours(-1);                     \/\/ &lt;=       break;     default:       PhpException.ArgumentValueNotSupported(\"daylightSaving\", daylightSaving);       break;   }   return DateTimeUtils.UtcToUnixTimeStamp(TimeZoneInfo.ConvertTime(local,                                                                     ....)); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f PVS-Studio:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3010\/\">V3010<\/a> The return value of function &#8216;AddHours&#8217; is required to be utilized. DateTimeFunctions.cs 1232<\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3010\/\">V3010<\/a> The return value of function &#8216;AddHours&#8217; is required to be utilized. DateTimeFunctions.cs 1239<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u044b \u043a\u0443\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u2013 \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d\u0438 \u043f\u043e\u043f\u0440\u043e\u0441\u0442\u0443 \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u0440\u043e\u0434\u0435 <em>AddHours<\/em> \u043d\u0435 \u043c\u0435\u043d\u044f\u044e\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u2013 \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439, \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u043e\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u0421\u043b\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u0430 \u044d\u0442\u0430 \u043e\u043f\u043b\u043e\u0448\u043d\u043e\u0441\u0442\u044c, \u043d\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043a\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e.<\/p>\n<p>  <\/p>\n<h2 id=\"try-metody-s-nyuansami\">Try-\u043c\u0435\u0442\u043e\u0434\u044b \u0441 \u043d\u044e\u0430\u043d\u0441\u0430\u043c\u0438<\/h2>\n<p>  <\/p>\n<p>Try-\u043c\u0435\u0442\u043e\u0434\u044b \u043e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e \u0431\u044b\u0432\u0430\u044e\u0442 \u0443\u0434\u043e\u0431\u043d\u044b \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043d\u0430 C#. \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u0438\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043b\u044f\u043c\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f <em>int.TryParse<\/em>, <em>Dictionary.TryGetValue<\/em> \u0438 \u0442.\u0434. \u041f\u0440\u0438\u0432\u044b\u0447\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u0444\u043b\u0430\u0433, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043d\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u0430 \u0441\u0430\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 out-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 PeachPie \u0440\u0435\u0448\u0438\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 try-\u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e \u0442\u043e\u0439 \u0436\u0435 \u0441\u0445\u0435\u043c\u0435. \u0427\u0442\u043e \u0436\u0435 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u0448\u043b\u043e? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">internal static bool TryParseIso8601Duration(string str,                                              out DateInfo result,                                              out bool negative) {   ....   if (pos >= length) goto InvalidFormat;    if (s[pos++] != 'P') goto InvalidFormat;    if (!Core.Convert.TryParseDigits(....))     goto Error;    if (pos >= length) goto InvalidFormat;    if (s[pos] == 'Y')   {     ....      if (!Core.Convert.TryParseDigits(....))        goto Error;      if (pos >= length) goto InvalidFormat;   }   ....   InvalidFormat:   Error:      result = default;     negative = default;     return false; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0441\u0438\u043b\u044c\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0449\u0451\u043d \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f. \u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e, \u043f\u0435\u0440\u0435\u0439\u0434\u044f \u043f\u043e <a href=\"https:\/\/github.com\/peachpiecompiler\/peachpie\/blob\/cfbcc7cc34fb78097a53ec25b2ad78242160f22e\/src\/Peachpie.Library\/DateTime\/DateTimeParsing.cs#L1413\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>. \u0412 \u043c\u0435\u0442\u043e\u0434\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u044b\u0437\u043e\u0432 <em>Core.Convert.TryParseDigits<\/em>. \u0412 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043a\u043e\u0433\u0434\u0430 \u0442\u0430\u043a\u043e\u0439 \u0432\u044b\u0437\u043e\u0432 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <em>false<\/em>, \u043f\u043e\u0442\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u043a \u043c\u0435\u0442\u043a\u0435 <em>Error<\/em>, \u0447\u0442\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u043b\u043e\u0433\u0438\u0447\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u043c\u0435\u0442\u043a\u0435 <em>Error<\/em> <em>out<\/em>-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <em>false<\/em>. \u0412\u0441\u0451 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u043f\u043e\u043b\u043d\u0435 \u043b\u043e\u0433\u0438\u0447\u043d\u043e \u2013 \u043c\u0435\u0442\u043e\u0434 <em>TryParseIso8601Duration <\/em>\u0432\u0435\u0434\u0451\u0442 \u0441\u0435\u0431\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a, \u043a\u0430\u043a \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 try-\u043c\u0435\u0442\u043e\u0434\u044b. \u041d\u0443\u2026 \u041f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435, \u044d\u0442\u043e \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0436\u0435 \u0432\u0441\u0451 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0442\u0430\u043a :(.<\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0440\u0430\u043d\u0435\u0435, \u0435\u0441\u043b\u0438 <em>Core.Convert.TryParseDigits <\/em>\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <em>false<\/em>, \u0442\u043e \u043a\u043e\u0434 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u043c\u0435\u0442\u043a\u0443 <em>Error<\/em>, \u0433\u0434\u0435 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043a\u0438\/\u043d\u0435\u0443\u0434\u0430\u0447\u0438. \u041f\u0440\u0430\u0432\u0434\u0430, \u0432\u043e\u0442 \u0432 \u0447\u0451\u043c \u0431\u0435\u0434\u0430 \u2013 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440-\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442, \u0447\u0442\u043e <em>TryParseDigits<\/em> \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <em>false<\/em>:<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3022\/\">V3022<\/a>: Expression &#8216;!Core.Convert.TryParseDigits(s, ref pos, false, out value, out numDigits)&#8217; is always false. DateTimeParsing.cs 1440<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0442\u0440\u0438\u0446\u0430\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432\u044b\u0437\u043e\u0432\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u0440\u0430\u0432\u043d\u043e <em>false<\/em>, \u0442\u043e \u0441\u0430\u043c \u0432\u044b\u0437\u043e\u0432 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <em>true<\/em>. \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0434\u043b\u044f try-\u043c\u0435\u0442\u043e\u0434\u0430! \u041d\u0435\u0443\u0436\u0435\u043b\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0438 \u043f\u0440\u0430\u0432\u0434\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e? \u0414\u0430\u0432\u0430\u0439\u0442\u0435, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 <em>TryParseDigits<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public static bool TryParseDigits(....) {   Debug.Assert(offset >= 0);    int offsetStart = offset;   result = 0;   numDigits = 0;    while (....)   {     var digit = s[offset] - '0';      if (result > (int.MaxValue - digit) \/ 10)     {       if (!eatDigits)       {         \/\/ overflow         \/\/return false;         throw new OverflowException();       }        ....        return true;     }      result = result * 10 + digit;     offset++;   }    numDigits = offset - offsetStart;   return true; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <em>true<\/em>. \u041d\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u0443\u0434\u0430\u0447\u0435\u0439 \u2013 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 <em>OverflowException<\/em>. \u041a\u0430\u043a \u043f\u043e \u043c\u043d\u0435, \u044d\u0442\u043e \u044f\u0432\u043d\u043e \u043d\u0435 \u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u0436\u0438\u0434\u0430\u0435\u0448\u044c \u043e\u0442 try-\u043c\u0435\u0442\u043e\u0434\u0430 :). \u0421\u0442\u0440\u043e\u043a\u0430 \u0441 <em>return false<\/em>, \u043a\u0441\u0442\u0430\u0442\u0438, \u0442\u0443\u0442 \u0435\u0441\u0442\u044c, \u043d\u043e \u043e\u043d\u0430 \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430.<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u044d\u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a\u0430\u043a-\u0442\u043e \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043e. \u041d\u043e \u043f\u043e \u043a\u043e\u0434\u0443 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0442\u0443\u0442 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u043f\u043e \u043f\u043b\u0430\u043d\u0443. \u0418 <em>TryParseDigits<\/em>, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 \u0435\u0433\u043e <em>TryParseIso8601Duration,<\/em> \u043f\u043e \u0438\u0434\u0435\u0435, \u0434\u043e\u043b\u0436\u043d\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0435 try-\u043c\u0435\u0442\u043e\u0434\u044b \u2013 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0443\u0434\u0430\u0447\u0438 <em>false<\/em>. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043e\u043d\u0438 \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044e\u0442 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<h2 id=\"znachenie-argumenta-po-umolchaniyu\">\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/h2>\n<p>  <\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u043f\u043e\u043f\u0440\u043e\u0449\u0435, \u043e\u0434\u043d\u0430\u043a\u043e \u0438 \u043e\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0432\u0435\u0441\u044c\u043c\u0430 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">private static bool Put(Context context,                         PhpResource ftp_stream,                         string remote_file,                         string local_file,                         int mode,                         bool append,                         int startpos) { .... }  public static bool ftp_put(Context context,                            PhpResource ftp_stream,                            string remote_file,                            string local_file,                            int mode = FTP_IMAGE,                            int startpos = 0) {     return Put(context,                ftp_stream,                remote_file,                local_file,                mode = FTP_IMAGE, \/\/ &lt;=                false,                startpos); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3061\/\">V3061<\/a>: Parameter &#8216;mode&#8217; is always rewritten in method body before being used. Ftp.cs 306<\/p>\n<p>  <\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 <em>ftp_put<\/em> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 \u0440\u044f\u0434 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <em>mode<\/em>. \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043e\u0434\u043d\u0430\u043a\u043e \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u041f\u0440\u0430\u0432\u0434\u0430, \u044d\u0442\u043e \u043d\u0438 \u043d\u0430 \u0447\u0442\u043e \u043d\u0435 \u043f\u043e\u0432\u043b\u0438\u044f\u0435\u0442 \u2013 <em>mode<\/em> \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0438 \u0432 \u043c\u0435\u0442\u043e\u0434 <em>Put<\/em> \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b <em>FTP_IMAGE<\/em>.<\/p>\n<p>  <\/p>\n<p>\u0421\u043b\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u0432\u0441\u0451 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a \u2013 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e\u0439. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0437\u0434\u0435\u0441\u044c \u0432\u0441\u0451 \u0436\u0435 \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0430.<\/p>\n<p>  <\/p>\n<h2 id=\"copy-paste-peredayot-privet\">Copy-paste \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u043f\u0440\u0438\u0432\u0435\u0442<\/h2>\n<p>  <\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u0436\u0435\u0440\u0442\u0432\u0443 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public static PhpValue filter_var(....) {   ....   if ((flags &amp; (int)FilterFlag.NO_PRIV_RANGE) == (int)FilterFlag.NO_PRIV_RANGE)   {     throw new NotImplementedException();   }    if ((flags &amp; (int)FilterFlag.NO_PRIV_RANGE) == (int)FilterFlag.NO_RES_RANGE)   {     throw new NotImplementedException();   }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3127\/\">V3127<\/a>: Two similar code fragments were found. Perhaps, this is a typo and &#8216;NO_RES_RANGE&#8217; variable should be used instead of &#8216;NO_PRIV_RANGE&#8217; Filter.cs 771<\/p>\n<p>  <\/p>\n<p>\u0421\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0432\u0442\u043e\u0440\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<p><em>(flags &amp; (int)FilterFlag.<strong>NO_RES_RANGE<\/strong>) == (int)FilterFlag.NO_RES_RANGE<\/em><\/p>\n<p>  <\/p>\n<p>\u0412\u043e \u0432\u0441\u044f\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0442\u0430\u043a\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043b\u043e\u0433\u0438\u0447\u043d\u0435\u0435 \u0438 \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<p>  <\/p>\n<h2 id=\"prosto-lishnyaya-proverka-v-if\">\u041f\u0440\u043e\u0441\u0442\u043e \u043b\u0438\u0448\u043d\u044f\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432 if<\/h2>\n<p>  <\/p>\n<p>\u0414\u0443\u043c\u0430\u044e, \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0448 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0439 \u0440\u0430\u0437\u0431\u043e\u0440 \u0438 \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">internal static NumberInfo IsNumber(....) {   ....   int num = AlphaNumericToDigit(c);    \/\/ unexpected character:   if (num &lt;= 15)   {     if (l == -1)     {       if (   longValue &lt; long.MaxValue \/ 16            || (   longValue == long.MaxValue \/ 16                &amp;&amp; num &lt;= long.MaxValue % 16))         \/\/ &lt;=       {         ....       }       ....     }     ....   }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3063\/\">V3063<\/a>: A part of conditional expression is always true if it is evaluated: num &lt;= long.MaxValue % 16. Conversions.cs 994<\/p>\n<p>  <\/p>\n<p>\u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u0440\u0435\u0437\u0430\u043d \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f. \u041f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 <em>IsNumber<\/em> \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e <a href=\"https:\/\/github.com\/peachpiecompiler\/peachpie\/blob\/cfbcc7cc34fb78097a53ec25b2ad78242160f22e\/src\/Peachpie.Runtime\/Conversions.cs#L727\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a> \u2013 \u043d\u043e \u0445\u043e\u0447\u0443 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u0442\u044c, \u0447\u0442\u043e \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0435\u0451 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u043e, \u0438\u0431\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0431\u043e\u043b\u0435\u0435 300 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430. \u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043e\u043d\u0430 \u0441\u043b\u0435\u0433\u043a\u0430 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0435 \u0440\u0430\u043c\u043a\u0438 &#171;\u043e\u0434\u043d\u043e\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430&#187; :).<\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044e. \u0412\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u043c \u0431\u043b\u043e\u043a\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>num<\/em> \u043c\u0435\u043d\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u043e 15. \u0412\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u043c \u0436\u0435 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430, \u0447\u0442\u043e <em>num<\/em> \u043c\u0435\u043d\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u043e <em>long.MaxValue % 16<\/em>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0432\u043d\u043e 15 \u2013 \u044d\u0442\u043e \u043d\u0435\u0442\u0440\u0443\u0434\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c. \u0412\u044b\u0445\u043e\u0434\u0438\u0442, \u043a\u043e\u0434 \u0434\u0432\u0430\u0436\u0434\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0447\u0442\u043e <em>num<\/em> \u043c\u0435\u043d\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u0435\u043d 15.<\/p>\n<p>  <\/p>\n<p>\u0415\u0434\u0432\u0430 \u043b\u0438 \u044d\u0442\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u2013 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u0442\u043e-\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043b\u0438\u0448\u043d\u044e\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043d\u0430 \u0442\u043e \u0434\u0430\u0436\u0435 \u0431\u044b\u043b\u0438 \u043f\u0440\u0438\u0447\u0438\u043d\u044b \u2013 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0449\u0435 \u0447\u0438\u0442\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434. \u0425\u043e\u0442\u044f \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438\u043b\u0438 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0431\u044b\u043b\u043e \u0431\u044b \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c. \u041a\u0430\u043a \u0431\u044b \u0442\u0430\u043c \u043d\u0438 \u0431\u044b\u043b\u043e, \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u0430, \u0438 \u0434\u043e\u043b\u0433 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u2013 \u043e\u0431 \u044d\u0442\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c.<\/p>\n<p>  <\/p>\n<h2 id=\"tak-mozhet-li-tam-byt-null\">\u0422\u0430\u043a \u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u0442\u0430\u043c \u0431\u044b\u0442\u044c null?<\/h2>\n<p>  <\/p>\n<p>\u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0443\u043f\u0443\u0441\u043a\u0430\u044e\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 <em>null<\/em>. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438, \u0430 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c (\u0433\u0434\u0435 \u043e\u043d\u0430 \u0432\u0441\u0451 \u0442\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c <em>null<\/em>) \u2013 \u0437\u0430\u0431\u044b\u043b\u0438 \u0438\u043b\u0438 \u043d\u0435 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043b\u0438 \u043d\u0443\u0436\u043d\u044b\u043c. \u0418 \u0442\u0443\u0442 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0433\u0430\u0434\u0430\u0442\u044c, \u0431\u044b\u043b\u0430 \u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043b\u0438\u0448\u043d\u0435\u0439 \u0438\u043b\u0438 \u043d\u0430\u043f\u0440\u043e\u0442\u0438\u0432 \u2013 \u043a\u043e\u0435-\u0433\u0434\u0435 \u0435\u0451 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442. \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 <em>null<\/em> \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u2013 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043a\u043e\u0434\u0435 \u043d\u0438\u0436\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/csharp\/language-reference\/operators\/member-access-operators#null-conditional-operators--and-\">null-conditional \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440<\/a>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public static string get_parent_class(....) {   if (caller.Equals(default))   {     return null;   }    var tinfo = Type.GetTypeFromHandle(caller)?.GetPhpTypeInfo();   return tinfo.BaseType?.Name; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3105\/\">V3105<\/a>: The &#8216;tinfo&#8217; variable was used after it was assigned through null-conditional operator. NullReferenceException is possible. Objects.cs 189<\/p>\n<p>  <\/p>\n<p>\u041f\u043e \u043c\u043d\u0435\u043d\u0438\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430, \u0432\u044b\u0437\u043e\u0432 <em>Type.GetTypeFromHandle(caller)<\/em> \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c <em>null<\/em> \u2013 \u043e\u0442\u0442\u043e\u0433\u043e \u043e\u043d \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b &#171;?.&#187; \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 <em>GetPhpTypeInfo<\/em>. \u0421\u0443\u0434\u044f \u043f\u043e <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.type.gettypefromhandle?view=net-5.0#System_Type_GetTypeFromHandle_System_RuntimeTypeHandle_\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>, \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. <\/p>\n<p>  <\/p>\n<p>\u0423\u0440\u0430, &#171;?.&#187; \u0441\u043f\u0430\u0441\u0430\u0435\u0442 \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0432\u044b\u0437\u043e\u0432 <em>GetTypeFromHandle<\/em> \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0435\u0440\u043d\u0451\u0442 <em>null<\/em>, \u0442\u043e \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <em>tinfo<\/em> \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d <em>null<\/em>. \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 <em>BaseType <\/em>\u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0434\u0440\u0443\u0433\u043e\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0435\u0449\u0451 \u043e\u0434\u043d\u043e\u0433\u043e &#171;?&#187;:<\/p>\n<p>  <\/p>\n<p><em>return tinfo<strong>?<\/strong>.BaseType?.Name;<\/em><\/p>\n<p>  <\/p>\n<h2 id=\"fatal-warning-i-exceptions\">Fatal warning \u0438 exceptions<\/h2>\n<p>  <\/p>\n<p><em>\u041f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u044c\u0442\u0435\u0441\u044c, \u0432 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0432\u0430\u0441 \u0436\u0434\u0451\u0442 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0440\u0430\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435&#8230;<\/em><\/p>\n<p>  <\/p>\n<p>\u0415\u0449\u0451 \u043e\u0434\u043d\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0435 \u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u043d\u0430 <em>null<\/em>, \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043a\u0443\u0434\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435, \u0447\u0435\u043c \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u043e \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434. \u0412\u0437\u0433\u043b\u044f\u043d\u0438\u0442\u0435 \u043d\u0430 \u043a\u043e\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">static HashPhpResource ValidateHashResource(HashContext context) {   if (context == null)   {     PhpException.ArgumentNull(nameof(context));   }    return context.HashAlgorithm; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3125\/\">V3125<\/a>: The &#8216;context&#8217; object was used after it was verified against null. Check lines: 3138, 3133. Hash.cs 3138<\/p>\n<p>  <\/p>\n<p>\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e <em>null<\/em>, \u0430 \u0437\u0430\u0442\u0435\u043c \u0431\u0435\u0437 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443. \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u0430 <em>null<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">PhpException.ArgumentNull(nameof(context));<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 <em>context <\/em>\u0438 \u043f\u0440\u0430\u0432\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u0435\u043d <em>null<\/em>, \u0442\u043e \u0434\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 <em>HashAlgorithm<\/em> \u043f\u043e\u0442\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043d\u0435 \u0434\u043e\u0431\u0435\u0440\u0451\u0442\u0441\u044f. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0435\u043d. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u043b\u043e\u0436\u043d\u043e\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435?<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u0438 \u043e\u0448\u0438\u0431\u0430\u0442\u044c\u0441\u044f. \u041e\u0434\u043d\u0430\u043a\u043e \u043c\u043d\u0435 \u0431\u044b\u043b\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0447\u0442\u043e PVS-Studio \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0443\u043c\u0435\u0435\u0442 \u2013 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a <em>HashAlgorithm<\/em> \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>context<\/em> \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u0430 <em>null<\/em>.<\/p>\n<p>  <\/p>\n<p>\u0410 \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u044b\u0437\u043e\u0432 <em>PhpException.ArgumentNull<\/em>? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public static void ArgumentNull(string argument) {   Throw(PhpError.Warning, ErrResources.argument_null, argument); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0425\u043c, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u0440\u043e\u0434\u0435 \u0447\u0442\u043e-\u0442\u043e \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0432\u044b\u0437\u043e\u0432\u0430 \u2014 <em>PhpError.Warning<\/em>. \u0425\u043c, \u043d\u0443 \u0447\u0442\u043e \u0436, \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u043c\u0435\u0442\u043e\u0434\u0443 <em>Throw<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public static void Throw(PhpError error, string formatString, string arg0) {   Throw(error, string.Format(formatString, arg0)); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0443\u0442 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e, \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u0432 \u0434\u0440\u0443\u0433\u0443\u044e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443 <em>Throw<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public static void Throw(PhpError error, string message) {   OnError?.Invoke(error, message);    \/\/ throw PhpFatalErrorException   \/\/ and terminate the script on fatal error   if ((error &amp; (PhpError)PhpErrorSets.Fatal) != 0)   {     throw new PhpFatalErrorException(message, innerException: null);   } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410 \u0432\u043e\u0442 \u0438 \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u0438\u0441\u043a\u0430\u043b\u0438! \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0432\u0441\u0435\u0439 \u044d\u0442\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u0435 <em>PhpFatalErrorException<\/em>. \u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430. <\/p>\n<p>  <\/p>\n<p>\u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043d\u0430 \u043c\u0435\u0441\u0442\u0430, \u0433\u0434\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f <em>OnError<\/em>. \u0412\u0441\u0451 \u0436\u0435 \u043e\u043d\u0438 \u0442\u043e\u0436\u0435 \u043c\u043e\u0433\u0443\u0442 \u043a\u0438\u0434\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u2013 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u043b\u0435\u0433\u043a\u0430 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e, \u043d\u043e \u043c\u0430\u043b\u043e \u043b\u0438. \u0422\u0430\u043a\u0438\u0445 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438 \u0432\u0441\u0435 \u043e\u043d\u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. \u041e\u0434\u0438\u043d \u0431\u044b\u043b \u0432 \u0444\u0430\u0439\u043b\u0435 <a href=\"https:\/\/github.com\/peachpiecompiler\/peachpie\/blob\/cfbcc7cc34fb78097a53ec25b2ad78242160f22e\/src\/Peachpie.AspNetCore.Web\/PhpHandlerMiddleware.cs\">PhpHandlerMiddleware<\/a>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">PhpException.OnError += (error, message) => {   switch (error)   {     case PhpError.Error:       logger.LogError(message);       break;      case PhpError.Warning:       logger.LogWarning(message);       break;      case PhpError.Notice:     default:       logger.LogInformation(message);       break;   } };<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0440\u0443\u0433\u0438\u0435 2 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u043b\u0438\u0441\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0430\u043c\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 <a href=\"https:\/\/github.com\/peachpiecompiler\/peachpie\/blob\/cfbcc7cc34fb78097a53ec25b2ad78242160f22e\/src\/Peachpie.Runtime\/Errors.cs#L99\">PhpException<\/a>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">\/\/ trace output OnError += (error, message) => {   Trace.WriteLine(message, $\"PHP ({error})\"); };  \/\/ LogEventSource OnError += (error, message) => {   if ((error &amp; (PhpError)PhpErrorSets.Fatal) != 0)   {     LogEventSource.Log.HandleFatal(message);   }   else   {     LogEventSource.Log.HandleWarning(message);   } };<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043d\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u043c\u0435\u0442\u043e\u0434\u0443 <em>Throw<\/em>.<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public static void Throw(PhpError error, string message) {   OnError?.Invoke(error, message);    \/\/ throw PhpFatalErrorException   \/\/ and terminate the script on fatal error   if ((error &amp; (PhpError)PhpErrorSets.Fatal) != 0)   {     throw new PhpFatalErrorException(message, innerException: null);   } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0430\u0437 \u0441 <em>OnError<\/em> \u0432\u0441\u0451 \u044f\u0441\u043d\u043e, \u0442\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u044d\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">(error &amp; (PhpError)PhpErrorSets.Fatal) != 0<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440<em> error<\/em> \u0445\u0440\u0430\u043d\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f <em>PhpError<\/em>. \u0427\u0443\u0442\u044c \u0440\u0430\u043d\u0435\u0435 \u043c\u044b \u0432\u0438\u0434\u0435\u043b\u0438, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f <em>PhpError.Warning<\/em>. \u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f &#171;\u043f\u043e\u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u0438&#187; \u043a <em>error <\/em>\u0438 <em>PhpErrorSets.Fatal<\/em> \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0443\u043b\u0435\u0432\u044b\u043c.<\/p>\n<p>  <\/p>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435<em> PhpErrorSets.Fatal <\/em>\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 &#171;\u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435&#187; \u043d\u0430\u0431\u043e\u0440\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f <em>PhpError <\/em>\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 &#171;\u043f\u043e\u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u0438\u043b\u0438&#187;:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">Fatal =   PhpError.E_ERROR | PhpError.E_COMPILE_ERROR         | PhpError.E_CORE_ERROR | PhpError.E_USER_ERROR<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u043d\u0435\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">E_ERROR = 1, E_WARNING = 2, E_CORE_ERROR = 16, E_COMPILE_ERROR = 64, E_USER_ERROR = 256, Warning = E_WARNING<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f <em>error &amp; (PhpError)PhpErrorSets.Fatal<\/em> \u0432\u0435\u0440\u043d\u0451\u0442 \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <em>error<\/em> \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043e\u0434\u043d\u043e \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u043b\u0438 \u0438\u0445 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0439:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">PhpError.E_ERROR, PhpError.E_COMPILE_ERROR, PhpError.E_CORE_ERROR, PhpError.E_USER_ERROR<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <em>error<\/em> \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>PhpError.Warning<\/em>, \u0440\u0430\u0432\u043d\u043e\u0435 <em>PhpError.E_WARNING<\/em>, \u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 &#171;\u043f\u043e\u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u0438&#187; \u0431\u0443\u0434\u0435\u0442 \u043d\u0443\u043b\u0435\u0432\u044b\u043c. \u0422\u043e\u0433\u0434\u0430 \u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f <em>PhpFatalErrorException<\/em> \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043d\u0430\u0437\u0430\u0434 \u043a \u043c\u0435\u0442\u043e\u0434\u0443 <em>PhpException.ArgumentNull<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public static void ArgumentNull(string argument) {   Throw(PhpError.Warning, ErrResources.argument_null, argument); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 <em>PhpError.Warning<\/em> \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u043e \u0437\u0430\u0434\u0443\u043c\u043a\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u043d \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0439 <em>null<\/em>. \u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e&#8230;<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">static HashPhpResource ValidateHashResource(HashContext context) {   if (context == null)   {     PhpException.ArgumentNull(nameof(context)); \/\/ no exceptions   }    return context.HashAlgorithm; \/\/ context is potential null }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 <em>PhpException.ArgumentNull<\/em> \u043d\u0435 \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 (\u0447\u0442\u043e \u0441\u0430\u043c\u043e \u043f\u043e \u0441\u0435\u0431\u0435 \u0443\u0436\u0435 \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e), \u0442\u043e \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 <em>HashAlgorithm<\/em> \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f <em>NullReferenceException<\/em>!<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u2013 \u0434\u043e\u043b\u0436\u043d\u043e \u043b\u0438 \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u043d\u0435\u0442? \u0415\u0441\u043b\u0438 \u0434\u043e\u043b\u0436\u043d\u043e, \u0442\u043e \u043b\u043e\u0433\u0438\u0447\u043d\u0435\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u0442 \u0436\u0435 <em>PhpFatalErrorException<\/em>. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 \u044d\u0442\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u043e\u0436\u0438\u0434\u0430\u0435\u0442, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em> \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <em>context<\/em>. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c &#171;?.&#187;. \u0422\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435, \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0438 \u0434\u0430\u0436\u0435 \u043f\u043e\u043c\u043e\u0433 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438.<\/p>\n<p>  <\/p>\n<h2 id=\"snova-lishnyaya-proverka-i-snova-exception\">\u0421\u043d\u043e\u0432\u0430 \u043b\u0438\u0448\u043d\u044f\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430? \u0418 \u0441\u043d\u043e\u0432\u0430 exception!<\/h2>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0448\u043b\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043e\u0436\u0438\u0434\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u0430 \u043d\u0430\u0440\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0439 <em>null<\/em>. \u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043d\u0438\u0436\u0435 \u2013 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public PhpValue offsetGet(PhpValue offset) {   var node = GetNodeAtIndex(offset);    Debug.Assert(node != null);    if (node != null)     return node.Value;   else     return PhpValue.Null; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3022\/\">V3022<\/a>: Expression &#8216;node != null&#8217; is always true. Datastructures.cs 432<\/p>\n<p>  <\/p>\n<p>\u041d\u0443, \u043a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f, \u043d\u0435 <em>null<\/em> \u0438 \u043b\u0430\u0434\u043d\u043e \u2013 \u0447\u0435\u0433\u043e \u0431\u0443\u0445\u0442\u0435\u0442\u044c-\u0442\u043e? \u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u044b\u0447\u043d\u043e <em>null<\/em> \u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a. \u041f\u043e \u043a\u043e\u0434\u0443 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f. \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0436\u0435 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442, \u0447\u0442\u043e \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e <em>null <\/em>\u0442\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0435 \u043c\u043e\u0436\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0434\u0435\u043b\u043e \u0432 \u0432\u044b\u0437\u043e\u0432\u0435 <em>Debug.Assert<\/em>. \u0425\u043e\u0440\u043e\u0448\u043e \u044d\u0442\u043e \u0438\u043b\u0438 \u043f\u043b\u043e\u0445\u043e, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e\u0442 \u0432\u044b\u0437\u043e\u0432 \u043d\u0435 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u043c\u043d\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0434\u0435\u043b\u043e \u043d\u0435 \u0432 <em>Debug.Assert<\/em>, \u0442\u043e \u0432 \u0447\u0451\u043c \u0436\u0435? \u0421 \u0447\u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u0447\u0438\u0442\u0430\u0435\u0442, \u0447\u0442\u043e <em>node<\/em> \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0440\u0430\u0432\u043d\u043e <em>null<\/em>? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u043c\u0435\u0442\u043e\u0434 <em>GetNodeAtIndex<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0432 <em>node<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">private LinkedListNode&lt;PhpValue> GetNodeAtIndex(PhpValue index) {   return GetNodeAtIndex(GetValidIndex(index)); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0436\u0435, \u043a\u043e\u043f\u0430\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435. \u041f\u043e\u0433\u043b\u044f\u0434\u0438\u043c \u043d\u0430 \u0432\u044b\u0437\u0432\u0430\u043d\u043d\u044b\u0439 \u0437\u0434\u0435\u0441\u044c <em>GetNodeAtIndex<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">private LinkedListNode&lt;PhpValue> GetNodeAtIndex(long index) {   var node = _baseList.First;   while (index-- > 0 &amp;&amp; node != null)   {     node = node.Next;   }    return node ?? throw new OutOfRangeException(); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0413\u043b\u044f\u0434\u0438\u0442\u0435 \u2013 \u043f\u043e\u0445\u043e\u0436\u0435, \u043c\u0435\u0442\u043e\u0434 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0433 \u0431\u044b \u0432\u0435\u0440\u043d\u0443\u0442\u044c <em>null<\/em>\u2026 \u041d\u043e \u043d\u0435 \u0442\u0443\u0442-\u0442\u043e \u0431\u044b\u043b\u043e \u2013 \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0446\u0438\u043a\u043b\u0430 <em>node<\/em> \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e <em>null<\/em>, \u0442\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e <em>null<\/em> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0435 \u043c\u043e\u0436\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u043d\u0435\u043f\u0440\u0435\u0434\u0432\u0438\u0434\u0435\u043d\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043c\u0435\u0442\u043e\u0434 <em>GetNodeAtIndex<\/em> \u043d\u0435 \u0432\u0435\u0440\u043d\u0451\u0442 <em>null<\/em>, \u043a\u0430\u043a \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c \u0432 \u043a\u043e\u0434\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <em>offsetGet<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public PhpValue offsetGet(PhpValue offset) {   var node = GetNodeAtIndex(offset); \/\/ potential null expected    Debug.Assert(node != null);    if (node != null) \/\/ always true     return node.Value;   else     return PhpValue.Null; \/\/ unreachable }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043b\u044e\u0431\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u043b\u0435\u0433\u043a\u043e \u043e\u0431\u043c\u0430\u043d\u0443\u0442\u044c\u0441\u044f. \u0412\u0435\u0434\u044c \u043f\u043e \u043a\u043e\u0434\u0443 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u043b\u0438\u0431\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043b\u0438\u0431\u043e <em>PhpValue.Null<\/em>. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0436\u0435 \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0430\u044f \u0432\u043e\u0442 \u0431\u0435\u0434\u0430 \u2014 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0435 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0445\u043e\u0440\u043e\u0448\u043e \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0441\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0435\u0433\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<p>  <\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442, \u043a\u0441\u0442\u0430\u0442\u0438, \u0438 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <em>offsetSet <\/em>\u0438\u0437 \u0442\u043e\u0433\u043e \u0436\u0435 \u043a\u043b\u0430\u0441\u0441\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public void offsetSet(PhpValue offset, PhpValue value) {   var node = GetNodeAtIndex(offset);    Debug.Assert(node != null);    if (node != null)     node.Value = value; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3022\/\">V3022<\/a>: Expression &#8216;node != null&#8217; is always true. Datastructures.cs 444<\/p>\n<p>  <\/p>\n<h2 id=\"prisvaivaniya-i-pereprisvaivaniya\">\u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u0435\u0440\u0435\u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f<\/h2>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u0434\u043e\u0445\u043d\u0443\u0442\u044c \u043e\u0442 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u0440\u0430\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0439 \u0438 \u0432\u044b\u043f\u0438\u0442\u044c \u043a\u0440\u0443\u0436\u0435\u0447\u043a\u0443 \u043a\u043e\u0444\u0435.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/7c0\/6ce\/581\/7c06ce5818dd0fd693d2859ee273e3d9.png\" alt=\"0855_Peachpie_check_ru\/image3.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/7c0\/6ce\/581\/7c06ce5818dd0fd693d2859ee273e3d9.png\"\/><\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043a\u0430 \u043f\u044c\u0451\u043c \u043a\u043e\u0444\u0435, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043e\u0447\u0435\u043d\u044c \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">internal StatStruct(Mono.Unix.Native.Stat stat) {   st_dev = (uint)stat.st_dev;   st_ctime = stat.st_ctime_nsec;   st_mtime = stat.st_mtime_nsec;   st_atime = stat.st_atime_nsec;   st_ctime = stat.st_ctime;   st_atime = stat.st_atime;   \/\/stat.st_blocks;   \/\/stat.st_blksize;   st_mtime = stat.st_mtime;   st_rdev = (uint)stat.st_rdev;   st_gid = (short)stat.st_gid;   st_uid = (short)stat.st_uid;   st_nlink = (short)stat.st_nlink;   st_mode = (FileModeFlags)stat.st_mode;   st_ino = (ushort)stat.st_ino;   st_size = stat.st_size; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f PVS-Studio:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3008\/\">V3008<\/a> The &#8216;st_ctime&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 78, 75. StatStruct.cs 78<\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3008\/\">V3008<\/a> The &#8216;st_atime&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 79, 77. StatStruct.cs 79<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a, \u0431\u0443\u0434\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0437\u0430\u043f\u0443\u0442\u0430\u043b\u0441\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f\u0445 \u0438 \u0433\u0434\u0435-\u0442\u043e \u043e\u043f\u0435\u0447\u0430\u0442\u0430\u043b\u0441\u044f. \u042d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u043b\u044f\u043c <em>st_ctime<\/em> \u0438 <em>st_atime<\/em> \u043f\u043e 2 \u0440\u0430\u0437\u0430 \u2013 \u0438 \u0432\u0435\u0434\u044c \u0432\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 \u043f\u0435\u0440\u0432\u044b\u0439.<\/p>\n<p>  <\/p>\n<p>\u0412\u0440\u043e\u0434\u0435 \u0431\u044b \u043e\u0448\u0438\u0431\u043a\u0430, \u0432\u0435\u0440\u043d\u043e? \u041d\u043e \u0442\u0430\u043a \u0432\u0435\u0434\u044c \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e! \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043d\u0430\u0432\u044b\u043a\u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u0433\u043b\u0443\u0431\u0438\u043d\u043d\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430 \u0438 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u043d\u0438\u0431\u0443\u0434\u044c \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u0437\u0430\u0447\u0435\u043c \u0432\u0441\u0451 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<p>  <\/p>\n<p>\u041d\u0443 \u0430 \u043f\u043e\u043a\u0430 \u0438\u0434\u0451\u043c \u0434\u0430\u043b\u044c\u0448\u0435 \ud83d\ude42<\/p>\n<p>  <\/p>\n<h2 id=\"eti-neizmenyaemye-stroki-ne-izmenit\">\u042d\u0442\u0438 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438\u2026 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c<\/h2>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u043d\u044b\u043c-\u0434\u0430\u0432\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0435\u0449\u0451 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 \u043f\u0435\u0440\u0432\u044b\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0438\u0437 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u043c\u044b \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u0438 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0441\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b <em>DateTime<\/em>. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0436\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u0430\u043f\u043e\u043c\u043d\u044f\u0442 \u043d\u0430\u043c \u043e\u0431 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0435 \u0441\u0442\u0440\u043e\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public TextElement Filter(IEncodingProvider enc,                           TextElement input,                           bool closing) {   string str = input.AsText(enc.StringEncoding);    if (pending)   {     if (str.Length == 0) str = \"\\r\";     else if (str[0] != '\\n') str.Insert(0, \"\\r\"); \/\/ &lt;=   }    str = str.Replace(\"\\r\\n\", \"\\n\");   if (str.Length != 0)   {     pending = str[str.Length - 1] == '\\r';      if (!closing &amp;&amp; pending) str.Remove(str.Length - 1, 1); \/\/ &lt;=   }    return new TextElement(str); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f PVS-Studio:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3010\/\">V3010<\/a> The return value of function &#8216;Insert&#8217; is required to be utilized. Filters.cs 150<\/li>\n<li><a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3010\/\">V3010<\/a> The return value of function &#8216;Remove&#8217; is required to be utilized. Filters.cs 161<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u2013 \u0445\u043e\u0442\u0435\u043b\u0438 \u0432\u043d\u0435\u0441\u0442\u0438 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043d\u043e \u043a\u0430\u043a-\u0442\u043e\u2026 \u043d\u0435 \u0441\u0440\u043e\u0441\u043b\u043e\u0441\u044c :(.<\/p>\n<p>  <\/p>\n<h2 id=\"or-throw--or-null\">or throw != or null<\/h2>\n<p>  <\/p>\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043c\u044b \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0438 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043e\u0436\u0438\u0434\u0430\u043b \u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>null<\/em>, \u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u043d\u0435\u0447\u0442\u043e \u043f\u043e\u0445\u043e\u0436\u0435\u0435, \u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0449\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public static bool stream_wrapper_register(....) {   \/\/ check if the scheme is already registered:   if (   string.IsNullOrEmpty(protocol)       || StreamWrapper.GetWrapperInternal(ctx, protocol) == null)   {     \/\/ TODO: Warning?     return false;   }    var wrapperClass = ctx.GetDeclaredTypeOrThrow(classname, true);   if (wrapperClass == null) \/\/ &lt;=   {     return false;   }    .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3022\/\">V3022<\/a>: Expression &#8216;wrapperClass == null&#8217; is always false. Streams.cs 555<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 \u0440\u0430\u0437\u0431\u043e\u0440, \u043d\u043e\u2026 \u0422\u0443\u0442 \u0438 \u043f\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u043c\u0435\u0442\u043e\u0434\u0430 \u0432\u0435\u0434\u044c \u0432\u0441\u0451 \u0432\u0438\u0434\u043d\u043e! <em>GetDeclaredTypeOrThrow<\/em> \u043a\u0430\u043a \u0431\u044b \u043d\u0430\u043c\u0435\u043a\u0430\u0435\u0442, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0447\u0442\u043e \u043d\u0435 \u0442\u0430\u043a, \u0442\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0440\u0435\u043b\u044f\u0442\u044c. \u0418 \u0432\u0435\u0434\u044c \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043e\u043f\u044f\u0442\u044c \u043a\u0430\u043a\u0430\u044f \u0448\u0442\u0443\u043a\u0430 \u2013 \u044d\u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u043c\u0435\u0442\u043e\u0434\u0443 <em>stream_wrapper_register<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e \u0437\u0430\u0434\u0443\u043c\u043a\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c <em>false<\/em>. \u0410\u0433\u0430, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043b\u043e\u0432\u0438\u0442\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435!<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u043e\u0431\u0449\u0435, \u043c\u044b \u0443\u0436\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0440\u0430\u043d\u0435\u0435 \u0441 \u043e\u0431\u043c\u0430\u043d\u044b\u0432\u0430\u044e\u0449\u0438\u043c\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u043c\u0438. \u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u043a\u0430\u043a \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 <em>PhpException.ArgumentNull<\/em> \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0435 \u0431\u0440\u043e\u0441\u0430\u043b \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435? \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0438 <em>GetDeclaredTypeOrThrow<\/em> \u0431\u0440\u043e\u0441\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">PhpTypeInfo GetDeclaredTypeOrThrow(string name, bool autoload = false) {   return GetDeclaredType(name, autoload) ??          throw PhpException.ClassNotFoundException(name); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0443, \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u043e\u0431\u043c\u0430\u043d\u0443\u043b\u0438 \u2013 \u0438 \u043f\u0440\u0430\u0432\u0434\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 :).<\/p>\n<p>  <\/p>\n<h2 id=\"strannyy-while-true\">\u0421\u0442\u0440\u0430\u043d\u043d\u044b\u0439 while true<\/h2>\n<p>  <\/p>\n<p>\u0411\u044b\u0432\u0430\u044e\u0442 \u0441\u043b\u0443\u0447\u0430\u0438, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u044f \u0446\u0438\u043a\u043b\u0430 <em>while<\/em> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>true<\/em>. \u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u043e \u0432 \u0446\u0435\u043b\u043e\u043c \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430 \u2013 \u0434\u043b\u044f \u0432\u044b\u0445\u043e\u0434\u0430 \u0438\u0437 \u0446\u0438\u043a\u043b\u0430 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <em>break, return<\/em>, \u043d\u0443 \u0438\u043b\u0438 \u0442\u0435 \u0436\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u041a\u0443\u0434\u0430 \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0440\u0430\u043d\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0446\u0438\u043a\u043b, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e <em>true<\/em>, \u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>true<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public static int stream_copy_to_stream(...., int offset = 0) {   ....   if (offset > 0)   {     int haveskipped = 0;      while (haveskipped != offset)  \/\/ &lt;=     {       TextElement data;        int toskip = offset - haveskipped;       if (toskip > from.GetNextDataLength())       {         data = from.ReadMaximumData();         if (data.IsNull) break;       }       else       {         data = from.ReadData(toskip, false);         if (data.IsNull) break; \/\/ EOF or error.         Debug.Assert(data.Length &lt;= toskip);       }        Debug.Assert(haveskipped &lt;= offset);     }   }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3022\/\">V3022<\/a>: Expression &#8216;haveskipped != offset&#8217; is always true. Streams.cs 769<\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>haveskipped<\/em> \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0430 \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u0446\u0438\u043a\u043b\u0430 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c 0. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0441 \u043d\u0435\u0439\u2026 \u0434\u043e \u0441\u0430\u043c\u043e\u0439 \u0441\u043c\u0435\u0440\u0442\u0438. \u041c\u0440\u0430\u0447\u043d\u043e\u0432\u0430\u0442\u043e \u0432\u044b\u0448\u043b\u043e, \u043d\u043e \u043a\u0430\u043a \u0435\u0441\u0442\u044c. \u041f\u043e \u0441\u0443\u0442\u0438, <em>haveskipped<\/em> \u2014 \u044d\u0442\u043e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <em>offset<\/em> \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0446\u0438\u043a\u043b\u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u0414\u0430 \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 (\u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c <a href=\"https:\/\/github.com\/peachpiecompiler\/peachpie\/blob\/cfbcc7cc34fb78097a53ec25b2ad78242160f22e\/src\/Peachpie.Library\/Streams\/Streams.cs#L751\">\u0442\u0443\u0442<\/a>).<\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u043b \u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0447\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u044f \u0446\u0438\u043a\u043b\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u044b\u043c? \u0412 \u0442\u0435\u043e\u0440\u0438\u0438 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e. \u041d\u043e \u0432\u0437\u0433\u043b\u044f\u043d\u0438\u0442\u0435 \u043d\u0430 \u0446\u0438\u043a\u043b \u043f\u043e\u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0432 \u043d\u0451\u043c \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0442\u0440\u0430\u043d\u043d\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">int toskip = offset - haveskipped;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0430\u043a\u043e\u0439 \u0432 \u044d\u0442\u043e\u043c \u0441\u043c\u044b\u0441\u043b, \u0435\u0441\u043b\u0438 <em>haveskipped<\/em> \u0432\u0441\u0435\u0433\u0434\u0430 \u0440\u0430\u0432\u0435\u043d 0?<\/p>\n<p>  <\/p>\n<p>\u0421 \u044d\u0442\u0438\u043c \u0446\u0438\u043a\u043b\u043e\u043c \u044f\u0432\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0442\u043e. \u0422\u043e \u043b\u0438 \u0442\u0443\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0430 \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u0442\u043e \u043b\u0438 \u0432\u0441\u0435 \u044d\u0442\u0438 \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0441\u0442\u0438 \u0441 <em>haveskipped<\/em> \u2013 \u043e\u0441\u0442\u0430\u043d\u043a\u0438 \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u0441\u0442\u0430\u0440\u044b\u0445 \u043d\u0435\u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0438\u0434\u0435\u0439.<\/p>\n<p>  <\/p>\n<h2 id=\"data--null--throw-nullreferenceexception\">data == null &amp;&amp; throw NullReferenceException<\/h2>\n<p>  <\/p>\n<p>\u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445. \u041d\u0430\u0448\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u0438 \u0432 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0435 PHP:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public string ReadStringContents(int maxLength) {   if (!CanRead) return null;   var result = StringBuilderUtilities.Pool.Get();    if (maxLength >= 0)   {     while (maxLength > 0 &amp;&amp; !Eof)     {       string data = ReadString(maxLength);       if (data == null &amp;&amp; data.Length > 0) break; \/\/ EOF or error.       maxLength -= data.Length;       result.Append(data);     }   }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3080\/\">V3080<\/a>: Possible null dereference. Consider inspecting &#8216;data&#8217;. PhpStream.cs 1382<\/p>\n<p>  <\/p>\n<p>\u0412 \u0446\u0438\u043a\u043b\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>data<\/em>. \u0415\u0441\u043b\u0438 \u043e\u043d\u0430 \u0440\u0430\u0432\u043d\u0430 <em>null<\/em> \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0435\u0451 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <em>Length<\/em> \u0438\u043c\u0435\u0435\u0442 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0442\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u044b\u0445\u043e\u0434 \u0438\u0437 \u0446\u0438\u043a\u043b\u0430. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u044d\u0442\u043e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 <em>Length<\/em> \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0438\u043c\u0435\u044e\u0449\u0435\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em>, \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u044e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u0417\u0434\u0435\u0441\u044c \u0436\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u0447\u0451\u0440\u043a\u043d\u0443\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 <em>data = null<\/em>.<\/p>\n<p>  <\/p>\n<p>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430, \u044f \u0431\u044b \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043b \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">data == null || data.Length == 0<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043d\u0435 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u2013 \u0434\u043b\u044f \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0431\u043e\u043b\u0435\u0435 \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430.<\/p>\n<p>  <\/p>\n<h2 id=\"ne-to-isklyuchenie\">\u041d\u0435 \u0442\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0411\u044b\u0432\u0430\u044e\u0442 \u0438 \u043e\u0448\u0438\u0431\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043d\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0441\u0442\u0440\u0430\u0448\u043d\u044b\u043c\u0438, \u043d\u043e \u0432\u0441\u0451 \u0436\u0435 \u043c\u043e\u0433\u0443\u0442 \u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 copy-paste \u043d\u0430\u043d\u0451\u0441 \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0443\u0434\u0430\u0440:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public bool addGlob(....) {   PhpException.FunctionNotSupported(nameof(addGlob));   return false; }  public bool addPattern(....) {   PhpException.FunctionNotSupported(nameof(addGlob));   return false; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3013\/\">V3013<\/a>: It is odd that the body of &#8216;addGlob&#8217; function is fully equivalent to the body of &#8216;addPattern&#8217; function (506, line 515). ZipArchive.cs 506<\/p>\n<p>  <\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <em>addGlob<\/em>, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438 \u0435\u0451 \u0432\u044b\u0437\u043e\u0432\u0435 \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u0441\u043e\u043e\u0431\u0449\u0430\u044e\u0449\u0435\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e <em>addGlob<\/em> \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0432\u0435\u0440\u0438\u043b\u0438? \u0410 \u0437\u0440\u044f! \u041d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0442\u0443\u0442 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u2013 \u044d\u0442\u043e \u0436 \u043d\u0430\u0448 \u0441\u0442\u0430\u0440\u044b\u0439 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0439 <em>PhpException<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public static class PhpException {   ....   public static void FunctionNotSupported(string\/*!*\/function)   {     Debug.Assert(!string.IsNullOrEmpty(function));      Throw(PhpError.Warning,           ErrResources.notsupported_function_called,           function);   }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043c\u044b \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0438 \u0440\u0430\u043d\u0435\u0435, \u0435\u0441\u043b\u0438 \u0432 \u043c\u0435\u0442\u043e\u0434 <em>Throw<\/em> \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>PhpError.Warning<\/em>, \u0442\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u041d\u043e \u0432\u0441\u0451 \u0436\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0448\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0432 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u043b\u043e\u0433 \u0438\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u043a\u0430\u043a-\u0442\u043e \u0435\u0449\u0451.<\/p>\n<p>  <\/p>\n<p>\u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0443 \u043a\u043e\u0434\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public bool addGlob(....) {   PhpException.FunctionNotSupported(nameof(addGlob));   return false; }  public bool addPattern(....) {   PhpException.FunctionNotSupported(nameof(addGlob));   return false; }<\/code><\/pre>\n<p>  <\/p>\n<p><em>addGlob<\/em> \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043a\u0430\u043a-\u0442\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043e \u2013 \u0431\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u043e \u0437\u0430\u043f\u0438\u0448\u0435\u0442\u0441\u044f \u0432 \u043b\u043e\u0433. <em>addPattern<\/em> \u0442\u043e\u0436\u0435 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u043f\u0440\u0430\u0432\u0434\u0430, \u0432\u043e\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043e <em>addGlob<\/em>.<\/p>\n<p>  <\/p>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u0438\u0437-\u0437\u0430 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0418\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043b\u0435\u0433\u043a\u043e \u2013 \u043f\u0440\u043e\u0441\u0442\u043e \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <em>addPattern<\/em> \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0430\u0442\u044c \u043f\u0440\u043e <em>addPattern<\/em>, \u0430 \u043d\u0435 \u043f\u0440\u043e <em>addGlob<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public bool addPattern(....) {   PhpException.FunctionNotSupported(nameof(addPattern));   return false; }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"stringjoin-ni-v-chyom-ne-vinovat\">String.Join \u043d\u0438 \u0432 \u0447\u0451\u043c \u043d\u0435 \u0432\u0438\u043d\u043e\u0432\u0430\u0442!<\/h2>\n<p>  <\/p>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0437\u0430\u0431\u044b\u0432\u0430\u044e\u0442 \u043e\u0431 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0438\u0437-\u0437\u0430 \u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0442\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e. \u0418\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e\u0439, \u0430 \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0435\u0451 \u0438 \u0432\u043e\u0432\u0441\u0435 \u043d\u0435\u0442. \u041f\u043e\u0445\u043e\u0436\u0435, \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u044d\u0442\u043e \u0438 \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <em>getallheaders<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public static PhpArray getallheaders(Context ctx) {   var webctx = ctx.HttpPhpContext;   if (webctx != null)   {     var headers = webctx.RequestHeaders;     if (headers != null)     {       var result = new PhpArray(16);        foreach (var h in headers)       {         result[h.Key] = string.Join(\", \", h.Value) ?? string.Empty;       }        return result;     }   }    return null; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3022\/\">V3022<\/a>: Expression &#8216;string.Join(&#171;, &#171;, h.Value)&#8217; is always not null. The operator &#8216;??&#8217; is excessive. Web.cs 932<\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 &#171;??&#187; \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u0434\u0435\u0441\u044c \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u0435\u0442\u043e\u0434 <em>string.Join<\/em> \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0432\u0435\u0440\u043d\u0451\u0442 <em>null<\/em>. \u0410 \u0432\u043e\u0442 \u0431\u0440\u043e\u0441\u0438\u0442\u044c <em>ArgumentNullException<\/em> \u2013 \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430!<\/p>\n<p>  <\/p>\n<p><em>string.Join <\/em>\u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0432\u043d\u0430 <em>null<\/em>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0440\u043e\u043a\u0443 \u043a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">result[h.Key] = h.Value != null ? string.Join(\", \",h.Value) : string.Empty;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u043e\u043e\u0431\u0449\u0435, \u044f \u0445\u043e\u0442\u0435\u043b \u0443\u0437\u043d\u0430\u0442\u044c, \u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u044d\u0442\u043e <em>Value<\/em> \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0431\u044b\u0442\u044c <em>null<\/em>. \u0410 \u0442\u043e, \u043c\u043e\u0436\u0435\u0442, \u0442\u0443\u0442 \u0438 \u0432\u043e\u0432\u0441\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u043d\u0438\u043a\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u043e\u0442\u043a\u0443\u0434\u0430 \u043f\u0440\u0438\u0448\u043b\u0430 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f <em>headers<\/em>.<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public static PhpArray getallheaders(Context ctx) {   var webctx = ctx.HttpPhpContext;   if (webctx != null)   {     var headers = webctx.RequestHeaders;     ....   }    return null; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>headers<\/em> \u0432\u0437\u044f\u0442\u043e \u0438\u0437 <em>webctx.RequestHeaders<\/em>, \u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>webctx<\/em>, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0431\u0435\u0440\u0451\u0442\u0441\u044f \u0438\u0437 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <em>HttpPhpContext <\/em>\u043e\u0431\u044a\u0435\u043a\u0442\u0430 <em>ctx<\/em>. \u041d\u0443 \u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <em>HttpPhpContext<\/em>\u2026 \u0427\u0442\u043e \u0436, \u0433\u043b\u044f\u0434\u0438\u0442\u0435 \u0441\u0430\u043c\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">partial class Context : IEncodingProvider {   ....   public virtual IHttpPhpContext? HttpPhpContext => null;   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e, \u0432\u0438\u0434\u0438\u043c\u043e, \u043d\u0435\u043a\u0438\u0439 &#171;\u043d\u0430 \u043f\u043e\u0442\u043e\u043c&#187;. \u0415\u0441\u043b\u0438 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u0442\u0435 \u043d\u0430 \u043c\u0435\u0442\u043e\u0434 <em>getallheaders<\/em> \u0435\u0449\u0451 \u0440\u0430\u0437\u043e\u043a, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u043e\u043d, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <em>null<\/em>.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e, \u043e\u043f\u044f\u0442\u044c \u043f\u043e\u0432\u0435\u0440\u0438\u043b\u0438? \u041d\u0443 \u0447\u0442\u043e \u0436\u0435 \u0441 \u0432\u0430\u043c\u0438 \u0434\u0435\u043b\u0430\u0442\u044c! \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e-\u0442\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0436\u0435 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u043e, \u043d\u0430\u0434\u043e \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u043e\u0432. \u041b\u0438\u0447\u043d\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430 \u044d\u0442\u043e\u043c \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u2013 \u0432\u0441\u0451 \u0436\u0435 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<h2 id=\"malenkoe-prisvaivanie-v-bolshom-metode\">\u041c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0432 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435<\/h2>\n<p>  <\/p>\n<p>\u0427\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0438 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043c\u0435\u0442\u043e\u0434, \u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0432 \u043d\u0451\u043c \u043e\u0448\u0438\u0431\u043a\u0438. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u043e \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u0443\u0447\u0435 \u043a\u043e\u0434\u0430, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0447\u0435\u043d\u044c \u0441\u0442\u0440\u0430\u0448\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435 \u043c\u0435\u043d\u044f\u0442\u044c. \u041d\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0441\u0442\u0430\u0440\u044b\u0439 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043f\u0440\u0435\u0436\u043d\u0438\u043c, \u043a\u043e\u0435-\u043a\u0430\u043a \u044d\u0442\u0430 \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0432\u0440\u043e\u0434\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u0443 \u0438 \u0441\u043b\u0430\u0432\u0430 \u0431\u043e\u0433\u0443. \u041d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u043a\u043e\u0434\u0435 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0441\u0442\u0438. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u043c\u0435\u0442\u043e\u0434 <em>inflate_fast<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">internal int inflate_fast(....) {   ....   int r;   ....   if (c > e)   {     \/\/ if source crosses,     c -= e; \/\/ wrapped copy     if (q - r > 0 &amp;&amp; e > (q - r))     {       do       {         s.window[q++] = s.window[r++];       }       while (--e != 0);     }     else     {       Array.Copy(s.window, r, s.window, q, e);       q += e; r += e; e = 0;                     \/\/ &lt;=     }     r = 0;                                       \/\/ &lt;=   }   .... }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3008\/\">V3008<\/a>: The &#8216;r&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 621, 619. InfCodes.cs 621<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u043e\u0442 <a href=\"https:\/\/github.com\/peachpiecompiler\/peachpie\/blob\/cfbcc7cc34fb78097a53ec25b2ad78242160f22e\/src\/Peachpie.Library\/Zlib\/InfCodes.cs#L482\">\u0441\u0441\u044b\u043b\u043a\u0430<\/a> \u043d\u0430 \u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434. \u041c\u0435\u0442\u043e\u0434 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0438\u0437 \u0434\u0432\u0443\u0445 \u0441\u043e\u0442\u0435\u043d \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430 \u0441 \u043a\u0443\u0447\u0435\u0439 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439. \u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u043d\u0451\u043c \u044f\u0432\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u043e.<\/p>\n<p>  <\/p>\n<p>\u0421\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0435 \u2013 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432 \u0431\u043b\u043e\u043a\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>r<\/em> \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0430 \u0437\u0430\u0442\u0435\u043c \u043e\u043d\u043e \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0443\u043b\u0451\u043c. \u0421\u043b\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u0442\u0430\u043a. \u0422\u043e \u043b\u0438 \u043e\u0431\u043d\u0443\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a-\u0442\u043e \u043d\u0435 \u0442\u0430\u043a, \u0442\u043e \u043b\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f <em>r += e<\/em> \u0437\u0434\u0435\u0441\u044c \u043b\u0438\u0448\u043d\u044f\u044f.<\/p>\n<p>  <\/p>\n<h2 id=\"null-dereference-v-logicheskom-vyrazhenii\">null dereference \u0432 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438<\/h2>\n<p>  <\/p>\n<p>\u0420\u0430\u043d\u0435\u0435 \u043c\u044b \u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0435 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u044e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public static bool IsAutoloadDeprecated(Version langVersion) {   \/\/ >= 7.2   return    langVersion != null &amp;&amp; langVersion.Major > 7           || (langVersion.Major == 7 &amp;&amp; langVersion.Minor >= 2); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3080\/\">V3080<\/a>: Possible null dereference. Consider inspecting &#8216;langVersion&#8217;. AnalysisFacts.cs 20<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <em>langVersion<\/em> \u043d\u0435 \u0440\u0430\u0432\u0435\u043d <em>null<\/em>. \u0421\u0442\u0430\u043b\u043e \u0431\u044b\u0442\u044c, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b, \u0447\u0442\u043e \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u043d <em>null<\/em>. \u0421\u043f\u0430\u0441\u0430\u0435\u0442 \u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043e\u0442 \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f?<\/p>\n<p>  <\/p>\n<p>\u0423\u0432\u044b, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>langVersion<\/em> \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u0430 <em>null<\/em>, \u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e <em>false<\/em>. \u041f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u0436\u0435 \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u0438. \u042d\u0442\u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439 \u043d\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u2013 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u043e\u0435 \u0440\u0430\u043d\u0435\u0435, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0431\u044b\u043b\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u043a\u0443:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/ccc\/cdd\/78d\/ccccdd78dea9862ae01a28b9d77dacea.png\" alt=\"0855_Peachpie_check_ru\/image5.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/ccc\/cdd\/78d\/ccccdd78dea9862ae01a28b9d77dacea.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439, \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043b\u0438\u0431\u043e \u043f\u0435\u0440\u0435\u043f\u0443\u0442\u0430\u043b\u0438 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u044b \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432, \u043b\u0438\u0431\u043e \u043f\u043e\u043f\u0440\u043e\u0441\u0442\u0443 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0441\u043a\u043e\u0431\u043a\u0443 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043c\u0435\u0442\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"cs\">public static bool IsAutoloadDeprecated(Version langVersion) {   \/\/ >= 7.2   return    langVersion != null           &amp;&amp; (   langVersion.Major > 7               || langVersion.Major == 7 &amp;&amp; langVersion.Minor >= 2); }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"vot-i-vsyo\">\u0412\u043e\u0442 \u0438 \u0432\u0441\u0451!<\/h2>\n<p>  <\/p>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0435\u0442. \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u043b \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 5 \u0441\u043e\u0442\u0435\u043d \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439 \u043d\u0430 \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0435\u043a\u0442, \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0435\u043c\u0430\u043b\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0432\u0441\u0451 \u0436\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0430\u043c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e <a href=\"https:\/\/pvs-studio.com\/ru\/pvs-studio\/download\/?utm_source=peachpie-article&amp;utm_medium=link_download\">\u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c PVS-Studio<\/a> \u0438 \u043f\u043e\u0433\u043b\u044f\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u043d\u043e\u0432\u0435\u043d\u044c\u043a\u043e\u0433\u043e \u043e\u043d \u0435\u0449\u0451 \u043d\u0430\u0439\u0434\u0451\u0442 \u0432 \u044d\u0442\u043e\u043c \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445. \u041a\u0442\u043e \u0437\u043d\u0430\u0435\u0442, \u0431\u044b\u0442\u044c \u043c\u043e\u0436\u0435\u0442, \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u043d\u0438\u0431\u0443\u0434\u044c \u043e\u0448\u0438\u0431\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0434\u0430\u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435, \u0447\u0435\u043c \u0432\u0441\u0451, \u0447\u0442\u043e \u044f \u0442\u0443\u0442 \u043d\u0430\u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b :). \u041d\u0443 \u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043f\u0438\u0448\u0438\u0442\u0435 \u043e \u043d\u0438\u0445 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u0432\u0430\u043c\u0438 \u0431\u0430\u0433\u0438 \u0434\u0430\u0436\u0435 \u043f\u043e\u043f\u0430\u0434\u0443\u0442 \u0432 \u0422\u043e\u043f-10 \u043e\u0448\u0438\u0431\u043e\u043a 2021! <\/p>\n<p>  <\/p>\n<p>\u0416\u0435\u043b\u0430\u044e \u0443\u0434\u0430\u0447\u0438!<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0441 \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0435\u0439, \u0442\u043e \u043f\u0440\u043e\u0448\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434: Nikita Lipilin. <a href=\"https:\/\/habr.com\/en\/company\/pvs-studio\/blog\/573288\/\">Is PHP compilable?! PVS-Studio searches for errors in PeachPie<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/573296\/\"> https:\/\/habr.com\/ru\/articles\/573296\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/qh\/bk\/gs\/qhbkgsxgbuebwyyn9tkhiruq8tg.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/qh\/bk\/gs\/qhbkgsxgbuebwyyn9tkhiruq8tg.jpeg\" data-blurred=\"true\"\/>  <\/p>\n<p>PHP \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u043a\u0430\u043a \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439\u0441\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0430\u0439\u0442\u043e\u0432. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u0438\u0435 \u0437\u043d\u0430\u044e\u0442, \u0447\u0442\u043e \u0434\u043b\u044f PHP \u0435\u0441\u0442\u044c \u0435\u0449\u0451 \u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u043e\u0434 .NET \u2014 PeachPie. \u041d\u043e \u0432\u043e\u0442 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043d \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u043d? \u0421\u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043d\u0430\u0439\u0442\u0438 \u0432 \u044d\u0442\u043e\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0436\u0435 \u0443\u0437\u043d\u0430\u0435\u043c!<\/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-401396","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/401396","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=401396"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/401396\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=401396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=401396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=401396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}