Re: PHP header files, restrict to declaring code only

From: Date: Fri, 10 May 2019 13:40:44 +0000
Subject: Re: PHP header files, restrict to declaring code only
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-105663@lists.php.net to get a copy of this message
On Fri, May 10, 2019 at 9:15 AM Lynn <kjarli@gmail.com> wrote: > > 2. Certain features, can be restricted to php-header files only, meaning it > does not affect > "normal" PHP files. This might open up a whole new range of syntax > possibilities that > are currently blocked, such as @trigger_error() vs > @Annotation(). > Hi Lynn, thank you for opening this discussion! Could you explain how the range of syntax you suggest (regarding annotations) is currently blocked? I'm not challenging your claim; I *personally* don't know and am interested. While certainly not supported natively, comment-based "annotations" can be implemented in user-land and processed via reflection (See doctrine-annotations[1]). There has also been previous work and discussion in the annotation space [2][3][4][5]. Based on my light reading, I couldn't find any objections to annotations with side-effects, but I could see that as an argument. However, I'm more curious what your perspective is. Personally, I really like the idea of being able to declare "side-effect free" as a feature. I don't know if I prefer the idea of a phph file, distinguished by extension (so I'm glad you mention alternatives such as declare). That said, I think that's mostly from shock and not wanting to ever go back to a world that included *.php4, *.php5, *.phtml, etc. :) Hope all is well, 1: https://www.doctrine-project.org/projects/doctrine-annotations/en/latest/index.html 2: https://wiki.php.net/rfc/annotations 3: https://externals.io/message/82813 4: https://externals.io/message/64895 5: https://externals.io/message/64722 -- Dustin Wheeler | Software Developer NC State University mdwheele@ncsu.edu "If you don't know where you're going, it's easy to iteratively not get there."

« previous php.internals (#105663) next »