3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace { function foo($where) { echo "{$where}:\n"; debug_print_backtrace(); } call_user_func("foo", "No namespace"); echo "\n"; } namespace bar { call_user_func("foo", "In a namespace"); }
Output for 8.1.0 - 8.1.31, 8.2.0 - 8.2.27, 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
No namespace: #0 /in/q3qk5(10): foo('No namespace') In a namespace: #0 [internal function]: foo('In a namespace') #1 /in/q3qk5(18): call_user_func('foo', 'In a namespace')
Output for 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
No namespace: #0 foo(No namespace) called at [/in/q3qk5:10] In a namespace: #0 foo(In a namespace) #1 call_user_func(foo, In a namespace) called at [/in/q3qk5:18]

preferences:
155.61 ms | 408 KiB | 5 Q