<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Eduard Llach</title>
    <description>The latest articles on DEV Community by Eduard Llach (@eduardllach).</description>
    <link>https://dev.to/eduardllach</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F107473%2F0c9a819c-90ef-45ed-b70b-632c2ff351a9.jpeg</url>
      <title>DEV Community: Eduard Llach</title>
      <link>https://dev.to/eduardllach</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/eduardllach"/>
    <language>en</language>
    <item>
      <title>Stack local functions in PHP</title>
      <dc:creator>Eduard Llach</dc:creator>
      <pubDate>Fri, 12 Oct 2018 10:15:50 +0000</pubDate>
      <link>https://dev.to/eduardllach/stack-local-functions-in-php-1i27</link>
      <guid>https://dev.to/eduardllach/stack-local-functions-in-php-1i27</guid>
      <description>&lt;p&gt;Recently, in one of my projects I needed to pass a local function to "stack" it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a local function?
&lt;/h2&gt;

&lt;p&gt;In php a local function is a function within a function&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  What I needed?
&lt;/h2&gt;

&lt;p&gt;Well, basically I needed is to stack function calls in a list, so I could call it later.&lt;/p&gt;

&lt;p&gt;In PHP you have the callable type, and you can call any function that is globally accessible or a method of an object which is &lt;em&gt;globally&lt;/em&gt; accessible, knowing the function's name.&lt;/p&gt;

&lt;h2&gt;
  
  
  The solution
&lt;/h2&gt;

&lt;p&gt;I used an interface to do something like this:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;What do you thing?&lt;br&gt;
Have I done an complicated workaround just to skip doing a function globally available and protected by a namespace?&lt;/p&gt;

</description>
      <category>php</category>
    </item>
  </channel>
</rss>
