summaryrefslogtreecommitdiffstats
path: root/globals.php
diff options
context:
space:
mode:
authorKyle Kaminski <kyle@xenomedia.com>2014-04-01 01:23:49 -0500
committerKyle Kaminski <kyle@xenomedia.com>2014-04-01 01:23:49 -0500
commit0a99c2a0a1a23f60e3472a00540fefb4ffed35fb (patch)
treec0999113aec8f5a7f173976555b4024032e03b32 /globals.php
parent73a386618382e3f701c83fa46f6846ce0e250c86 (diff)
parent7bf745c1f1701a85126ce3ff9e60cb078bbcd57a (diff)
downloadphpsandbox-0a99c2a0a1a23f60e3472a00540fefb4ffed35fb.tar.gz
phpsandbox-0a99c2a0a1a23f60e3472a00540fefb4ffed35fb.tar.bz2
phpsandbox-0a99c2a0a1a23f60e3472a00540fefb4ffed35fb.zip
Merge branch 'master' of 192.168.2.103:/srv/git/phpsandbox
Diffstat (limited to 'globals.php')
-rw-r--r--globals.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/globals.php b/globals.php
new file mode 100644
index 0000000..ade8d6d
--- /dev/null
+++ b/globals.php
@@ -0,0 +1,16 @@
+<?php
+/*
+ *
+ */
+
+function foo() {
+ // when a file is included, the code it contains inherits the variable scope of the line on which the include occurs
+ include 'global_vars.php';
+ echo $color;
+}
+
+// prints green
+foo();
+
+// undefined
+echo $color;