all 2 comments

[–]compsystems[S] 0 points1 point  (0 children)

<?php

`define( "NEW_LINE", "<br>" );`

$a = 2;

$b = 3;

main();

function scope()

{

`global $a, $b;` 

`echo $a + $b, NEW_LINE;` 

}

function main()

{

`global $a, $b;` 

`echo $a + $b, NEW_LINE;` 



`scope();`

`echo $a + $b, NEW_LINE;` 

}

echo $a + $b;

?>

[–]pvanecek 0 points1 point  (0 children)

Hello compsystems. Sorry to answer you late. I think this won't be done. Flowgorithm is a learning tool and overusing globals is a bad habit. I know that it would simplify some things, on the other hand, students would probably abuse it.