2 ### THIS VERSION was written for when php global vars fakingly mirrored
3 ### the wrapped global vars, but it was very inefficient.
4 ### For now we don't do this (pending some changes to php itself) so
5 ### we use accessor functions instead; WE KEEP THIS version around ready
6 ### for when those php changes are made and we can switch back.
7 ### Specifically we want $_GLOBALS variable overloading like object
8 ### property overloading
10 require "example.php";
12 /* Try to set the values of some global variables */
25 $strvar = "Hello World";
27 $iptrvar = new_int(37);
28 $ptptr = new_point(37,42);
31 echo "Variables (values printed from PHP)\n";
33 echo "ivar = $ivar\n";
34 echo "svar = $svar\n";
35 echo "lvar = $lvar\n";
36 echo "uivar = $uivar\n";
37 echo "usvar = $usvar\n";
38 echo "ulvar = $ulvar\n";
39 echo "scvar = $scvar\n";
40 echo "ucvar = $ucvar\n";
41 echo "cvar = $cvar\n";
42 echo "fvar = $fvar\n";
43 echo "dvar = $dvar\n";
44 echo "strvar = $strvar\n";
45 echo "cstrvar = $cstrvar\n";
46 echo "iptrvar = $iptrvar\n";
47 echo "name = $name\n";
48 echo "ptptr = $ptptr" , point_print($ptptr) , "\n";
49 echo "pt = $pt" , point_print($pt) , "\n";
51 echo "\nVariables (values printed from C)\n";
55 echo "\nI'm going to try and update a structure variable.\n";
59 echo "The new value is \n";
63 echo "You should see the value", point_print($ptptr), "\n";
65 echo "\nNow I'm going to try and modify some read only variables\n";
67 echo "Trying to set 'path'\n";
69 /* Sadly this works */
71 echo "Path = $path\n";
73 echo "Trying to set 'status'\n";
77 echo "Status = $status\n";