How to create annotations with ZF2 classes

Code
<?php

use Zend\Code\Annotation\Parser\GenericAnnotationParser;
use 
Zend\Code\Annotation\AnnotationManager;
use 
Zend\Code\Annotation\AnnotationInterface;
use 
Zend\Code\Reflection\PropertyReflection;
use 
Zend\Debug\Debug;

final class 
Foo implements AnnotationInterface
{
    public 
$value;
    
    public 
$value2;
    
    
// handle content parsing of annotation
    
public function initialize($content)
    {
        
// don't forget format errorhandling
        
$props explode(','$content);
        foreach(
$props as $propStr) {
            list(
$name$value) = explode('='trim($propStr));
            
$this->$name $value;
        }
    }
}

class 
MyClass
{
    
/**
     * @Foo(value=myValue, value2=1)
     */
    
private $myProp;
}

$parser = new GenericAnnotationParser();
$parser->registerAnnotation('Foo');

$annotationManager = new AnnotationManager();
$annotationManager->attach($parser);

$reflection = new PropertyReflection('MyClass''myProp');

$annotations $reflection
    
->getAnnotations($annotationManager);

Debug::dump($annotations[0]);
Result
object(Foo)#383 (2) {
  ["value"] => string(7) "myValue"
  ["value2"] => string(1) "1"
}
Used Versions
PHP 7.1, Zend 3.0, Symfony 3.2, Laravel 5.2, PHPUnit 5.6, Doctrine 2.6