Answer the question
In order to leave comments, you need to log in
Is it possible in PHP to "turn out" a function in the namespace that called it?
Hello.
// некоторый файл a.php
$a = 1;
// некоторый файл b.php
$a = 1;
$b = 2;
// некоторый файл c.php, который подключает a.php
require 'a.php'; // a.php добавляется в пространство файла c.php
// некоторый файл d.php
function my_require($name) {
require $name.'.php'; // содержимое файла добавляется в пространство функции
}
my_require('a'); // как сделать так чтобы содержимое пространства функции развернулось в d.php?
Answer the question
In order to leave comments, you need to log in
If I understand the task correctly, then the traits
php.net/manual/ru/language.oop5.traits.php will do
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question