Questions tagged as 'spl'

2
answers

What are the differences between __autoload and spl_autoload_register?

In php, we have two methods of doing autoload of classes: function __autoload Example: function __autoload($class_name) { require_once $class_name . '.php'; } $obj = new MyClass1(); $obj2 = new MyClass2(); function spl_au...
asked by 16.07.2015 / 17:29
0
answers

ArrayIterator Flags

I do not understand what flags actually do STD_PROP_LIST and ARRAY_AS_PROPS when configured I looked for some examples, but the explanation was a bit confusing for me, I'm a beginner in php     
asked by 19.06.2017 / 17:41
1
answer

Is it possible to make a Class accessible in all namespaces?

The question is similar to this Instantiate class outside the namespace and has a good answer link However I would like to do this automatically. For example: Is it possible to make a Class accessible in all namespaces? Without using...
asked by 05.08.2015 / 19:33
1
answer

What is the SplStack class for?

According to PHP:   The SplStack class provides the main functionalities of a stack implemented using a doubly linked list. What do you mean:    The SplStack class provides the key functionality of a stack deployed using a double-linke...
asked by 17.08.2015 / 17:44
1
answer

class_exists is running spl_autoloader_register

I created a simple script to automatically load classes using spl_autoload_register , but I noticed a strange behavior, when I use class_exists spl_autoload_register is executed, for example: <?php function autoLoadClass($na...
asked by 16.10.2015 / 20:41
0
answers

Problem in Autoload PHP

I'm starting in POO and SPL and recently I faced the following problem: I have the following file that does all bootstrapping of my application init.php , and in it I do autoload of all classes from the lib /...
asked by 10.10.2017 / 16:57
1
answer

Undefined $ class_name in autoloader using spl_autoloader_register () with WAMP?

I'm trying to implement an autoloader for classes in my project, but I can not make this code work ... It returns the variable $ class_name as Undefined. function autoload_classes( $class_name ) { if ( ! empty( $class_name ) && file...
asked by 17.07.2015 / 22:15