Ok, so it's riddled with Notices but is still outputting results.
PHP Notice: Undefined variable: side in /home/thorpe/foo.php on line 70
Notice: Undefined variable: side in /home/thorpe/foo.php on line 70
PHP Notice: Use of undefined constant b - assumed 'b' in /home/thorpe/foo.php on line 72
Notice: Use of undefined constant b - assumed 'b' in /home/thorpe/foo.php on line 72
PHP Notice: Use of undefined constant a - assumed 'a' in /home/thorpe/foo.php on line 73
Notice: Use of undefined constant a - assumed 'a' in /home/thorpe/foo.php on line 73
PHP Strict Standards: Creating default object from empty value in /home/thorpe/foo.php on line 49
Strict Standards: Creating default object from empty value in /home/thorpe/foo.php on line 49
{"id_":0,"shapeType_":"Hexagon","coordinates_":[{"x_":50,"y_":50},{"x_":41.339745962156,"y_":45},{"x_":41.339745962156,"y_":45},{"x_":50,"y_":45},{"x_":50,"y_":45},{"x_":50,"y_":45}]}<BR>PHP Strict Standards: Creating default object from empty value in /home/thorpe/foo.php on line 23
Strict Standards: Creating default object from empty value in /home/thorpe/foo.php on line 23
{"coordinates_":[{"x_":50,"y_":50},{"x_":41.339745962156,"y_":45},{"x_":41.339745962156,"y_":45},{"x_":50,"y_":45},{"x_":50,"y_":45},{"x_":50,"y_":45}]}<BR>
As for why your getting different output. It's a bit hard to explain. But if you declared all your properties within the Pont object it would be fine. Basically, when you are looping through $this it is picking up the properties of the class your function is defined in at the time it is defined.