SlideShare a Scribd company logo
*
 ConFoo
 -
 Montreal/2013




Annotations
 in
 PHP
        y
 E xist!
   T he
                                                                              on
 twitter                          Rafael
 Dohms
                                                                                                                                                            @rdohms
Rafael Dohms




                                                                                                                                                                                          photo credit: Eli White
        @rdohms


 Evangelist, Speaker and
      Contributor.

Developer at WEBclusive.

Enabler at AmsterdamPHP.




            we
 make
 awesome
 crowd-funding
 software!
a
 little
 history                                                                                                                                                 existing
 uses



                                                                                     What?                                   Why?                                                             Where?




                                                                                                                           How?
                                                                                                                                     ustom
 ann otations
                                                                                     Impl ementing
 c DMSFilter
                                                                                             based
 on
 

                                                                                                                                       show
 me
 the
 code!
http://ecdesignrebels.blogspot.com




   w h a t?                                                                           ta tio ns?
                                            re
 an no
W ha t
 a
-- In English --
An annotation is a note that is made while
        reading any form of text.
something
 that
 describes
 an
 aspect
 of
 the
 subject



              -- In English --
An annotation is a note that is made while
        reading any form of text.
-- In Code Speak --

“An annotation is metadata attached to your
     code, that can be read at runtime.”



“Annotations do not directly affect program
               semantics”
-- In Code Speak --

“An annotation is metadata attached to your
     code, that can be read at runtime.”
   effects
 are
 only
 observed
 at


“Annotations do not directly affect program
               semantics”
-- In Code Speak --

“An annotation is metadata attached to your
     code, that can be read at runtime.”
   effects
 are
 only
 observed
 at


“Annotations do not directly affect program
               semantics”
                                                                                                                                                just
 like
 your
 notes
Annotations in the wild



                          C#
annotations

              Annotations in the wild



                                         C#
                                        attributes
