
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Malhar Lathkar has Published 154 Articles

Malhar Lathkar
686 Views
IntroductionMore than one namespaces can be defined in a single file with .php extension. There are two diferent methods prescribed for the purpose. combination syntax and bracketed syntaxMultiple Namespaces with Combination SyntaxIn this example two namespaces are defined one below the other. Resources in first namespace are available till second ... Read More

Malhar Lathkar
909 Views
IntroductionAn important feature of namespaces is the ability to refer to an external fully qualified name with an alias, or importing. PHP namespaces support following kinds of aliasing or importing −aliasing a class name, aliasing an interface name, aliasing a namespace namealiasing or importing function and constant names.In PHP, aliasing ... Read More

Malhar Lathkar
359 Views
IntroductionWhen PHP parser encounters an unqulified identifier such as class or function name, it resolves to current namespace. Therefore, to access PHP's predefined classes, they must be referred to by their fully qualified name by prefixing \.Using built-in classIn following example, a new class uses predefined stdClass as base class. ... Read More

Malhar Lathkar
257 Views
IntroductionIn absence of any namespace definition, all definitions of class, function etc. are placed in a global namespace. If a name is prefixed with \ , it will mean that the name is required from the global space even in the context of the namespace.Using global space specificationExampleIncluded files will default ... Read More

Malhar Lathkar
148 Views
IntroductionDeclaration of class, function and constants inside a namespace affects its acess, although any other PHP code can be present in it. PHP's namespace keyword is used to declare a new namespace. A file with .php extension must have namespace declaration in very first line after If namespace declaration is not ... Read More

Malhar Lathkar
429 Views
IntroductionIn PHP, namespace keyword is used to define a namespace. It is also used as an operator to request access to certain element in current namespace. The __NAMESPACE__ constant returns name of current namespace__NAMESPACE ConstantFrom a named namespace, __NAMESPACE__ returns its name, for global and un-named namespace it returns empty striingExample Live ... Read More

Malhar Lathkar
3K+ Views
IntroductionTraversing a big collection of data using looping construct such as foreach would require large memory and considerable processing time. With generators it is possible to iterate over a set of data without these overheads. A generator function is similar to a normal function. However, instead of return statement in ... Read More

Malhar Lathkar
552 Views
IntroductionWhen a generator function is called, internally, a new object of Generator class is returned. It implements the Iterator interface. The iterator interface defines following abstract methodsIterator::current — Return the current elementIterator::key — Return the key of the current elementIterator::next — Move forward to next elementIterator::rewind — Rewind the Iterator to the ... Read More

Malhar Lathkar
345 Views
IntroductionThrowable interface is implemented by Error and Exception class. All predefined Error classes are inherited from Error class. Instance of corresponding Error class is thrown inside try block and processed inside appropriate catch block.Throwing ErrorNormal execution (when no exception is thrown within the try block) will continue after that last ... Read More

Malhar Lathkar
606 Views
IntroductionBlocks of try - catch can be nested upto any desired levels. Exceptions will be handled in reverse order of appearance i.e. innermost exception processing is done first.ExampleIn following example, inner try block checks if either of two varibles are non-numeric, nd if so, throws a user defined exception. Outer ... Read More