Php namespace problem, why F1 (); calls the function of the nearest space, they are all in the same space?

<?php
namespace first;
function f1(){
    echo "f1-1";
}
namespace second;
function f1(){
    echo "f1-2";
}
f1();

/ / Why did you output F1-2? are they all in the same space? The principle of proximity?

Mar.08,2021

your way of writing, F1 (); is obviously under the namespace second, it must be the second one, ah, there is no principle of proximity. You will know in the back
echo _ _ NAMESPACE__;.


single file multiple namespaces are best to use {} to divide the space scope

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b355f8-2bfb8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b355f8-2bfb8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?