@Entity
                   @Table(name = people)
                   class Person implements Serializable {
                     @Id
                     @GeneratedValue(strategy = GenerationType.AUTO)
                     private Integer id;


annotations

              Annotations in the wild



                                                      C#
                                                    attributes
@Entity
                           @Table(name = people)
                           class Person implements Serializable {
                             @Id
                             @GeneratedValue(strategy = GenerationType.AUTO)
                             private Integer id;


annotations

                  Annotations in the wild
 public class Customer




                                                              C#
 {
     [Required]
     [StringLength(50)]
     public string Prename { get; set; }

     [Column(TypeName = image)]
     public byte[] Image { get; set; }
                                                            attributes
@Entity
                           @Table(name = people)
                           class Person implements Serializable {
                             @Id
                             @GeneratedValue(strategy = GenerationType.AUTO)
                             private Integer id;


annotations                                                     after
 v1.5

                  Annotations in the wild
 public class Customer




                                                              C#
 {
     [Required]
     [StringLength(50)]
     public string Prename { get; set; }

     [Column(TypeName = image)]
     public byte[] Image { get; set; }
                                                            attributes
@Entity
                                                                                           @Table(name = people)
                                                                                           class Person implements Serializable {
                                                                                             @Id
                                                                                             @GeneratedValue(strategy = GenerationType.AUTO)
                                                                                             private Integer id;


annotations                                                                                                                     after
 v1.5

                                                                   Annotations in the wild
    public class Customer




                                                                                                                              C#
    {
        [Required]
        [StringLength(50)]
        public string Prename { get; set; }

                  [Column(TypeName = image)]
                  public byte[] Image { get; set; }
                                                                                                                            attributes
 since
 first
 release
Annotations in PHP - ConFoo 2013
No
 core
 
annotation
 support
Questions?
Questions?

I’m
 kidding!
Annotations in PHP - ConFoo 2013
Annotations in PHP - ConFoo 2013
phpDoc
~2000
PHP
 5.1
  Reflection
 supports
 
   getDocComments()



phpDoc
~2000                              2005
PHP
 5.1
                 Reflection
 supports
 
                  getDocComments()



phpDoc
~2000                                                                         2005



                                      First
 
                                   Annotation
 Engines
 in
 PHP
PHP
 5.1
                 Reflection
 supports
 
                  getDocComments()



phpDoc
~2000                                                                         2005                                   2008



                                      First
 
                                   Annotation
 Engines
 in
 PHP
PHP
 5.1
                 Reflection
 supports
 
                  getDocComments()



phpDoc
~2000                                                                         2005                                   2008



                                      First
 
                                                                                                                           Doctrine
 2
 
                                   Annotation
                                                                                                                        Annotation
 Engine
 Engines
 in
 PHP
PHP
 5.1
                 Reflection
 supports
 
                  getDocComments()

                                                                                                                      RFC:
 Annotations
 
                                                                                                                     in
 core
 w/
 custom
 
phpDoc                                                                                                                                                      syntax

~2000                                                                         2005                                   2008                                                       2010



                                      First
 
                                                                                                                                          Doctrine
 2
 
                                   Annotation
                                                                                                                                       Annotation
 Engine
 Engines
 in
 PHP
PHP
 5.1
                 Reflection
 supports
 
                  getDocComments()

                                                                                                                      RFC:
 Annotations
                             ED
                                                                                                                                                                                                 CTustom
 
                                                                                                                     in
 core
 JE/
 c
                                                                                                                                                                                               w
phpDoc                                                                                                                                                       E
                                                                                                                                                           Rsyntax
~2000                                                                         2005                                   2008                                          2010



                                      First
 
                                                                                                                                      Doctrine
 2
 
                                   Annotation
                                                                                                                                   Annotation
 Engine
 Engines
 in
 PHP
PHP

More Related Content

PDF
Annotating with Annotations - DPC UnCon
PDF
Annotating with Annotations - ForumPHP 2012
PDF
Annotations in PHP, They Exist.
PDF
Overcoming The Impedance Mismatch Between Source Code And Architecture
PDF
Yahoo! Open Technologies @NCU
PDF
Symfony2. Form and Validation
PDF
Annotations in PHP: They Exist
PDF
PHP Annotations: They exist! - JetBrains Webinar
Annotating with Annotations - DPC UnCon
Annotating with Annotations - ForumPHP 2012
Annotations in PHP, They Exist.
Overcoming The Impedance Mismatch Between Source Code And Architecture
Yahoo! Open Technologies @NCU
Symfony2. Form and Validation
Annotations in PHP: They Exist
PHP Annotations: They exist! - JetBrains Webinar

Similar to Annotations in PHP - ConFoo 2013 (20)

KEY
Annotating with Annotations
PDF
Annotating with Annotations - PHPBenelux June/2012
PDF
Xtext Webinar
PDF
Xtext Webinar
PDF
Extension and Evolution
PPTX
Getting started with titanium
PPT
iOS Application Development
PPTX
Getting started with Appcelerator Titanium
PPTX
Designing Optimized Symbols for InduSoft Web Studio Projects
PDF
Devoxx 2009: The Lift Framework
PPTX
Framework engineering JCO 2011
PDF
Model-Driven Software Development - Language Workbenches & Syntax Definition
PDF
.Net template solution architecture
PDF
Hexagonal architecture in PHP
PDF
201005 accelerometer and core Location
PPT
iPhone development from a Java perspective (Jazoon '09)
KEY
iPhone Development Intro
PPT
03 Object Relational Mapping
PDF
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...
Annotating with Annotations
Annotating with Annotations - PHPBenelux June/2012
Xtext Webinar
Xtext Webinar
Extension and Evolution
Getting started with titanium
iOS Application Development
Getting started with Appcelerator Titanium
Designing Optimized Symbols for InduSoft Web Studio Projects
Devoxx 2009: The Lift Framework
Framework engineering JCO 2011
Model-Driven Software Development - Language Workbenches & Syntax Definition
.Net template solution architecture
Hexagonal architecture in PHP
201005 accelerometer and core Location
iPhone development from a Java perspective (Jazoon '09)
iPhone Development Intro
03 Object Relational Mapping
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...
Ad

More from Rafael Dohms (20)

PDF
The Individual Contributor Path - DPC2024
PDF
Application Metrics - IPC2023
PDF
How'd we get here? A guide to Architectural Decision Records
PDF
Architectural Decision Records - PHPConfBR
PDF
Application Metrics (with Prometheus examples)
PDF
Application metrics - Confoo 2019
PDF
Writing code you won’t hate tomorrow - PHPCE18
PDF
Application Metrics (with Prometheus examples) #PHPDD18
PDF
Application metrics with Prometheus - DPC18
PDF
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf
PDF
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHP Yo...
PDF
Composer The Right Way - 010PHP
PDF
Writing Code That Lasts - #Magento2Seminar, Utrecht
PDF
Composer the Right Way - PHPSRB16
PDF
“Writing code that lasts” … or writing code you won’t hate tomorrow. - #PHPSRB16
PDF
Composer the Right Way - MM16NL
PDF
Composer The Right Way - PHPUGMRN
PDF
Composer the Right Way - PHPBNL16
PDF
“Writing code that lasts” … or writing code you won’t hate tomorrow.
PDF
A Journey into your Lizard Brain - PHP Conference Brasil 2015
The Individual Contributor Path - DPC2024
Application Metrics - IPC2023
How'd we get here? A guide to Architectural Decision Records
Architectural Decision Records - PHPConfBR
Application Metrics (with Prometheus examples)
Application metrics - Confoo 2019
Writing code you won’t hate tomorrow - PHPCE18
Application Metrics (with Prometheus examples) #PHPDD18
Application metrics with Prometheus - DPC18
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHP Yo...
Composer The Right Way - 010PHP
Writing Code That Lasts - #Magento2Seminar, Utrecht
Composer the Right Way - PHPSRB16
“Writing code that lasts” … or writing code you won’t hate tomorrow. - #PHPSRB16
Composer the Right Way - MM16NL
Composer The Right Way - PHPUGMRN
Composer the Right Way - PHPBNL16
“Writing code that lasts” … or writing code you won’t hate tomorrow.
A Journey into your Lizard Brain - PHP Conference Brasil 2015
Ad

Recently uploaded (20)

PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
A Presentation on Artificial Intelligence
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Spectroscopy.pptx food analysis technology
PDF
cuic standard and advanced reporting.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
Big Data Technologies - Introduction.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
Per capita expenditure prediction using model stacking based on satellite ima...
Building Integrated photovoltaic BIPV_UPV.pdf
NewMind AI Weekly Chronicles - August'25-Week II
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
A Presentation on Artificial Intelligence
Network Security Unit 5.pdf for BCA BBA.
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Machine learning based COVID-19 study performance prediction
Spectroscopy.pptx food analysis technology
cuic standard and advanced reporting.pdf
Programs and apps: productivity, graphics, security and other tools
Assigned Numbers - 2025 - Bluetooth® Document
Big Data Technologies - Introduction.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Unlocking AI with Model Context Protocol (MCP)

Annotations in PHP - ConFoo 2013