{"id":21399,"date":"2014-03-25T16:22:53","date_gmt":"2014-03-25T14:22:53","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/?p=21399"},"modified":"2014-03-25T16:22:53","modified_gmt":"2014-03-25T14:22:53","slug":"the-world-of-php-nightmare","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2014\/03\/25\/the-world-of-php-nightmare\/","title":{"rendered":"The world of PHP nightmare"},"content":{"rendered":"<!-- google_ad_section_start -->\n<p>I had a dream today. In fact, it was a nightmare that woke me up at 3am and kept me up for the next three hours or so. And I tell you honestly &#8211; this kind of things don&#8217;t happen to me all that often. In fact, I don&#8217;t even remember when was the last time I had anything similar.<\/p>\n<p>I dreamed that the whole world is somehow written in PHP. A few bits were alright, but it mostly sucked. There were constant ground tremors. \u00a0Buildings were shaking in the slow soft waving motions. Things that were supposed to be soft were plastic hard. Things that were supposed to be hard were bumpy soft. Road tarmac felt like a gentle green grass field.<\/p>\n<p>At some point of those tremors opened a long, \u00a0deep crack in the ground. The resulting vibration tore a nearby skyscraper in half, like it was a wet baguette, and the top part of the building slowly fell and disappeared in that crack (hi, \u00a0dr. Fraud). That was rather unpleasant to watch.<\/p>\n<p>After a few scenes of apocalypse, the nightmare movie was cut to action, where I was a part of the task force that was supposed to fix the world. And, I tell you, we tried hard. We&#8217;ve refactored parts of the code, \u00a0migrated a few most critical systems to CakePHP, upgraded PHP to 5.6 and even tried all those high performance tricks from Facebook (hi, Hack). Things were getting better but not nearly enough. The world was still awkward, unstable and slow.<\/p>\n<p>PHP wasn&#8217;t the only thing we were looking at. There was a lot work around databases and tuning servers. We&#8217;ve tried every profiling, monitoring and analytics tool we could get our hands on. But, to no avail.<\/p>\n<p>The really horrifying part of the nightmare was when we finally realized that PHP won&#8217;t cut it and we&#8217;ll have to rewrite parts of the world in C. \u00a0We also somehow were missing a C compiler. I bet you can guess the epicenter of the nightmare now. Yes, indeed. We started writing a C compiler in PHP. That&#8217;s when I woke up in cold sweat, screaming &#8220;Noooooo!&#8221; through my lungs. That was more than I could bear.<\/p>\n<p>For three hours after I tried not to Google or think if that was at all possible. Apparently, I love the world the way it is now &#8211; screwed up in a billion ways, but NOT written in PHP. With that peaceful thought and a beautiful sunrise I fell asleep.<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>I had a dream today. In fact, it was a nightmare that woke me up at 3am and kept me up for the next three hours or so. And I tell you honestly &#8211; this kind of things don&#8217;t happen to me all that often. In fact, I don&#8217;t even remember when was the last &hellip; <a href=\"https:\/\/mamchenkov.net\/wordpress\/2014\/03\/25\/the-world-of-php-nightmare\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">The world of PHP nightmare<\/span><\/a><\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_links_to":"","_links_to_target":""},"categories":[1,2,18,62],"tags":[482,38,376],"keyring_services":[],"class_list":["post-21399","post","type-post","status-publish","format-standard","hentry","category-general","category-personal","category-programming","category-technology","tag-dreams","tag-php","tag-sleep"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":27100,"url":"https:\/\/mamchenkov.net\/wordpress\/2016\/12\/11\/php-microsoft-office-365-and-active-directory\/","url_meta":{"origin":21399,"position":0},"title":"PHP : Microsoft Office 365 and Active Directory","author":"Leonid Mamchenkov","date":"December 11, 2016","format":false,"excerpt":"Disclaimer: I am not the biggest fan of Microsoft. \u00a0On the contrary. \u00a0I keep running into situations, where Microsoft technologies are a constant source of pain. \u00a0If that annoys you, please stop reading this post now and go away. \u00a0I don't care. \u00a0You've been warned. A few recent projects that\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":27681,"url":"https:\/\/mamchenkov.net\/wordpress\/2017\/06\/14\/async-php-requests-reactive-responses-with-php-fpm\/","url_meta":{"origin":21399,"position":1},"title":"Async PHP Requests &#038; Reactive Responses with PHP-FPM","author":"Leonid Mamchenkov","date":"June 14, 2017","format":false,"excerpt":"https:\/\/speakerdeck.com\/hollodotme\/async-php-requests-and-reactive-responses-with-php-fpm \"Async PHP Requests & Reactive Responses with PHP-FPM\" is talk by\u00a0Holger Woltersdorf, in which he shares the approaches he tried for implementing asynchronous requests in PHP, and how he arrived at\u00a0hollodotme\/fast-cgi-client, which is a\u00a0PHP fast CGI client for sending requests (a)synchronously to PHP-FPM.","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":28923,"url":"https:\/\/mamchenkov.net\/wordpress\/2018\/11\/10\/php-is-deadviva-le-php\/","url_meta":{"origin":21399,"position":2},"title":"PHP is dead\u2026Viva le PHP!","author":"Leonid Mamchenkov","date":"November 10, 2018","format":false,"excerpt":"Here's a great post on why all those \"PHP is dead\" blog posts and forum threads are a complete load of crap. Here\u2019s the reality: nearly 80% of the internet is running on PHP as of 2018. I guess PHP isn\u2019t that dead after all. PHP doesn\u2019t scale. Riiiiiight. Wikipedia\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2018\/11\/php-500x335.jpeg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":27300,"url":"https:\/\/mamchenkov.net\/wordpress\/2017\/02\/08\/migrating-a-php-5-app-to-php-7\/","url_meta":{"origin":21399,"position":3},"title":"Migrating a PHP 5 App to PHP 7","author":"Leonid Mamchenkov","date":"February 8, 2017","format":false,"excerpt":"This year I'll be migrating quite a bit of stuff from PHP 5 to PHP 7. \u00a0We haven't started with the process yet, but with the recent indicators like PHPUnit 6 release, I'm sure the priority of this work will start rising. Obviously, I'm familiar with the new features of\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":18699,"url":"https:\/\/mamchenkov.net\/wordpress\/2013\/10\/23\/has-php-json-been-removed-in-php-5-5\/","url_meta":{"origin":21399,"position":4},"title":"Has PHP JSON been removed in PHP 5.5?","author":"Leonid Mamchenkov","date":"October 23, 2013","format":"link","excerpt":"Has PHP JSON been removed in PHP 5.5?","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":28179,"url":"https:\/\/mamchenkov.net\/wordpress\/2017\/11\/06\/php-ml-machine-learning-library-for-php\/","url_meta":{"origin":21399,"position":5},"title":"PHP-ML &#8211; Machine Learning library for PHP","author":"Leonid Mamchenkov","date":"November 6, 2017","format":false,"excerpt":"PHP-ML is a machine learning library for PHP.\u00a0 Given, PHP is probably not the best choice when it comes to machine learning, but sometimes one is limited in technology stack choices, so it's good have options like this one. Fresh approach to Machine Learning in PHP. Algorithms, Cross Validation, Neural\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/21399","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=21399"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/21399\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=21399"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=21399"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=21399"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=21399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}