I have a test.php:
<?php
include "MyString.php";
print ",";
print strlen("Hello world!");
and a MyString.php:
<?php
namespace MyFramework\String;
function strlen($str)
{
return \strlen($str)*2; // return double the string length
}
print strlen("Hello world!");
The output of test.php is 24,12 but how was the output produced? What are the execution flow of test.php?
Also there is a back slash in:
namespace MyFramework\String;
function strlen($str)
{
return \strlen($str)*2; // return double the string length
}
Is this '\' means using namespace?