3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace One { function strlen($s) { return '-NS-'; } var_dump(\strlen('HELLO')); var_dump(strlen('HELLO')); var_dump(namespace\strlen('HELLO')); } namespace Two { var_dump(\strlen('HELLO')); var_dump(strlen('HELLO')); var_dump(namespace\strlen('HELLO')); }
Output for 7.0.0 - 7.2.0
int(5) string(4) "-NS-" string(4) "-NS-" int(5) int(5) Fatal error: Uncaught Error: Call to undefined function Two\strlen() in /in/h5lMQ:16 Stack trace: #0 {main} thrown in /in/h5lMQ on line 16
Process exited with code 255.
Output for 5.3.18 - 5.6.28
int(5) string(4) "-NS-" string(4) "-NS-" int(5) int(5) Fatal error: Call to undefined function Two\strlen() in /in/h5lMQ on line 16
Process exited with code 255.