Welcome Guest, Not a member yet? Register   Sign In
Why using the "use function" import statements for PHP native functions?
#1
Question 
(This post was last modified: 01-13-2024, 08:50 AM by Muzikant.)

Hi. I am strugling to understand, why to use "use function" import statement for PHP native functions. An example code:

PHP Code:
<?php

namespace Acme\Package;

use 
Acme\Package\SomePackage;

// why this?
use function md5;
use function 
json_encode;

class 
AnotherPackage {
    // some code with using of a md5 and json_encode functions


Can you write me, why to import the PHP native functions? I have no idea and could not find an answer.
Reply


Messages In This Thread
Why using the "use function" import statements for PHP native functions? - by Muzikant - 01-13-2024, 08:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB