3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php define('A', 1); define('B', 1); if(defined('A')) { function a() { echo "hello from `".__FUNCTION__."`\n"; } } if(defined('B')) { function b() { echo "hello from `".__FUNCTION__."`\n"; } } echo function_exists("b") ? "b is defined\n" : "b is not defined\n"; a(); echo function_exists("b") ? "b is defined\n" : "b is not defined\n"; b(); a(); echo function_exists("b") ? "b is defined\n" : "b is not defined\n";
based on p9b0e
Output for 4.3.0 - 7.1.0
b is defined hello from `a` b is defined hello from `b` hello from `a` b is defined