3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Utils\Left { function whichHand() { echo "I'm using my left hand!"; } } namespace Utils\Right { function whichHand() { echo "I'm using my right hand!"; } } namespace { Utils\Left\whichHand(); Utils\Right\whichHand(); use function Utils\Left\whichHand as leftHand, Utils\Right\whichHand as rightHand; leftHand(); rightHand(); }
Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
I'm using my left hand!I'm using my right hand!I'm using my left hand!I'm using my right hand!
Output for 5.5.0 - 5.5.38
Parse error: syntax error, unexpected 'function' (T_FUNCTION), expecting identifier (T_STRING) or \\ (T_NS_SEPARATOR) in /in/cYH4r on line 19
Process exited with code 255.

preferences:
257.75 ms | 401 KiB | 330 Q