Changeset 704

Show
Ignore:
Timestamp:
06/02/07 17:49:24 (2 years ago)
Author:
schst
Message:

Enable annotation example

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/examples/docroot/reflection/annotations.php

    r701 r704  
    103103checkForFoo('MyClass'); 
    104104checkForFoo('ConstantAnnotation'); 
    105 //checkForFoo('MyClass2'); 
     105checkForFoo('MyClass2'); 
    106106print "</pre>"; 
    107107 
     
    114114 
    115115        print "Annotation foo is present:\n"; 
    116         printf("bar : %s\n", var_export($foo->getBar(), true)); 
    117         printf("baz : %s\n", var_export($foo->getBaz(), true)); 
     116        printf("bar : %s\n", varToString($foo->getBar())); 
     117        printf("baz : %s\n", varToString($foo->getBaz(), true)); 
    118118    } else { 
    119119        print "Annotation foo is *not* present:\n"; 
     
    122122} 
    123123 
     124function varToString($var) { 
     125    if (is_object($var)) { 
     126        return $var->__toString(); 
     127    } 
     128    return var_export($var, true); 
     129} 
    124130?>