diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..090a1f02dfe2a86c45ebc2045a23fd0b9b1009c1
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+.idea
+.DS_Store
diff --git a/README.md b/README.md
index 8ba2a0707a02b96eb46e6bfb7ec7fa48b9fc5f80..cc74f12704e182b58245e984e879d919e4f784ce 100644
--- a/README.md
+++ b/README.md
@@ -1,92 +1,4 @@
-# mentor_workshop
+# Высоконагруженные системы и оптимизация кода (семинар наставника)
+## Задание 1. Тестовое для Вконтакте
+В папке vk_test находится исправленная версия скрипта, которая собирается KPHP, а также скомпилированное приложение.
 
-
-
-## Getting started
-
-To make it easy for you to get started with GitLab, here's a list of recommended next steps.
-
-Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
-
-## Add your files
-
-- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
-- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
-
-```
-cd existing_repo
-git remote add origin https://git.miem.hse.ru/nivolkov/mentor_workshop.git
-git branch -M master
-git push -uf origin master
-```
-
-## Integrate with your tools
-
-- [ ] [Set up project integrations](https://git.miem.hse.ru/nivolkov/mentor_workshop/-/settings/integrations)
-
-## Collaborate with your team
-
-- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
-- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
-- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
-- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
-- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
-
-## Test and Deploy
-
-Use the built-in continuous integration in GitLab.
-
-- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
-- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
-- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
-- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
-- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
-
-***
-
-# Editing this README
-
-When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
-
-## Suggestions for a good README
-Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
-
-## Name
-Choose a self-explaining name for your project.
-
-## Description
-Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
-
-## Badges
-On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
-
-## Visuals
-Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
-
-## Installation
-Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
-
-## Usage
-Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
-
-## Support
-Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
-
-## Roadmap
-If you have ideas for releases in the future, it is a good idea to list them in the README.
-
-## Contributing
-State if you are open to contributions and what your requirements are for accepting them.
-
-For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
-
-You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
-
-## Authors and acknowledgment
-Show your appreciation to those who have contributed to the project.
-
-## License
-For open source projects, say how it is licensed.
-
-## Project status
-If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
diff --git a/vk_test/kphp_out/kphp/_lib_version.h b/vk_test/kphp_out/kphp/_lib_version.h
new file mode 100644
index 0000000000000000000000000000000000000000..db632a3ee1a4f86c23499ce682856c01516b4163
--- /dev/null
+++ b/vk_test/kphp_out/kphp/_lib_version.h
@@ -0,0 +1,7 @@
+//crc64:a5b4bc248eb75d54
+//crc64_with_comments:0000000000000000
+// Runtime sha256: b16a22e6007a8ef6c80e566fe2468b55753b520e616076d4906c89288372d35a
+// CXX: clang++
+// CXXFLAGS DEFAULT: -O2 -ggdb -iquote/Users/nivolkov/Desktop/kphp/ -iquote /Users/nivolkov/Desktop/kphp/objs/generated/auto/runtime -Wall -fwrapv -Wno-parentheses -Wno-trigraphs -fno-strict-aliasing -fno-omit-frame-pointer -Winvalid-pch -fpch-preprocess -Wno-invalid-source-encoding -std=c++17 -I/usr/local/include -I/usr/local/opt/openssl/include -I/opt/homebrew/include -iquote/Users/nivolkov/Desktop/mentor_workshop/vk_test/kphp_out/kphp/
+// CXXFLAGS WITH EXTRA: -O2 -ggdb -iquote/Users/nivolkov/Desktop/kphp/ -iquote /Users/nivolkov/Desktop/kphp/objs/generated/auto/runtime -Wall -fwrapv -Wno-parentheses -Wno-trigraphs -fno-strict-aliasing -fno-omit-frame-pointer -Winvalid-pch -fpch-preprocess -Wno-invalid-source-encoding -std=c++17 -I/usr/local/include -I/usr/local/opt/openssl/include -I/opt/homebrew/include -iquote/Users/nivolkov/Desktop/mentor_workshop/vk_test/kphp_out/kphp/
+
diff --git a/vk_test/kphp_out/kphp/_loader.h b/vk_test/kphp_out/kphp/_loader.h
new file mode 100644
index 0000000000000000000000000000000000000000..f03b07eb7248c092638cd60da1c976680d798943
--- /dev/null
+++ b/vk_test/kphp_out/kphp/_loader.h
@@ -0,0 +1,25 @@
+//crc64:ca7b983741621055
+//crc64_with_comments:0000000000000000
+#include "runtime-headers.h"
+
+template<typename T>
+typename Storage::loader<T>::loader_fun Storage::loader<T>::get_function(int tag) noexcept {
+  switch(tag){
+    case -1050344780: return Storage::load_implementation_helper<int64_t, T>::load;
+    case -1001899880: return Storage::load_implementation_helper<void, T>::load;
+    case -878368721: return Storage::load_implementation_helper<class_instance<C$PDOStatement>, T>::load;
+    case -214445580: return Storage::load_implementation_helper<array< array< mixed > >, T>::load;
+    case -213075060: return Storage::load_implementation_helper<Optional < int64_t >, T>::load;
+    case 102294406: return Storage::load_implementation_helper<class_instance<C$VK$TL$RpcResponse>, T>::load;
+    case 225563081: return Storage::load_implementation_helper<class_instance<C$KphpJobWorkerResponse>, T>::load;
+    case 413252784: return Storage::load_implementation_helper<mixed, T>::load;
+    case 487172279: return Storage::load_implementation_helper<array< class_instance<C$VK$TL$RpcResponse> >, T>::load;
+    case 1105796786: return Storage::load_implementation_helper<array< mixed >, T>::load;
+    case 1180395962: return Storage::load_implementation_helper<Optional < array< mixed > >, T>::load;
+    case 1518202965: return Storage::load_implementation_helper<bool, T>::load;
+    case 1631794328: return Storage::load_implementation_helper<Optional < string >, T>::load;
+    case 2030449513: return Storage::load_implementation_helper<thrown_exception, T>::load;
+  }
+  php_assert(0);
+}
+
diff --git a/vk_test/kphp_out/kphp/_shape_keys.cpp b/vk_test/kphp_out/kphp/_shape_keys.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..cf33887540095d9cae283e65dc1679d8db817522
--- /dev/null
+++ b/vk_test/kphp_out/kphp/_shape_keys.cpp
@@ -0,0 +1,12 @@
+//crc64:86ce23b747569820
+//crc64_with_comments:0000000000000000
+#include "runtime-headers.h"
+
+void init_shape_demangler() noexcept {
+  std::unordered_map<std::int64_t, std::string_view> shape_keys_storage{
+  };
+
+  vk::singleton<ShapeKeyDemangle>::get().init(std::move(shape_keys_storage));
+}
+
+
diff --git a/vk_test/kphp_out/kphp/_tagger.cpp b/vk_test/kphp_out/kphp/_tagger.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..a45f19c4d58c9026cc42ec97aa79205ced9658b4
--- /dev/null
+++ b/vk_test/kphp_out/kphp/_tagger.cpp
@@ -0,0 +1,75 @@
+//crc64:cdea7ddbe36e0abb
+//crc64_with_comments:0000000000000000
+#include "runtime-headers.h"
+
+template<>
+int Storage::tagger<int64_t>::get_tag()  noexcept {
+  return -1050344780;
+}
+
+template<>
+int Storage::tagger<void>::get_tag()  noexcept {
+  return -1001899880;
+}
+
+template<>
+int Storage::tagger<class_instance<C$PDOStatement>>::get_tag()  noexcept {
+  return -878368721;
+}
+
+template<>
+int Storage::tagger<array< array< mixed > >>::get_tag()  noexcept {
+  return -214445580;
+}
+
+template<>
+int Storage::tagger<Optional < int64_t >>::get_tag()  noexcept {
+  return -213075060;
+}
+
+template<>
+int Storage::tagger<class_instance<C$VK$TL$RpcResponse>>::get_tag()  noexcept {
+  return 102294406;
+}
+
+template<>
+int Storage::tagger<class_instance<C$KphpJobWorkerResponse>>::get_tag()  noexcept {
+  return 225563081;
+}
+
+template<>
+int Storage::tagger<mixed>::get_tag()  noexcept {
+  return 413252784;
+}
+
+template<>
+int Storage::tagger<array< class_instance<C$VK$TL$RpcResponse> >>::get_tag()  noexcept {
+  return 487172279;
+}
+
+template<>
+int Storage::tagger<array< mixed >>::get_tag()  noexcept {
+  return 1105796786;
+}
+
+template<>
+int Storage::tagger<Optional < array< mixed > >>::get_tag()  noexcept {
+  return 1180395962;
+}
+
+template<>
+int Storage::tagger<bool>::get_tag()  noexcept {
+  return 1518202965;
+}
+
+template<>
+int Storage::tagger<Optional < string >>::get_tag()  noexcept {
+  return 1631794328;
+}
+
+template<>
+int Storage::tagger<thrown_exception>::get_tag()  noexcept {
+  return 2030449513;
+}
+
+
diff --git a/vk_test/kphp_out/kphp/cl/C@Admin.h b/vk_test/kphp_out/kphp/cl/C@Admin.h
new file mode 100644
index 0000000000000000000000000000000000000000..84e029c10ecfa5124bdeb778c994a4c22134f98e
--- /dev/null
+++ b/vk_test/kphp_out/kphp/cl/C@Admin.h
@@ -0,0 +1,16 @@
+//crc64:13539aeb53b045c4
+//crc64_with_comments:0000000000000000
+#pragma once
+#include "cl/C@User.h"
+
+struct C$Admin final : public C$User {
+  const char *get_class() const  noexcept  final {
+    return R"(Admin)";
+  }
+
+  int get_hash() const  noexcept  final {
+    return -512819899;
+  }
+
+  };
+
diff --git a/vk_test/kphp_out/kphp/cl/C@User.h b/vk_test/kphp_out/kphp/cl/C@User.h
new file mode 100644
index 0000000000000000000000000000000000000000..e1386127c3a8d87da9698021a6c5d46bfd71dba2
--- /dev/null
+++ b/vk_test/kphp_out/kphp/cl/C@User.h
@@ -0,0 +1,18 @@
+//crc64:04ccaf927d46330f
+//crc64_with_comments:0000000000000000
+#pragma once
+
+struct C$User: public refcountable_polymorphic_php_classes<abstract_refcountable_php_interface> {
+  bool $is_valid{};
+  string $name{};
+  virtual ~C$User() = default;
+  virtual const char *get_class() const  noexcept {
+    return R"(User)";
+  }
+
+  virtual int get_hash() const  noexcept {
+    return -1368671659;
+  }
+
+  };
+
diff --git a/vk_test/kphp_out/kphp/index_file b/vk_test/kphp_out/kphp/index_file
new file mode 100644
index 0000000000000000000000000000000000000000..91114b1c3da24e02d17c8204c32618d8e22420d7
--- /dev/null
+++ b/vk_test/kphp_out/kphp/index_file
@@ -0,0 +1,32 @@
+31
+_tagger.cpp 14837810305692469947 0
+o_vars_0/vars0.cpp 3760848667833712949 0
+_shape_keys.cpp 9713740716367583264 0
+main.cpp 4384715545164420572 0
+_lib_version.h 11940375377265253716 0
+o_l/lambda@ue4553af9dc6d7c38_0.h 4739867834457754310 5650504050945546944
+init_php_scripts.cpp 8233158303334084618 0
+o_17/src__functions_txt5e94a5dedeb30e71.cpp 18179857604147402159 11304385889120538026
+o_24/main.cpp 15763042754390023686 10382079157838253072
+o_24/validate_accounts.cpp 9963545309104282167 7633753223745282971
+o_24/AccountFactory@@newAccount.h 6743495579319053306 0
+o_24/AccountFactory@@newAccount.cpp 7377574965875221111 10129115133639436618
+o_vars_reset/vars_reset.1.src_mainfa654ae0967e6769.cpp 6530371101645616878 0
+o_24/src_mainfa654ae0967e6769.cpp 3769313131631888360 4693911299499770734
+o_24/print_names.cpp 8908467400995471763 9884110527058069788
+cl/C@Admin.h 1392627045299668420 0
+o_24/validate_accounts.h 12498946854393219975 0
+vars.cpp 17956016536881388923 0
+o_24/Admin@@__construct.h 5116030535720694965 15049504791859067957
+o_l/lambda@u500ee028fdef5792_0.h 15082864725067467432 8176626056672661945
+vars_reset.src_mainfa654ae0967e6769.cpp 1783646353084113214 0
+cl/C@User.h 345844315102524175 0
+o_17/src__functions_txt5e94a5dedeb30e71.h 14364429614184952889 0
+o_vars_reset/vars_reset.0.src_mainfa654ae0967e6769.cpp 8988359593282477343 0
+o_24/collect_names.h 4776366634356349984 0
+o_24/User@@__construct.h 17965505412276190823 12590643254564232446
+_loader.h 14590422780884422741 0
+o_24/print_names.h 15102795859053696461 0
+o_24/collect_names.cpp 6710097218383926494 17348795175391259503
+o_24/main.h 14092479454207406965 0
+o_24/src_mainfa654ae0967e6769.h 10011174090619011779 0
diff --git a/vk_test/kphp_out/kphp/init_php_scripts.cpp b/vk_test/kphp_out/kphp/init_php_scripts.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..25aa442e977beba1326f6048b8178ae5a4a6b7e2
--- /dev/null
+++ b/vk_test/kphp_out/kphp/init_php_scripts.cpp
@@ -0,0 +1,41 @@
+//crc64:72420ddb11c9300a
+//crc64_with_comments:0000000000000000
+#include "runtime-headers.h"
+#include "server/php-init-scripts.h"
+#include "o_24/src_mainfa654ae0967e6769.h"
+
+void global_init_php_scripts() noexcept ;
+void init_php_scripts() noexcept ;
+
+void const_vars_init() noexcept ;
+
+void tl_str_const_init() noexcept ;
+const char *get_php_scripts_version() noexcept {
+  return "unknown";
+}
+
+char **get_runtime_options(int *count) noexcept {
+  return nullptr;
+}
+
+void global_init_php_scripts()  noexcept {
+  const_vars_init();
+}
+
+void f$src_mainfa654ae0967e6769$run()  noexcept {
+  TRY_CALL_VOID (void, f$src_mainfa654ae0967e6769());
+  finish (0, true);
+}
+
+void f$src_mainfa654ae0967e6769$global_reset()  noexcept {
+  void f$src_mainfa654ae0967e6769$global_vars_reset();
+  f$src_mainfa654ae0967e6769$global_vars_reset();
+}
+
+void init_php_scripts()  noexcept {
+  void init_shape_demangler();
+  init_shape_demangler();
+
+  f$src_mainfa654ae0967e6769$global_reset();
+  set_script (f$src_mainfa654ae0967e6769$run, f$src_mainfa654ae0967e6769$global_reset);
+}
diff --git a/vk_test/kphp_out/kphp/main.cpp b/vk_test/kphp_out/kphp/main.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..c19674bc08f02972be054f98f03984f1b84ed3de
--- /dev/null
+++ b/vk_test/kphp_out/kphp/main.cpp
@@ -0,0 +1,7 @@
+//crc64:3cd9a38e9ea895dc
+//crc64_with_comments:0000000000000000
+#include "server/php-engine.h"
+
+int main(int argc, char *argv[]) {
+  return run_main(argc, argv, php_mode::server);
+}
diff --git a/vk_test/kphp_out/kphp/o_17/src__functions_txt5e94a5dedeb30e71.cpp b/vk_test/kphp_out/kphp/o_17/src__functions_txt5e94a5dedeb30e71.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..542f801a6eff90dca0fb67e4c5424ca77236685a
--- /dev/null
+++ b/vk_test/kphp_out/kphp/o_17/src__functions_txt5e94a5dedeb30e71.cpp
@@ -0,0 +1,100 @@
+//crc64:fc4bd42b8263d5af
+//crc64_with_comments:9ce13f12acf7cdaa
+#include "runtime-headers.h"
+#include "o_17/src__functions_txt5e94a5dedeb30e71.h"
+extern mixed v$_COOKIE;
+
+extern mixed v$_ENV;
+
+extern mixed v$_FILES;
+
+extern mixed v$_GET;
+
+extern mixed v$_POST;
+
+extern mixed v$_REQUEST;
+
+extern mixed v$_SERVER;
+
+extern mixed v$argc;
+
+extern mixed v$argv;
+
+extern string v$d$PHP_SAPI;
+
+extern bool v$src__functions_txt5e94a5dedeb30e71$called;
+
+//source = [_functions_txt]
+//4: define('TODO', -1);
+Optional < bool > f$src__functions_txt5e94a5dedeb30e71() noexcept  {
+  v$src__functions_txt5e94a5dedeb30e71$called = true;
+//5: define('TODO_OVERLOAD', -1);
+//6: 
+//7: define('PHP_INT_MAX', 9223372036854775807);
+//8: define('PHP_INT_MIN', -9223372036854775808);
+//9: define('PHP_INT_SIZE', 8);
+//10: define('PHP_EOL', "\n ");
+//11: 
+//12: if (0) {
+  if (f$boolval (0_i64)) {
+//13:   define('PHP_SAPI', php_sapi_name());//"Defined in source code"
+    v$d$PHP_SAPI = f$php_sapi_name();
+  };
+//97:     public function addServer (string $host, int $port = 11211, bool $persistent = true, int $weight = 1, float $timeout = 1, int $retry_interval = 15, bool $status = true, mixed $failure_callback = null, int $timeoutms = 0) ::: bool;
+//98: 
+//99:     public function rpc_connect (string $host, int $port, mixed $default_actor_id = 0, float $timeout = 0.3, float $connect_timeout = 0.3, float $reconnect_timeout = 17.0) ::: bool;
+//100: }
+//101: 
+//102: final class mysqli {
+//103:     private function __construct() ::: \mysqli;
+//104: }
+//105: 
+//106: /** @var mixed $_SERVER */
+  ;
+//107: global $_SERVER;
+  {
+  };
+//108: /** @var mixed $_GET */
+  ;
+//109: global $_GET;
+  {
+  };
+//110: /** @var mixed $_POST */
+  ;
+//111: global $_POST;
+  {
+  };
+//112: /** @var mixed $_FILES */
+  ;
+//113: global $_FILES;
+  {
+  };
+//114: /** @var mixed $_COOKIE */
+  ;
+//115: global $_COOKIE;
+  {
+  };
+//116: /** @var mixed $_REQUEST */
+  ;
+//117: global $_REQUEST;
+  {
+  };
+//118: /** @var mixed $_ENV */
+  ;
+//119: global $_ENV;
+  {
+  };
+//120: /** @var mixed $argc */
+  ;
+//121: global $argc;
+  {
+  };
+//122: /** @var mixed $argv */
+  ;
+//123: global $argv;
+  {
+  };
+  return Optional<bool>{};
+}
+
+
diff --git a/vk_test/kphp_out/kphp/o_17/src__functions_txt5e94a5dedeb30e71.h b/vk_test/kphp_out/kphp/o_17/src__functions_txt5e94a5dedeb30e71.h
new file mode 100644
index 0000000000000000000000000000000000000000..a805debb0d00eac8ead3603d9ab573f94d509388
--- /dev/null
+++ b/vk_test/kphp_out/kphp/o_17/src__functions_txt5e94a5dedeb30e71.h
@@ -0,0 +1,6 @@
+//crc64:c758b4a0ca987439
+//crc64_with_comments:0000000000000000
+#pragma once
+#include "runtime-headers.h"
+Optional < bool > f$src__functions_txt5e94a5dedeb30e71() noexcept ;
+
diff --git a/vk_test/kphp_out/kphp/o_24/AccountFactory@@newAccount.cpp b/vk_test/kphp_out/kphp/o_24/AccountFactory@@newAccount.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f8e791409b80b7ca03cc0184c7a3ee86653d762c
--- /dev/null
+++ b/vk_test/kphp_out/kphp/o_24/AccountFactory@@newAccount.cpp
@@ -0,0 +1,44 @@
+//crc64:66626957e8cea277
+//crc64_with_comments:8c91d88c359ca94a
+#include "runtime-headers.h"
+#include "o_24/AccountFactory@@newAccount.h"
+#include "o_24/Admin@@__construct.h"
+#include "o_24/User@@__construct.h"
+extern string v$const_string$us9ac75637e16efd45;
+
+//source = [main.php]
+//24:     public static function newAccount(string $name, string $account_type) {
+class_instance<C$User> f$AccountFactory$$newAccount(string const &v$name, string const &v$account_type) noexcept  {
+  string v$condition_on_switch$u57922b5373992df0_0;
+  bool v$matched_with_one_case$u57922b5373992df0_0 = false;
+//25:         switch ($account_type) {
+  {
+    v$condition_on_switch$u57922b5373992df0_0 = f$strval (v$account_type);
+    v$matched_with_one_case$u57922b5373992df0_0 = false;
+    switch (v$condition_on_switch$u57922b5373992df0_0.hash()) {
+      case -1652293684569292275:
+      if (!v$matched_with_one_case$u57922b5373992df0_0) {
+//26:             case "Admin":
+        if (!equals (v$condition_on_switch$u57922b5373992df0_0, v$const_string$us9ac75637e16efd45)) {
+          goto switch_goto$u57922b5373992df0_0;
+        } else {
+          v$matched_with_one_case$u57922b5373992df0_0 = true;
+        }
+      }
+//27:                 return new Admin($name);
+      {
+        return f$Admin$$__construct(class_instance<C$Admin>().alloc(), v$name);
+      }
+      default:
+      switch_goto$u57922b5373992df0_0:;
+      v$matched_with_one_case$u57922b5373992df0_0 = true;
+//28:             default:
+//29:                 return new User($name);
+      {
+        return f$User$$__construct(class_instance<C$User>().alloc(), v$name);
+      }
+    }
+  };
+}
+
+
diff --git a/vk_test/kphp_out/kphp/o_24/AccountFactory@@newAccount.h b/vk_test/kphp_out/kphp/o_24/AccountFactory@@newAccount.h
new file mode 100644
index 0000000000000000000000000000000000000000..e33bcb7932b70c793c97db4d5839d9bd23ed1a21
--- /dev/null
+++ b/vk_test/kphp_out/kphp/o_24/AccountFactory@@newAccount.h
@@ -0,0 +1,7 @@
+//crc64:5d95b58035baabfa
+//crc64_with_comments:0000000000000000
+#pragma once
+#include "runtime-headers.h"
+#include "cl/C@User.h"
+class_instance<C$User> f$AccountFactory$$newAccount(string const &v$name, string const &v$account_type) noexcept ;
+
diff --git a/vk_test/kphp_out/kphp/o_24/Admin@@__construct.h b/vk_test/kphp_out/kphp/o_24/Admin@@__construct.h
new file mode 100644
index 0000000000000000000000000000000000000000..631500424f7f12092564e9ea547ba649658ec661
--- /dev/null
+++ b/vk_test/kphp_out/kphp/o_24/Admin@@__construct.h
@@ -0,0 +1,18 @@
+//crc64:46ffcaaa95aef4b5
+//crc64_with_comments:d0da94df5c4c7c35
+#pragma once
+#include "runtime-headers.h"
+#include "cl/C@Admin.h"
+inline class_instance<C$Admin> f$Admin$$__construct(class_instance<C$Admin> const &v$this, string const &v$name) noexcept ;
+#include "o_24/User@@__construct.h"
+//source = [main.php]
+//35:     public function __construct(string $name) {
+class_instance<C$Admin> f$Admin$$__construct(class_instance<C$Admin> const &v$this, string const &v$name) noexcept  {
+//36:         parent::__construct($name);
+  f$User$$__construct(v$this, v$name);
+//37:     }
+//38: }
+  return v$this;
+}
+
+
diff --git a/vk_test/kphp_out/kphp/o_24/User@@__construct.h b/vk_test/kphp_out/kphp/o_24/User@@__construct.h
new file mode 100644
index 0000000000000000000000000000000000000000..f32444960cf182adacea62cf48754ac7d0d80bd3
--- /dev/null
+++ b/vk_test/kphp_out/kphp/o_24/User@@__construct.h
@@ -0,0 +1,17 @@
+//crc64:f9524bfcb5147e67
+//crc64_with_comments:aebaf354f9f81cfe
+#pragma once
+#include "runtime-headers.h"
+#include "cl/C@User.h"
+inline class_instance<C$User> f$User$$__construct(class_instance<C$User> const &v$this, string const &v$name) noexcept ;
+//source = [main.php]
+//44:     public function __construct(string $name) {
+class_instance<C$User> f$User$$__construct(class_instance<C$User> const &v$this, string const &v$name) noexcept  {
+//45:         $this->name = $name;
+  v$this->$name = v$name;
+//46:     }
+//47: }
+  return v$this;
+}
+
+
diff --git a/vk_test/kphp_out/kphp/o_24/collect_names.cpp b/vk_test/kphp_out/kphp/o_24/collect_names.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..4b0d6d67f7e2f3a7bf5bd7440ea558c0c3dea058
--- /dev/null
+++ b/vk_test/kphp_out/kphp/o_24/collect_names.cpp
@@ -0,0 +1,18 @@
+//crc64:5d1f0dde561c54de
+//crc64_with_comments:f0c34d4b4e34eb6f
+#include "runtime-headers.h"
+#include "o_24/collect_names.h"
+#include "o_l/lambda@u500ee028fdef5792_0.h"
+//source = [main.php]
+//62: function collect_names($accounts): array
+array< string > f$collect_names(array< class_instance<C$User> > const &v$accounts) noexcept  {
+//source = [main.php]
+//64:     return array_map(function ($a) {
+  return f$array_map([](auto &&... args)  noexcept {
+    return f$lambda$u500ee028fdef5792_0(std::forward<decltype(args)>(args)...);
+//65:         return $a->name;
+//66:     }, $accounts);
+  }, v$accounts);
+}
+
+
diff --git a/vk_test/kphp_out/kphp/o_24/collect_names.h b/vk_test/kphp_out/kphp/o_24/collect_names.h
new file mode 100644
index 0000000000000000000000000000000000000000..484be5ddd79b8ae17c9ccf766d9a1e58309a6c32
--- /dev/null
+++ b/vk_test/kphp_out/kphp/o_24/collect_names.h
@@ -0,0 +1,7 @@
+//crc64:42491025cdd69c20
+//crc64_with_comments:0000000000000000
+#pragma once
+#include "runtime-headers.h"
+#include "cl/C@User.h"
+array< string > f$collect_names(array< class_instance<C$User> > const &v$accounts) noexcept ;
+
diff --git a/vk_test/kphp_out/kphp/o_24/main.cpp b/vk_test/kphp_out/kphp/o_24/main.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..623ccd0f6decf1945416b151183fc8cf508fd1dd
--- /dev/null
+++ b/vk_test/kphp_out/kphp/o_24/main.cpp
@@ -0,0 +1,84 @@
+//crc64:dac193de72b65e06
+//crc64_with_comments:90148dfcc8ef8c10
+#include "runtime-headers.h"
+#include "o_24/main.h"
+#include "cl/C@User.h"
+#include "o_24/AccountFactory@@newAccount.h"
+#include "o_24/collect_names.h"
+#include "o_24/print_names.h"
+#include "o_24/validate_accounts.h"
+#include "o_l/lambda@ue4553af9dc6d7c38_0.h"
+extern mixed v$_GET;
+
+extern string v$const_string$us85f2e9f03f67f2de;
+
+extern string v$const_string$usa3a1ee829f091a24;
+
+extern string v$const_string$usbc45e1596fd79723;
+
+extern array< Unknown > v$const_array$us68788cf2824807c5;
+
+//source = [main.php]
+//76: function main() {
+void f$main() noexcept  {
+  array< class_instance<C$User> > v$accounts;
+  array< string > v$names;
+  array< string > v$parts;
+  mixed v$raw;
+  mixed v$raw_accounts;
+  mixed v$tmp_expr$ue4553af9dc6d7c38_0;
+  decltype(const_begin(v$tmp_expr$ue4553af9dc6d7c38_0)) v$tmp_expr$ue4553af9dc6d7c38_0$it;
+  decltype(const_begin(v$tmp_expr$ue4553af9dc6d7c38_0)) v$tmp_expr$ue4553af9dc6d7c38_0$it$end;
+  array< class_instance<C$User> > v$validated_accounts;
+//77:     $raw_accounts = $_GET['accounts'];
+  v$raw_accounts = v$_GET.get_value (v$const_string$usbc45e1596fd79723, 1926875143400074046_i64);
+//78:     if (!$raw_accounts) {
+  if (!f$boolval (v$raw_accounts)) {
+//79:         die('$_GET["accounts"] is empty');
+    f$die(v$const_string$usa3a1ee829f091a24);
+  };
+//80:     }
+//81:     /** @var User[] $accounts */
+  ;
+//82:     $accounts = [];
+  v$accounts = v$const_array$us68788cf2824807c5;
+//83:     foreach ($raw_accounts as $raw) {
+  {
+    v$tmp_expr$ue4553af9dc6d7c38_0 = check_not_null (check_not_false (v$raw_accounts));
+    v$tmp_expr$ue4553af9dc6d7c38_0$it = const_begin(v$tmp_expr$ue4553af9dc6d7c38_0);
+    v$tmp_expr$ue4553af9dc6d7c38_0$it$end = const_end(v$tmp_expr$ue4553af9dc6d7c38_0);
+    for (; v$tmp_expr$ue4553af9dc6d7c38_0$it != v$tmp_expr$ue4553af9dc6d7c38_0$it$end; ++v$tmp_expr$ue4553af9dc6d7c38_0$it) {
+      v$raw = v$tmp_expr$ue4553af9dc6d7c38_0$it.get_value();
+//84:         $parts = explode('_', $raw);
+      v$parts = f$explode(v$const_string$us85f2e9f03f67f2de, f$strval (v$raw));
+//85:         if (count($parts) !== 2) {
+      if (!(equals (f$count(v$parts), 2_i64))) {
+//86:             continue;
+        continue;
+      };
+//87:         }
+//88:         $accounts[] = AccountFactory::newAccount($parts[0], $parts[1]);
+      (v$accounts).push_back (f$AccountFactory$$newAccount(f$make_clone(v$parts.get_value (0_i64)), f$make_clone(v$parts.get_value (1_i64))));
+
+    }
+    clear_array(v$tmp_expr$ue4553af9dc6d7c38_0);
+  };
+//89:     }
+//90: 
+//91:     validate_accounts($accounts);
+  f$validate_accounts(v$accounts);
+//source = [main.php]
+//92:     $validated_accounts = array_filter($accounts, function ($a) {
+  v$validated_accounts = f$array_filter(v$accounts, [](auto &&... args)  noexcept {
+    return f$lambda$ue4553af9dc6d7c38_0(std::forward<decltype(args)>(args)...);
+  });
+//93:         return $a->is_valid;
+//94:     });
+//95:     $names = collect_names($validated_accounts);
+  v$names = f$collect_names(v$validated_accounts);
+//96:     print_names($names);
+  f$print_names(v$names);
+  return ;
+}
+
+
diff --git a/vk_test/kphp_out/kphp/o_24/main.h b/vk_test/kphp_out/kphp/o_24/main.h
new file mode 100644
index 0000000000000000000000000000000000000000..18f3055e4dee1920da77388e8be86744ec74549a
--- /dev/null
+++ b/vk_test/kphp_out/kphp/o_24/main.h
@@ -0,0 +1,6 @@
+//crc64:c3928b660085f375
+//crc64_with_comments:0000000000000000
+#pragma once
+#include "runtime-headers.h"
+void f$main() noexcept ;
+
diff --git a/vk_test/kphp_out/kphp/o_24/print_names.cpp b/vk_test/kphp_out/kphp/o_24/print_names.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..026d1474bd46c9635130c4796e27cf1608c4e298
--- /dev/null
+++ b/vk_test/kphp_out/kphp/o_24/print_names.cpp
@@ -0,0 +1,34 @@
+//crc64:7ba13be6f17b8193
+//crc64_with_comments:892b6a27f5fec91c
+#include "runtime-headers.h"
+#include "o_24/print_names.h"
+extern string v$const_string$us75adcc262db20420;
+
+extern string v$const_string$us9796b8ed8a63bea8;
+
+//source = [main.php]
+//70: function print_names(array $names) {
+void f$print_names(array< string > const &v$names) noexcept  {
+  string v$name;
+  array< string > v$tmp_expr$u9320487f9f030beb_0;
+  decltype(const_begin(v$tmp_expr$u9320487f9f030beb_0)) v$tmp_expr$u9320487f9f030beb_0$it;
+  decltype(const_begin(v$tmp_expr$u9320487f9f030beb_0)) v$tmp_expr$u9320487f9f030beb_0$it$end;
+//71:     foreach ($names as $name) {
+  {
+    v$tmp_expr$u9320487f9f030beb_0 = v$names;
+    v$tmp_expr$u9320487f9f030beb_0$it = const_begin(v$tmp_expr$u9320487f9f030beb_0);
+    v$tmp_expr$u9320487f9f030beb_0$it$end = const_end(v$tmp_expr$u9320487f9f030beb_0);
+    for (; v$tmp_expr$u9320487f9f030beb_0$it != v$tmp_expr$u9320487f9f030beb_0$it$end; ++v$tmp_expr$u9320487f9f030beb_0$it) {
+      v$name = v$tmp_expr$u9320487f9f030beb_0$it.get_value();
+//72:         echo "name=$name<br>";
+      {
+        f$echo(str_concat(v$const_string$us75adcc262db20420, v$name, v$const_string$us9796b8ed8a63bea8));
+      };
+
+    }
+    clear_array(v$tmp_expr$u9320487f9f030beb_0);
+  };
+  return ;
+}
+
+
diff --git a/vk_test/kphp_out/kphp/o_24/print_names.h b/vk_test/kphp_out/kphp/o_24/print_names.h
new file mode 100644
index 0000000000000000000000000000000000000000..513ec2978d0594c926cf1ee6011abea820ea1b8b
--- /dev/null
+++ b/vk_test/kphp_out/kphp/o_24/print_names.h
@@ -0,0 +1,6 @@
+//crc64:d197e8d0d622d5cd
+//crc64_with_comments:0000000000000000
+#pragma once
+#include "runtime-headers.h"
+void f$print_names(array< string > const &v$names) noexcept ;
+
diff --git a/vk_test/kphp_out/kphp/o_24/src_mainfa654ae0967e6769.cpp b/vk_test/kphp_out/kphp/o_24/src_mainfa654ae0967e6769.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..a9083585e7dd6b2f645cb5d66f200bc992a90660
--- /dev/null
+++ b/vk_test/kphp_out/kphp/o_24/src_mainfa654ae0967e6769.cpp
@@ -0,0 +1,26 @@
+//crc64:344f4a52922247e8
+//crc64_with_comments:41241f751de0436e
+#include "runtime-headers.h"
+#include "o_24/src_mainfa654ae0967e6769.h"
+#include "o_24/main.h"
+extern bool v$src_mainfa654ae0967e6769$called;
+
+//source = [main.php]
+//20: class AccountFactory {
+Optional < bool > f$src_mainfa654ae0967e6769() noexcept  {
+  v$src_mainfa654ae0967e6769$called = true;
+//90: 
+//91:     validate_accounts($accounts);
+//92:     $validated_accounts = array_filter($accounts, function ($a) {
+//93:         return $a->is_valid;
+//94:     });
+//95:     $names = collect_names($validated_accounts);
+//96:     print_names($names);
+//97: }
+//98: 
+//99: main();
+  f$main();
+  return Optional<bool>{};
+}
+
+
diff --git a/vk_test/kphp_out/kphp/o_24/src_mainfa654ae0967e6769.h b/vk_test/kphp_out/kphp/o_24/src_mainfa654ae0967e6769.h
new file mode 100644
index 0000000000000000000000000000000000000000..c52187ef7454519d52bcbbd54bc32648f705a327
--- /dev/null
+++ b/vk_test/kphp_out/kphp/o_24/src_mainfa654ae0967e6769.h
@@ -0,0 +1,6 @@
+//crc64:8aeed5cb3ff0c2c3
+//crc64_with_comments:0000000000000000
+#pragma once
+#include "runtime-headers.h"
+Optional < bool > f$src_mainfa654ae0967e6769() noexcept ;
+
diff --git a/vk_test/kphp_out/kphp/o_24/validate_accounts.cpp b/vk_test/kphp_out/kphp/o_24/validate_accounts.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..0870a48a4187a7a342333f6a3a95c8d8dc32de84
--- /dev/null
+++ b/vk_test/kphp_out/kphp/o_24/validate_accounts.cpp
@@ -0,0 +1,29 @@
+//crc64:8a459fab64ab9a37
+//crc64_with_comments:69f08a1c9454a39b
+#include "runtime-headers.h"
+#include "o_24/validate_accounts.h"
+#include "cl/C@User.h"
+//source = [main.php]
+//52: function validate_accounts($accounts) {
+void f$validate_accounts(array< class_instance<C$User> > const &v$accounts) noexcept  {
+  class_instance<C$User> v$a;
+  array< class_instance<C$User> > v$tmp_expr$u48aa365f5981e14b_0;
+  decltype(const_begin(v$tmp_expr$u48aa365f5981e14b_0)) v$tmp_expr$u48aa365f5981e14b_0$it;
+  decltype(const_begin(v$tmp_expr$u48aa365f5981e14b_0)) v$tmp_expr$u48aa365f5981e14b_0$it$end;
+//53:     foreach ($accounts as $a) {
+  {
+    v$tmp_expr$u48aa365f5981e14b_0 = v$accounts;
+    v$tmp_expr$u48aa365f5981e14b_0$it = const_begin(v$tmp_expr$u48aa365f5981e14b_0);
+    v$tmp_expr$u48aa365f5981e14b_0$it$end = const_end(v$tmp_expr$u48aa365f5981e14b_0);
+    for (; v$tmp_expr$u48aa365f5981e14b_0$it != v$tmp_expr$u48aa365f5981e14b_0$it$end; ++v$tmp_expr$u48aa365f5981e14b_0$it) {
+      v$a = v$tmp_expr$u48aa365f5981e14b_0$it.get_value();
+//54:         $a->is_valid = !empty($a->name);
+      v$a->$is_valid = !f$empty(v$a->$name);
+
+    }
+    clear_array(v$tmp_expr$u48aa365f5981e14b_0);
+  };
+  return ;
+}
+
+
diff --git a/vk_test/kphp_out/kphp/o_24/validate_accounts.h b/vk_test/kphp_out/kphp/o_24/validate_accounts.h
new file mode 100644
index 0000000000000000000000000000000000000000..3ac7d4f173cda2007a194900c7163430815944aa
--- /dev/null
+++ b/vk_test/kphp_out/kphp/o_24/validate_accounts.h
@@ -0,0 +1,7 @@
+//crc64:ad752df11a980b87
+//crc64_with_comments:0000000000000000
+#pragma once
+#include "runtime-headers.h"
+#include "cl/C@User.h"
+void f$validate_accounts(array< class_instance<C$User> > const &v$accounts) noexcept ;
+
diff --git a/vk_test/kphp_out/kphp/o_l/lambda@u500ee028fdef5792_0.h b/vk_test/kphp_out/kphp/o_l/lambda@u500ee028fdef5792_0.h
new file mode 100644
index 0000000000000000000000000000000000000000..81a00b43bcc3c86b1fcc5f1cc2d7e34c6daf15d5
--- /dev/null
+++ b/vk_test/kphp_out/kphp/o_l/lambda@u500ee028fdef5792_0.h
@@ -0,0 +1,14 @@
+//crc64:d151198e14ea8aa8
+//crc64_with_comments:71793613b12d51b9
+#pragma once
+#include "runtime-headers.h"
+#include "cl/C@User.h"
+inline string f$lambda$u500ee028fdef5792_0(class_instance<C$User> const &v$a) noexcept ;
+//source = [main.php]
+//64:     return array_map(function ($a) {
+string f$lambda$u500ee028fdef5792_0(class_instance<C$User> const &v$a) noexcept  {
+//65:         return $a->name;
+  return v$a->$name;
+}
+
+
diff --git a/vk_test/kphp_out/kphp/o_l/lambda@ue4553af9dc6d7c38_0.h b/vk_test/kphp_out/kphp/o_l/lambda@ue4553af9dc6d7c38_0.h
new file mode 100644
index 0000000000000000000000000000000000000000..3ea8c7875ab6e04effa9ae5797d7f549ed39abd3
--- /dev/null
+++ b/vk_test/kphp_out/kphp/o_l/lambda@ue4553af9dc6d7c38_0.h
@@ -0,0 +1,14 @@
+//crc64:41c764aebb278ac6
+//crc64_with_comments:4e6a9f7f2683dac0
+#pragma once
+#include "runtime-headers.h"
+#include "cl/C@User.h"
+inline bool f$lambda$ue4553af9dc6d7c38_0(class_instance<C$User> const &v$a) noexcept ;
+//source = [main.php]
+//92:     $validated_accounts = array_filter($accounts, function ($a) {
+bool f$lambda$ue4553af9dc6d7c38_0(class_instance<C$User> const &v$a) noexcept  {
+//93:         return $a->is_valid;
+  return v$a->$is_valid;
+}
+
+
diff --git a/vk_test/kphp_out/kphp/o_vars_0/vars0.cpp b/vk_test/kphp_out/kphp/o_vars_0/vars0.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..a6a25f036d6185327282acb6ca8b7da8aff34fe0
--- /dev/null
+++ b/vk_test/kphp_out/kphp/o_vars_0/vars0.cpp
@@ -0,0 +1,41 @@
+//crc64:343137f0043ac135
+//crc64_with_comments:0000000000000000
+#include "runtime-headers.h"
+mixed v$_COOKIE;
+mixed v$_ENV;
+mixed v$_FILES;
+mixed v$_GET;
+mixed v$_POST;
+mixed v$_REQUEST;
+mixed v$_SERVER;
+mixed v$argc;
+mixed v$argv;
+string v$const_string$us75adcc262db20420;
+string v$const_string$us85f2e9f03f67f2de;
+string v$const_string$us9796b8ed8a63bea8;
+string v$const_string$us9ac75637e16efd45;
+string v$const_string$us9ae16a3b2f90404f;
+string v$const_string$usa3a1ee829f091a24;
+string v$const_string$usbc45e1596fd79723;
+string v$d$PHP_SAPI;
+bool v$src__functions_txt5e94a5dedeb30e71$called = false;
+bool v$src_mainfa654ae0967e6769$called = false;
+array< Unknown > v$const_array$us68788cf2824807c5;
+alignas(8) static const char raw[] = "\005\0\0\0\005\0\0\0ряяname=\0\0\0\0\0\0\0\001\0\0\0\001\0\0\0ряя_\0\0\0\004\0\0\0\004\0\0\0ряя<br>\0\0\0\0\0\0\0\0\005\0\0\0\005\0\0\0ряяAdmin\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ряя\0\0\0\0\032\0\0\0\032\0\0\0ряя$_GET[\"accounts\"] is empty\0\0\b\0\0\0\b\0\0\0ряяaccounts\0";
+
+void const_vars_init_priority_0_file_0() noexcept {
+  v$const_string$us75adcc262db20420.assign_raw (&raw[0]);
+  v$const_string$us85f2e9f03f67f2de.assign_raw (&raw[24]);
+  v$const_string$us9796b8ed8a63bea8.assign_raw (&raw[40]);
+  v$const_string$us9ac75637e16efd45.assign_raw (&raw[64]);
+  v$const_string$us9ae16a3b2f90404f.assign_raw (&raw[88]);
+  v$const_string$usa3a1ee829f091a24.assign_raw (&raw[104]);
+  v$const_string$usbc45e1596fd79723.assign_raw (&raw[144]);
+}
+
+void const_vars_init_priority_1_file_0() noexcept {
+  v$const_array$us68788cf2824807c5 = array< Unknown > ();
+  v$const_array$us68788cf2824807c5.set_reference_counter_to(ExtraRefCnt::for_global_const);
+
+}
+
diff --git a/vk_test/kphp_out/kphp/o_vars_reset/vars_reset.0.src_mainfa654ae0967e6769.cpp b/vk_test/kphp_out/kphp/o_vars_reset/vars_reset.0.src_mainfa654ae0967e6769.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..cef4c5a1cf42a3eaab3c0dc314ffeafa0a219a6d
--- /dev/null
+++ b/vk_test/kphp_out/kphp/o_vars_reset/vars_reset.0.src_mainfa654ae0967e6769.cpp
@@ -0,0 +1,8 @@
+//crc64:7cbd116d7f139d1f
+//crc64_with_comments:0000000000000000
+#include "runtime-headers.h"
+extern mixed v$_GET;
+void f$src_mainfa654ae0967e6769$global_vars_reset0()  noexcept {
+  hard_reset_var(v$_GET);
+}
+
diff --git a/vk_test/kphp_out/kphp/o_vars_reset/vars_reset.1.src_mainfa654ae0967e6769.cpp b/vk_test/kphp_out/kphp/o_vars_reset/vars_reset.1.src_mainfa654ae0967e6769.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..47a78fa838b1cd5f118f93dd7060ae35a83e80f7
--- /dev/null
+++ b/vk_test/kphp_out/kphp/o_vars_reset/vars_reset.1.src_mainfa654ae0967e6769.cpp
@@ -0,0 +1,8 @@
+//crc64:5aa089eae51036ee
+//crc64_with_comments:0000000000000000
+#include "runtime-headers.h"
+extern bool v$src_mainfa654ae0967e6769$called;
+void f$src_mainfa654ae0967e6769$global_vars_reset1()  noexcept {
+  hard_reset_var(v$src_mainfa654ae0967e6769$called);
+}
+
diff --git a/vk_test/kphp_out/kphp/vars.cpp b/vk_test/kphp_out/kphp/vars.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..a23452ae6b4f794ff7e506a5c3eb6d394a075fd2
--- /dev/null
+++ b/vk_test/kphp_out/kphp/vars.cpp
@@ -0,0 +1,8 @@
+//crc64:f93095e7bddadd7b
+//crc64_with_comments:0000000000000000
+void const_vars_init()  noexcept {
+  void const_vars_init_priority_0_file_0();
+  const_vars_init_priority_0_file_0();
+  void const_vars_init_priority_1_file_0();
+  const_vars_init_priority_1_file_0();
+}
diff --git a/vk_test/kphp_out/kphp/vars_reset.src_mainfa654ae0967e6769.cpp b/vk_test/kphp_out/kphp/vars_reset.src_mainfa654ae0967e6769.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..7d9fac2b6d8ed197ab641e1f5956c72a9f5b658f
--- /dev/null
+++ b/vk_test/kphp_out/kphp/vars_reset.src_mainfa654ae0967e6769.cpp
@@ -0,0 +1,10 @@
+//crc64:18c0c8e8707fe13e
+//crc64_with_comments:0000000000000000
+#include "runtime-headers.h"
+void f$src_mainfa654ae0967e6769$global_vars_reset()  noexcept {
+  void f$src_mainfa654ae0967e6769$global_vars_reset0();
+  f$src_mainfa654ae0967e6769$global_vars_reset0();
+  void f$src_mainfa654ae0967e6769$global_vars_reset1();
+  f$src_mainfa654ae0967e6769$global_vars_reset1();
+}
+
diff --git a/vk_test/kphp_out/objs/_shape_keys.o b/vk_test/kphp_out/objs/_shape_keys.o
new file mode 100644
index 0000000000000000000000000000000000000000..7b46998f2b584588f4f2ce65c1608f95a264bcec
Binary files /dev/null and b/vk_test/kphp_out/objs/_shape_keys.o differ
diff --git a/vk_test/kphp_out/objs/_tagger.o b/vk_test/kphp_out/objs/_tagger.o
new file mode 100644
index 0000000000000000000000000000000000000000..2881a8c1010c52d369e4858510a470e02f45b998
Binary files /dev/null and b/vk_test/kphp_out/objs/_tagger.o differ
diff --git a/vk_test/kphp_out/objs/init_php_scripts.o b/vk_test/kphp_out/objs/init_php_scripts.o
new file mode 100644
index 0000000000000000000000000000000000000000..9cd7cc14fc725f88497fe542c10c42207e3e7777
Binary files /dev/null and b/vk_test/kphp_out/objs/init_php_scripts.o differ
diff --git a/vk_test/kphp_out/objs/main.o b/vk_test/kphp_out/objs/main.o
new file mode 100644
index 0000000000000000000000000000000000000000..1a43e80877af30039363a7cb79289d44fb1b88ed
Binary files /dev/null and b/vk_test/kphp_out/objs/main.o differ
diff --git a/vk_test/kphp_out/objs/o_17/src__functions_txt5e94a5dedeb30e71.o b/vk_test/kphp_out/objs/o_17/src__functions_txt5e94a5dedeb30e71.o
new file mode 100644
index 0000000000000000000000000000000000000000..7065bb8c430ac59313d6a6fc2a1d3c4843203a0d
Binary files /dev/null and b/vk_test/kphp_out/objs/o_17/src__functions_txt5e94a5dedeb30e71.o differ
diff --git a/vk_test/kphp_out/objs/o_17_f88804b97d24fa52.o b/vk_test/kphp_out/objs/o_17_f88804b97d24fa52.o
new file mode 100644
index 0000000000000000000000000000000000000000..3222b4a173a6d42fda9e7aa649144e897ea22287
Binary files /dev/null and b/vk_test/kphp_out/objs/o_17_f88804b97d24fa52.o differ
diff --git a/vk_test/kphp_out/objs/o_24/AccountFactory@@newAccount.o b/vk_test/kphp_out/objs/o_24/AccountFactory@@newAccount.o
new file mode 100644
index 0000000000000000000000000000000000000000..9d7cf453b5651aca36dd18d0c1d7030fd0738fa7
Binary files /dev/null and b/vk_test/kphp_out/objs/o_24/AccountFactory@@newAccount.o differ
diff --git a/vk_test/kphp_out/objs/o_24/collect_names.o b/vk_test/kphp_out/objs/o_24/collect_names.o
new file mode 100644
index 0000000000000000000000000000000000000000..780457226791a75a8fcb09632db7dffb3fdabf0d
Binary files /dev/null and b/vk_test/kphp_out/objs/o_24/collect_names.o differ
diff --git a/vk_test/kphp_out/objs/o_24/main.o b/vk_test/kphp_out/objs/o_24/main.o
new file mode 100644
index 0000000000000000000000000000000000000000..8f7676371e9bb9bad24867ab97e55cac7b9fc590
Binary files /dev/null and b/vk_test/kphp_out/objs/o_24/main.o differ
diff --git a/vk_test/kphp_out/objs/o_24/print_names.o b/vk_test/kphp_out/objs/o_24/print_names.o
new file mode 100644
index 0000000000000000000000000000000000000000..5ab92d44ea75234939e305838cb59f72317e8813
Binary files /dev/null and b/vk_test/kphp_out/objs/o_24/print_names.o differ
diff --git a/vk_test/kphp_out/objs/o_24/src_mainfa654ae0967e6769.o b/vk_test/kphp_out/objs/o_24/src_mainfa654ae0967e6769.o
new file mode 100644
index 0000000000000000000000000000000000000000..672be70efab871abad9aaa8c7c012f593ff1f2c2
Binary files /dev/null and b/vk_test/kphp_out/objs/o_24/src_mainfa654ae0967e6769.o differ
diff --git a/vk_test/kphp_out/objs/o_24/validate_accounts.o b/vk_test/kphp_out/objs/o_24/validate_accounts.o
new file mode 100644
index 0000000000000000000000000000000000000000..bf887f27c0a85e808bc726e031fdb65641c9ff6b
Binary files /dev/null and b/vk_test/kphp_out/objs/o_24/validate_accounts.o differ
diff --git a/vk_test/kphp_out/objs/o_24_4e3ce63180e19ad7.o b/vk_test/kphp_out/objs/o_24_4e3ce63180e19ad7.o
new file mode 100644
index 0000000000000000000000000000000000000000..73e4281638241252cf231fe15db5ed31221f084b
Binary files /dev/null and b/vk_test/kphp_out/objs/o_24_4e3ce63180e19ad7.o differ
diff --git a/vk_test/kphp_out/objs/o_vars_0/vars0.o b/vk_test/kphp_out/objs/o_vars_0/vars0.o
new file mode 100644
index 0000000000000000000000000000000000000000..7799b783b81be0b2ea0c3396196629ae3a4c74eb
Binary files /dev/null and b/vk_test/kphp_out/objs/o_vars_0/vars0.o differ
diff --git a/vk_test/kphp_out/objs/o_vars_0_6aceeb1509e8fa3e.o b/vk_test/kphp_out/objs/o_vars_0_6aceeb1509e8fa3e.o
new file mode 100644
index 0000000000000000000000000000000000000000..ed619f9571faeaadfe192fb0500eb5b4f3492e7c
Binary files /dev/null and b/vk_test/kphp_out/objs/o_vars_0_6aceeb1509e8fa3e.o differ
diff --git a/vk_test/kphp_out/objs/o_vars_reset/vars_reset.0.src_mainfa654ae0967e6769.o b/vk_test/kphp_out/objs/o_vars_reset/vars_reset.0.src_mainfa654ae0967e6769.o
new file mode 100644
index 0000000000000000000000000000000000000000..919af368d9d0d262efda86e813008e066de2a723
Binary files /dev/null and b/vk_test/kphp_out/objs/o_vars_reset/vars_reset.0.src_mainfa654ae0967e6769.o differ
diff --git a/vk_test/kphp_out/objs/o_vars_reset/vars_reset.1.src_mainfa654ae0967e6769.o b/vk_test/kphp_out/objs/o_vars_reset/vars_reset.1.src_mainfa654ae0967e6769.o
new file mode 100644
index 0000000000000000000000000000000000000000..a9c84d42c672cd969f71f5c4fa53ac2852d8fdff
Binary files /dev/null and b/vk_test/kphp_out/objs/o_vars_reset/vars_reset.1.src_mainfa654ae0967e6769.o differ
diff --git a/vk_test/kphp_out/objs/o_vars_reset_13da16e24c51e83f.o b/vk_test/kphp_out/objs/o_vars_reset_13da16e24c51e83f.o
new file mode 100644
index 0000000000000000000000000000000000000000..8bf754bf5ce235c5ee60eb69458a5727f8c162e4
Binary files /dev/null and b/vk_test/kphp_out/objs/o_vars_reset_13da16e24c51e83f.o differ
diff --git a/vk_test/kphp_out/objs/vars.o b/vk_test/kphp_out/objs/vars.o
new file mode 100644
index 0000000000000000000000000000000000000000..47842eb17d55ccce4800b3e85b7948d2f1391072
Binary files /dev/null and b/vk_test/kphp_out/objs/vars.o differ
diff --git a/vk_test/kphp_out/objs/vars_reset.src_mainfa654ae0967e6769.o b/vk_test/kphp_out/objs/vars_reset.src_mainfa654ae0967e6769.o
new file mode 100644
index 0000000000000000000000000000000000000000..6090bbefc1c41e56e51deb3aa8109fb1e9632ec2
Binary files /dev/null and b/vk_test/kphp_out/objs/vars_reset.src_mainfa654ae0967e6769.o differ
diff --git a/vk_test/kphp_out/server b/vk_test/kphp_out/server
new file mode 100755
index 0000000000000000000000000000000000000000..0dfab4f0edf23127925ff880cd20111a4423bb67
Binary files /dev/null and b/vk_test/kphp_out/server differ
diff --git a/vk_test/main.php b/vk_test/main.php
new file mode 100644
index 0000000000000000000000000000000000000000..7f1d52a5b08be68021bdd8eb56520af65fd621b6
--- /dev/null
+++ b/vk_test/main.php
@@ -0,0 +1,100 @@
+<?php
+
+// This code works in PHP.
+// Run builtin PHP web server like so:
+//
+//   php -S localhost:8080 ./main.php
+//
+// Then visit this page in your browser:
+//
+//   http://localhost:8080/?accounts[]=Rulon_User&accounts[]=Bidon_Admin
+//
+// The output should be:
+//
+//   name=Rulon
+//   name=Bidon
+//
+// TODO: Make this code compile and run with KPHP with minimal
+// changes while trying to keep the code as idiomatic as possible.
+
+class AccountFactory {
+    /**
+     * @return Admin|User
+     */
+    public static function newAccount(string $name, string $account_type) {
+        switch ($account_type) {
+            case "Admin":
+                return new Admin($name);
+            default:
+                return new User($name);
+        }
+    }
+}
+
+class Admin extends User {
+    public function __construct(string $name) {
+        parent::__construct($name);
+    }
+}
+
+class User {
+    public string $name;
+    public bool $is_valid;
+
+    public function __construct(string $name) {
+        $this->name = $name;
+    }
+}
+
+/**
+ * @param User[] $accounts
+ */
+function validate_accounts($accounts) {
+    foreach ($accounts as $a) {
+        $a->is_valid = !empty($a->name);
+    }
+}
+
+/**
+ * @param User[] $accounts
+ * @return string[]
+ */
+function collect_names($accounts): array
+{
+    return array_map(function ($a) {
+        return $a->name;
+    }, $accounts);
+}
+
+/** @param string[] $names */
+function print_names(array $names) {
+    foreach ($names as $name) {
+        echo "name=$name<br>";
+    }
+}
+
+function main() {
+    $raw_accounts = $_GET['accounts'];
+    if (!$raw_accounts) {
+        die('$_GET["accounts"] is empty');
+    }
+    /** @var User[] $accounts */
+    $accounts = [];
+    foreach ($raw_accounts as $raw) {
+        $parts = explode('_', $raw);
+        if (count($parts) !== 2) {
+            continue;
+        }
+        $accounts[] = AccountFactory::newAccount($parts[0], $parts[1]);
+    }
+
+    validate_accounts($accounts);
+    $validated_accounts = array_filter($accounts, function ($a) {
+        return $a->is_valid;
+    });
+    $names = collect_names($validated_accounts);
+    print_names($names);
+}
+
+main();
+