I was interested in adding some feature to the php syntax, and definitly it's obvious for me it's different from writing modules for the language. I was wondering this requires to edit the resource in C which is avaialble on the php.net website and naturally C programming knowledge. Simply I want do the below:
xforeach ($array as $item with $counter) {
echo "This is $counter time this loop is happening";
}
Rather than writing:
$counter = 0;
foreach ($array as $item) {
echo "This is $counter time this loop is happening";
$counter ++;
}
or in another glimpse, adding attribute to each class or function, like it's possible in C#
class MyClass {
[Description("This is my php 6 version")]
public function Test() {
}
}
What is the first step on the way to achieving this approach?