{"id":1577,"date":"2016-01-30T23:28:41","date_gmt":"2016-01-30T22:28:41","guid":{"rendered":"https:\/\/www.entropywins.wtf\/blog\/?p=1577"},"modified":"2022-01-30T13:25:01","modified_gmt":"2022-01-30T12:25:01","slug":"missing-in-php7-function-references","status":"publish","type":"post","link":"https:\/\/www.entropywins.wtf\/blog\/2016\/01\/30\/missing-in-php7-function-references\/","title":{"rendered":"Missing in PHP7: function references"},"content":{"rendered":"<p>This is the first post in my <a href=\"https:\/\/www.entropywins.wtf\/blog\/2016\/01\/30\/missing-in-php7\/\">Missing in PHP7 series<\/a>.<\/p>\n<p>Over time, PHP has improved its capabilities with regards to functions.\u00a0As of PHP 5.3 you can create <a href=\"http:\/\/php.net\/manual\/en\/functions.anonymous.php\">anonymous functions<\/a> and as of 5.4 you can use the <a href=\"http:\/\/php.net\/manual\/en\/language.types.callable.php\">callable type hint<\/a>. However referencing a function still requires using a string.<\/p>\n<pre class=\"lang:php decode:true\">call_user_func( 'globalFunctionName' );\ncall_user_func( 'SomeClass::staticFunction' );\ncall_user_func( [ $someObject, 'someMethod' ] );<\/pre>\n<p>Unlike in Languages such as Python, that do provide proper function references, tools provide no support for the PHP approach\u00a0whatsoever. No autocompletion or type checking\u00a0in your IDE. No warnings from static code analysis tools. No &#8220;find usages&#8221; support.<\/p>\n<p><strong>Example<\/strong><\/p>\n<p>A common place where I run into this limitation is when I have a method\u00a0that needs to return a modified version of an input array.<\/p>\n<pre class=\"lang:php decode:true\">public function someStuff( array $input ) {\n    $output = [];\n\n    foreach ( $input as $element ) {\n        $output[] = $this-&gt;somePrivateMethod( $element );\n    }\n\n    return $output;\n}<\/pre>\n<p>In such cases array_map and\u00a0similar higher order functions are much nicer than creating additional state, doing an imperative loop and a bunch of assignments.<\/p>\n<pre class=\"lang:php decode:true \">public function someStuff( array $input ) {\n    return array_map(\n        [ $this, 'somePrivateMethod' ],\n        $input\n    );\n}<\/pre>\n<p>I consider the benefit of tool support\u00a0big enough to\u00a0prefer the following code over the above:<\/p>\n<pre class=\"lang:php decode:true\">public function someStuff( array $input ) {\n    return array_map(\n        function( $element ) {\n            return $this-&gt;somePrivateMethod( $element );\n        },\n        $input\n    );\n}<\/pre>\n<p>This does make the already hugely verbose array map even more verbose, and makes this one of these scenarios where I go &#8220;really PHP? really?&#8221; when I come across it.<\/p>\n<p><strong>Related: class references<\/strong><\/p>\n<p>A similar <a href=\"http:\/\/c2.com\/cgi\/wiki?StringlyTyped\">stringly-typed<\/a> problem in PHP used to be creating mocks in PHPUnit. Which of course is not a PHP problem (in itself), though still something affecting\u00a0many PHP projects.<\/p>\n<pre class=\"lang:php decode:true\">$kittenRepo = $this-&gt;getMock( 'Awesome\\Software\\KittenRepo' );<\/pre>\n<p>This causes the same types of problems as the lack of function references.\u00a0If you now\u00a0rename or move KittenRepo, tools will not update these string references. If you try to find usages of the class, you&#8217;ll miss this one, unless you do string search.<\/p>\n<p>Luckily PHP 5.5 introduced the <a href=\"http:\/\/php.net\/manual\/en\/language.oop5.basic.php#language.oop5.basic.class.class\"><code>class::<\/code>\u00a0construct<\/a>, which allows doing the following:<\/p>\n<pre class=\"lang:php decode:true\">$kittenRepo = $this-&gt;getMock( KittenRepo::class );<\/pre>\n<p>Where <code>KittenRepo<\/code> got imported with an use statement.<\/p>\n<p><strong>2022 update<\/strong><\/p>\n<p>As with several of the other <a href=\"https:\/\/www.entropywins.wtf\/blog\/2016\/01\/30\/missing-in-php7\/\">Missing In PHP 7<\/a> features, this one is now available! It has been introduced in <a href=\"https:\/\/www.php.net\/releases\/8.1\/en.php\">PHP 8.1<\/a> as &#8220;<a href=\"https:\/\/www.php.net\/manual\/en\/functions.first_class_callable_syntax.php\">First class callable syntax<\/a>&#8220;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is the first post in my Missing in PHP7 series. Over time, PHP has improved its capabilities with regards&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_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}},"categories":[7],"tags":[328,400,195,197,316],"class_list":["post-1577","post","type-post","status-publish","format-standard","hentry","category-programming","tag-clean-code","tag-functions","tag-php","tag-planet-wikimedia","tag-software-design"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Missing in PHP7: function references - Blog of Jeroen De Dauw<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.entropywins.wtf\/blog\/2016\/01\/30\/missing-in-php7-function-references\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Missing in PHP7: function references - Blog of Jeroen De Dauw\" \/>\n<meta property=\"og:description\" content=\"This is the first post in my Missing in PHP7 series. Over time, PHP has improved its capabilities with regards&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.entropywins.wtf\/blog\/2016\/01\/30\/missing-in-php7-function-references\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog of Jeroen De Dauw\" \/>\n<meta property=\"article:published_time\" content=\"2016-01-30T22:28:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-01-30T12:25:01+00:00\" \/>\n<meta name=\"author\" content=\"Jeroen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/JeroenDeDauw\" \/>\n<meta name=\"twitter:site\" content=\"@JeroenDeDauw\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeroen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.entropywins.wtf\\\/blog\\\/2016\\\/01\\\/30\\\/missing-in-php7-function-references\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.entropywins.wtf\\\/blog\\\/2016\\\/01\\\/30\\\/missing-in-php7-function-references\\\/\"},\"author\":{\"name\":\"Jeroen\",\"@id\":\"https:\\\/\\\/www.entropywins.wtf\\\/blog\\\/#\\\/schema\\\/person\\\/4e2ef14f2ca7dc3a0ac137d1692b66b7\"},\"headline\":\"Missing in PHP7: function references\",\"datePublished\":\"2016-01-30T22:28:41+00:00\",\"dateModified\":\"2022-01-30T12:25:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.entropywins.wtf\\\/blog\\\/2016\\\/01\\\/30\\\/missing-in-php7-function-references\\\/\"},\"wordCount\":317,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/www.entropywins.wtf\\\/blog\\\/#\\\/schema\\\/person\\\/4e2ef14f2ca7dc3a0ac137d1692b66b7\"},\"keywords\":[\"Clean Code\",\"Functions\",\"PHP\",\"Planet Wikimedia\",\"Software design\"],\"articleSection\":[\"Programming\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.entropywins.wtf\\\/blog\\\/2016\\\/01\\\/30\\\/missing-in-php7-function-references\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.entropywins.wtf\\\/blog\\\/2016\\\/01\\\/30\\\/missing-in-php7-function-references\\\/\",\"url\":\"https:\\\/\\\/www.entropywins.wtf\\\/blog\\\/2016\\\/01\\\/30\\\/missing-in-php7-function-references\\\/\",\"name\":\"Missing in PHP7: function references - Blog of Jeroen De Dauw\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.entropywins.wtf\\\/blog\\\/#website\"},\"datePublished\":\"2016-01-30T22:28:41+00:00\",\"dateModified\":\"2022-01-30T12:25:01+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.entropywins.wtf\\\/blog\\\/2016\\\/01\\\/30\\\/missing-in-php7-function-references\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.entropywins.wtf\\\/blog\\\/2016\\\/01\\\/30\\\/missing-in-php7-function-references\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.entropywins.wtf\\\/blog\\\/2016\\\/01\\\/30\\\/missing-in-php7-function-references\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.entropywins.wtf\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Missing in PHP7: function references\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.entropywins.wtf\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.entropywins.wtf\\\/blog\\\/\",\"name\":\"Entropy Wins\",\"description\":\"A blog on Software Architecture, Design and Craftsmanship\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.entropywins.wtf\\\/blog\\\/#\\\/schema\\\/person\\\/4e2ef14f2ca7dc3a0ac137d1692b66b7\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.entropywins.wtf\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.entropywins.wtf\\\/blog\\\/#\\\/schema\\\/person\\\/4e2ef14f2ca7dc3a0ac137d1692b66b7\",\"name\":\"Jeroen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d62e6b5b8e332335cf17854fac850d9c70ba367c4692872613c3110ebd4e009b?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d62e6b5b8e332335cf17854fac850d9c70ba367c4692872613c3110ebd4e009b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d62e6b5b8e332335cf17854fac850d9c70ba367c4692872613c3110ebd4e009b?s=96&d=mm&r=g\",\"caption\":\"Jeroen\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d62e6b5b8e332335cf17854fac850d9c70ba367c4692872613c3110ebd4e009b?s=96&d=mm&r=g\"},\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/jeroendedauw\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/JeroenDeDauw\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Missing in PHP7: function references - Blog of Jeroen De Dauw","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.entropywins.wtf\/blog\/2016\/01\/30\/missing-in-php7-function-references\/","og_locale":"en_US","og_type":"article","og_title":"Missing in PHP7: function references - Blog of Jeroen De Dauw","og_description":"This is the first post in my Missing in PHP7 series. Over time, PHP has improved its capabilities with regards&hellip;","og_url":"https:\/\/www.entropywins.wtf\/blog\/2016\/01\/30\/missing-in-php7-function-references\/","og_site_name":"Blog of Jeroen De Dauw","article_published_time":"2016-01-30T22:28:41+00:00","article_modified_time":"2022-01-30T12:25:01+00:00","author":"Jeroen","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/JeroenDeDauw","twitter_site":"@JeroenDeDauw","twitter_misc":{"Written by":"Jeroen","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.entropywins.wtf\/blog\/2016\/01\/30\/missing-in-php7-function-references\/#article","isPartOf":{"@id":"https:\/\/www.entropywins.wtf\/blog\/2016\/01\/30\/missing-in-php7-function-references\/"},"author":{"name":"Jeroen","@id":"https:\/\/www.entropywins.wtf\/blog\/#\/schema\/person\/4e2ef14f2ca7dc3a0ac137d1692b66b7"},"headline":"Missing in PHP7: function references","datePublished":"2016-01-30T22:28:41+00:00","dateModified":"2022-01-30T12:25:01+00:00","mainEntityOfPage":{"@id":"https:\/\/www.entropywins.wtf\/blog\/2016\/01\/30\/missing-in-php7-function-references\/"},"wordCount":317,"commentCount":3,"publisher":{"@id":"https:\/\/www.entropywins.wtf\/blog\/#\/schema\/person\/4e2ef14f2ca7dc3a0ac137d1692b66b7"},"keywords":["Clean Code","Functions","PHP","Planet Wikimedia","Software design"],"articleSection":["Programming"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.entropywins.wtf\/blog\/2016\/01\/30\/missing-in-php7-function-references\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.entropywins.wtf\/blog\/2016\/01\/30\/missing-in-php7-function-references\/","url":"https:\/\/www.entropywins.wtf\/blog\/2016\/01\/30\/missing-in-php7-function-references\/","name":"Missing in PHP7: function references - Blog of Jeroen De Dauw","isPartOf":{"@id":"https:\/\/www.entropywins.wtf\/blog\/#website"},"datePublished":"2016-01-30T22:28:41+00:00","dateModified":"2022-01-30T12:25:01+00:00","breadcrumb":{"@id":"https:\/\/www.entropywins.wtf\/blog\/2016\/01\/30\/missing-in-php7-function-references\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.entropywins.wtf\/blog\/2016\/01\/30\/missing-in-php7-function-references\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.entropywins.wtf\/blog\/2016\/01\/30\/missing-in-php7-function-references\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.entropywins.wtf\/blog\/"},{"@type":"ListItem","position":2,"name":"Missing in PHP7: function references"}]},{"@type":"WebSite","@id":"https:\/\/www.entropywins.wtf\/blog\/#website","url":"https:\/\/www.entropywins.wtf\/blog\/","name":"Entropy Wins","description":"A blog on Software Architecture, Design and Craftsmanship","publisher":{"@id":"https:\/\/www.entropywins.wtf\/blog\/#\/schema\/person\/4e2ef14f2ca7dc3a0ac137d1692b66b7"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.entropywins.wtf\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.entropywins.wtf\/blog\/#\/schema\/person\/4e2ef14f2ca7dc3a0ac137d1692b66b7","name":"Jeroen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/d62e6b5b8e332335cf17854fac850d9c70ba367c4692872613c3110ebd4e009b?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/d62e6b5b8e332335cf17854fac850d9c70ba367c4692872613c3110ebd4e009b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d62e6b5b8e332335cf17854fac850d9c70ba367c4692872613c3110ebd4e009b?s=96&d=mm&r=g","caption":"Jeroen"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/d62e6b5b8e332335cf17854fac850d9c70ba367c4692872613c3110ebd4e009b?s=96&d=mm&r=g"},"sameAs":["https:\/\/www.linkedin.com\/in\/jeroendedauw\/","https:\/\/x.com\/https:\/\/twitter.com\/JeroenDeDauw"]}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p74TBF-pr","jetpack-related-posts":[{"id":1629,"url":"https:\/\/www.entropywins.wtf\/blog\/2016\/02\/22\/missing-in-php7-collections\/","url_meta":{"origin":1577,"position":0},"title":"Missing in PHP7: Collections","author":"Jeroen","date":"2016-02-22","format":false,"excerpt":"This is the fourth post in my Missing in PHP7 series. The previous one is about Value Objects. In this post I'll outline some problems PHP has with regards to collections, the implications of those problems, and a few mitigation strategies. PHP arrays PHPs main collection type is the associative\u2026","rel":"","context":"In &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/www.entropywins.wtf\/blog\/category\/programming\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.entropywins.wtf\/blog\/wp-content\/uploads\/2016\/02\/dfp.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.entropywins.wtf\/blog\/wp-content\/uploads\/2016\/02\/dfp.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.entropywins.wtf\/blog\/wp-content\/uploads\/2016\/02\/dfp.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.entropywins.wtf\/blog\/wp-content\/uploads\/2016\/02\/dfp.jpg?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1582,"url":"https:\/\/www.entropywins.wtf\/blog\/2016\/02\/01\/missing-in-php7-named-parameters\/","url_meta":{"origin":1577,"position":1},"title":"Missing in PHP7: Named parameters","author":"Jeroen","date":"2016-02-01","format":false,"excerpt":"This is the second\u00a0post in my Missing in PHP7 series. The previous one is about\u00a0function references. 2020 update: named parameters will be in PHP 8 since the RFC passed. Readability of code is very important, and this is most certainly not readable: getCatPictures( 10, 0, true ); You can make\u2026","rel":"","context":"In &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/www.entropywins.wtf\/blog\/category\/programming\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1548,"url":"https:\/\/www.entropywins.wtf\/blog\/2016\/01\/30\/missing-in-php7\/","url_meta":{"origin":1577,"position":2},"title":"Missing in PHP7","author":"Jeroen","date":"2016-01-30","format":false,"excerpt":"I've decided to start a series of short blog posts on how PHP gets in the way of\u00a0creating of well designed applications, with a focus on missing features. The language flamewar PHP is one of those languages that people love to hate. Its standard library is widely inconsistent, and its\u2026","rel":"","context":"In &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/www.entropywins.wtf\/blog\/category\/programming\/"},"img":{"alt_text":"PHP7","src":"https:\/\/i0.wp.com\/www.entropywins.wtf\/blog\/wp-content\/uploads\/2016\/01\/PHP7.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1642,"url":"https:\/\/www.entropywins.wtf\/blog\/2016\/03\/05\/missing-in-php7-nullable-return-types\/","url_meta":{"origin":1577,"position":3},"title":"Missing in PHP7: Nullable return types","author":"Jeroen","date":"2016-03-05","format":false,"excerpt":"This is the fifth post in my Missing in PHP7 series. The previous one is about Collections. This is a short post, as there really is not much to explain or motivate. Nullable return types As of PHP7, we have return types at our disposal. Unfortunately, these have some annoying\u2026","rel":"","context":"In &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/www.entropywins.wtf\/blog\/category\/programming\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2848,"url":"https:\/\/www.entropywins.wtf\/blog\/2022\/01\/30\/value-objects-with-php-8-1\/","url_meta":{"origin":1577,"position":4},"title":"Value Objects with PHP 8.1","author":"Jeroen","date":"2022-01-30","format":false,"excerpt":"PHP has introduced a number of new features that allow you to write awesome Value Objects with PHP 8.1. In this post you will learn about each feature and how to put them all together. Back in the dark ages of 2016, shortly after PHP 7.0 was released, I wrote\u2026","rel":"","context":"In &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/www.entropywins.wtf\/blog\/category\/programming\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.entropywins.wtf\/blog\/wp-content\/uploads\/2016\/02\/i-will-always-favor-value-objects.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.entropywins.wtf\/blog\/wp-content\/uploads\/2016\/02\/i-will-always-favor-value-objects.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.entropywins.wtf\/blog\/wp-content\/uploads\/2016\/02\/i-will-always-favor-value-objects.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1898,"url":"https:\/\/www.entropywins.wtf\/blog\/2016\/12\/02\/php-7-1-is-awesome\/","url_meta":{"origin":1577,"position":5},"title":"PHP 7.1 is awesome","author":"Jeroen","date":"2016-12-02","format":false,"excerpt":"PHP 7.1 has been released, bringing some features I was eagerly anticipating and some surprises that had gone under my radar. New iterable pseudo-type This is the feature I'm most exited about, perhaps because I had no clue it was in the works. In short, iterable allows for type hinting\u2026","rel":"","context":"In &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/www.entropywins.wtf\/blog\/category\/programming\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.entropywins.wtf\/blog\/wp-json\/wp\/v2\/posts\/1577","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.entropywins.wtf\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.entropywins.wtf\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.entropywins.wtf\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.entropywins.wtf\/blog\/wp-json\/wp\/v2\/comments?post=1577"}],"version-history":[{"count":5,"href":"https:\/\/www.entropywins.wtf\/blog\/wp-json\/wp\/v2\/posts\/1577\/revisions"}],"predecessor-version":[{"id":2846,"href":"https:\/\/www.entropywins.wtf\/blog\/wp-json\/wp\/v2\/posts\/1577\/revisions\/2846"}],"wp:attachment":[{"href":"https:\/\/www.entropywins.wtf\/blog\/wp-json\/wp\/v2\/media?parent=1577"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.entropywins.wtf\/blog\/wp-json\/wp\/v2\/categories?post=1577"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.entropywins.wtf\/blog\/wp-json\/wp\/v2\/tags?post=1577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}