3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A{ function a(){ function b(){ global $var1; echo $var1; // there is no var1 in the global scope so nothing to echo } } } $a = new A; a->a(); a->a();
Output for 5.5.24 - 5.5.31, 5.6.8 - 5.6.17, 7.0.0 - 7.0.2
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /in/4jcqX on line 14
Process exited with code 255.

preferences:
61.41 ms | 402 KiB | 26 Q