
{"id":91,"date":"2010-08-15T00:32:42","date_gmt":"2010-08-14T22:32:42","guid":{"rendered":"http:\/\/sandshark.be\/blog\/?p=91"},"modified":"2010-08-18T19:03:24","modified_gmt":"2010-08-18T17:03:24","slug":"anonymous-functions-in-php","status":"publish","type":"post","link":"https:\/\/sandshark.be\/blog\/?p=91","title":{"rendered":"Anonymous functions in PHP"},"content":{"rendered":"<p>I recently discovered that since PHP 5.3.0 there are anonymous functions, also called lambda functions available.<br \/>\nThis is a very nice feature especially for registering a simple callback.<\/p>\n<p>An example:<\/p>\n<div>\n<pre><code> &lt;?php\r\n$func\u00a0=\u00a0function($value)\u00a0{\r\n return\u00a0$value\u00a0*\u00a02;\r\n};\r\n\r\nprint_r(array_map($func,\u00a0range(1,\u00a05)));\r\n?&gt; <\/code><\/pre>\n<\/div>\n<p>More information in the PHP Documentation can be found <a title=\"PHP Documentation\" href=\"http:\/\/php.net\/manual\/en\/functions.anonymous.php\" target=\"_blank\">here<\/a>.<\/p>\n<p>Also, im am trying to post more frequently, and soon reports of my trip to the states will come up here too.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently discovered that since PHP 5.3.0 there are anonymous functions, also called lambda functions available. This is a very nice feature especially for registering a simple callback. An example: &lt;?php $func\u00a0=\u00a0function($value)\u00a0{ return\u00a0$value\u00a0*\u00a02; }; print_r(array_map($func,\u00a0range(1,\u00a05))); ?&gt; More information in the PHP Documentation can be found here. Also, im am trying to post more frequently, and [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,3,6],"tags":[29,27],"_links":{"self":[{"href":"https:\/\/sandshark.be\/blog\/index.php?rest_route=\/wp\/v2\/posts\/91"}],"collection":[{"href":"https:\/\/sandshark.be\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sandshark.be\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sandshark.be\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sandshark.be\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=91"}],"version-history":[{"count":7,"href":"https:\/\/sandshark.be\/blog\/index.php?rest_route=\/wp\/v2\/posts\/91\/revisions"}],"predecessor-version":[{"id":98,"href":"https:\/\/sandshark.be\/blog\/index.php?rest_route=\/wp\/v2\/posts\/91\/revisions\/98"}],"wp:attachment":[{"href":"https:\/\/sandshark.be\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=91"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sandshark.be\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=91"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sandshark.be\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=91"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}