<?php $x = 1; echo $x, PHP_EOL; function foo() { $x = 2; echo $x, PHP_EOL;} foo(); echo $x, PHP_EOL;
Standard input is empty
1 2 1
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!