Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $x = 5; // global scope
- function myTest() {
- // using x inside this function will generate an error
- echo "<p>Variable x inside function is: $x</p>";
- }
- myTest();
- echo "<p>Variable x outside function is: $x</p>";
- ?>
Add Comment
Please, Sign In to add comment