A Webel zone dedicated to attempts to interpret PHP as UMLTM.
From these minutes by Derick Rethans from a PHP Developer meeting from Nov 2005 (with comments related to typing of properties in future versions of PHP underlined):
5.8 Type-hinted properties and return values
Issue: PHP only supports type hinted arguments and not for return values or properties.
Discussion:
We quickly agreed that we don't need type-hinted properties, as it would cause problems when they are assigned to other variables and it's just generally not-PHP style.
For return values it does make some sense, but definitely not as much as type-hinted arguments to functions. One discussion point was how to tell the parser the return type of a functions, we came up with the following suggestions for syntax (where ObjectName is the type-hint):
function ObjectName &funcname();
function &ObjectName funcname();
function &funcname ObjectName();
ObjectName function &funcname();
function &funcname() returns ObjectName;
Conclusions:
We do not allow type-hinted properties as it's not the PHP way.
We will add support for type-hinted return values.
We need to pick a syntax for type-hinted return values.
What a shame this decision to not type-hint PHP properties is for reverse-engineering of PHP classes to UMLTM !
The image below shows an attempt to represent a simple PHP system (some scripts developed by Webel for client UnseenTV for bulk migration and administration of Drupal SimpleNews subscription data) in UMLTM by importing the XMI file generated by the PHP_UML tool into the MagicDrawTM UML tool.
Unfortunately - because PHP does not support typed Properties - it is very difficult to manage the Relationships between Classes ! PHP_UML uses an introduced DataType 'mixed' as a catch-all for any TypeAssociations. Instead Dependencies and Usages have been used.
The process shown requires so much intervention that the benefits of obtaining the UMLTM representation are undermined !
Note also that Visual Paradigm and Enterprise Architect both claim to reverse-engineer PHP to UML, and Enterprise Architect claims to be able to also generate PHP from class diagrams, and supports a degree of synchronised engineering. However if you look closely at the EA examples you'll see that in fact there is a contrived "links to / links from" system used to represent Relationships between Classes, instead of consistent Associations with Property ends !