Updated examples to function correctly with new php4 module. Added

some supplemental examples for cpointer, overloading and references using
proxies.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7391 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Kevin Ruland 2005-08-24 16:32:41 +00:00
commit 501bd53c4b
44 changed files with 506 additions and 131 deletions

View file

@ -35,22 +35,28 @@ print " Square = (" . Shape_x_get($s) . "," . Shape_y_get($s) . ")\n";
# ----- Call some methods -----
# Notice how the Shape_area() and Shape_perimeter() functions really
# invoke the appropriate virtual method on each object.
print "\nHere are some properties of the shapes:\n";
foreach (array($c,$s) as $o) {
print " $o\n";
print " area = " . Shape_area($o) . "\n";
print " perimeter = " . Shape_perimeter($o) . "\n";
}
# Notice how the Shape_area() and Shape_perimeter() functions really
# invoke the appropriate virtual method on each object.
# ----- Delete everything -----
print "\nGuess I'll clean up now\n";
# Note: this invokes the virtual destructor
delete_Shape($c);
delete_Shape($s);
#delete_Shape($c);
#delete_Shape($s);
$c = NULL;
$s = NULL;
# and don't forget the $o from the for loop above. It still refers to
# the square.
$o = NULL;
print nshapes() . " shapes remain\n";
print "Goodbye\n";