On Fri, Oct 19, 2018 at 9:45 AM Sebastian Bergmann <sebast...@php.net> wrote:
>
> Am 19.10.2018 um 12:22 schrieb Dmitry Stogov:
> > Mark "top-level" functions.
>
> What are top-level classes or functions? Thanks!
>
Simple version; It's one that's declared unconditionally.

<?php
// Top-level is here
function topLevelFoo() {}
class topLevelBar() {}

if (cond()) {
  // No longer top-level
  function conditionalFoo() {}
  class conditionalBar() {}
}

The longer answer is that it's not just conditionals that can make a
function/class "non-top-level", for example a namespace block makes
its declarations "non-top-level" but I suspect Dmitry will probably
address those in time.

-Sara

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to