Malhar Lathkar has Published 155 Articles

PHP declare Statement

Malhar Lathkar

Malhar Lathkar

Updated on 18-Sep-2020 12:52:13

490 Views

IntroductionSyntax of declare statement in PHP is similar to other flow control structures such as while, for, foreach etc.Syntaxdeclare (directive) {    statement1;    statement2;    . . }Behaviour of the block is defined by type of directive. Three types of directives can be provided in declare statement - ticks, ... Read More

PHP Unsetting References

Malhar Lathkar

Malhar Lathkar

Updated on 18-Sep-2020 12:18:59

215 Views

IntroductionIt is possible to break binding between the content and variable by using unset() function. The unset() function doesn't destroy the content but only decouples variable from it.Example Live DemoOutputAfter unsetting, $b can be used as normal vaiablebefore unsetting : 10 10 after unsetting : 10 20Reference can also be removed ... Read More

PHP Spotting References

Malhar Lathkar

Malhar Lathkar

Updated on 18-Sep-2020 12:17:24

150 Views

IntroductionMany syntax constructs in PHP are implemented via referencing mechanisms. If reference to a global variable is unset in a function, the same variable in global namespace is not removed.Example Live DemoOutputGlobal $va1 is intact.Hello World, Hello World Hello PHP, Hello PHP Hello PHPdebug_zval_dump() function can be used if a variable ... Read More

PHP Return by Reference

Malhar Lathkar

Malhar Lathkar

Updated on 18-Sep-2020 12:16:07

745 Views

IntroductionIn PHP,   a function can also be made to return a reference. This is useful  to find to which variable a reference should be bound. To define a function which returns reference, prefix its name by & sign.ExampleIn following example, myfunction() is defined to return by reference. It contains ... Read More

PHP Passing by Reference

Malhar Lathkar

Malhar Lathkar

Updated on 18-Sep-2020 12:13:27

10K+ Views

IntroductionIn PHP,  arguments to a function can be passed by value or passed by reference. By default, values of actual arguments are passed by value to formal arguments which become local variables inside the function. Hence, modification to these variables doesn't change value of actual argument variable.When arguments are passed ... Read More

PHP References

Malhar Lathkar

Malhar Lathkar

Updated on 18-Sep-2020 12:10:17

3K+ Views

IntroductionIn PHP, References enable accessing the same variable content by different names. They are not like pointers in C/C++ as it is not possible to perform arithmetic oprations using them. In C/C++, they are actual memory addresses. In PHP in contrast, they are symbol table aliases. In PHP, variable name ... Read More

PHP $_SERVER

Malhar Lathkar

Malhar Lathkar

Updated on 18-Sep-2020 12:05:38

4K+ Views

Introduction$_SERVER is a superglobal that holds information regarding HTTP headers, path and script location etc. All the server and execution environment related information is available in this associative array. Most of the entries in this array are populated by web server.PHP versions prior to 5.4.0 contained $HTTP_SERVER_VARS contained same information but ... Read More

PHP Visibility modes

Malhar Lathkar

Malhar Lathkar

Updated on 18-Sep-2020 11:56:56

2K+ Views

IntroductionIn PHP, it is possible to have a user-defined compund data type using class keyword. A new instance of class is an object. Charactersitics of object are as per definition of class, which may contain property, constant and method members.Accessibility (also called visibility) of a class member depends on visibility ... Read More

PHP Late Static Bindings

Malhar Lathkar

Malhar Lathkar

Updated on 18-Sep-2020 11:48:26

180 Views

IntroductionThis feature of late static binding in PHP is used to refercalled class in static inheritance. When static methods are called, name of class is attached with scope resolution operator (::) while in case of other instance methods we call them using name of object. The static:: will not be ... Read More

PHP Object Serialization

Malhar Lathkar

Malhar Lathkar

Updated on 18-Sep-2020 11:38:42

1K+ Views

IntroductionA string representation of any object in the form of byte-stream is obtained by serialze() function in PHP. All property variables of object are contained in the string and methods are not saved. This string can be stored in any file.To retrieve the object from the byte stream, there is ... Read More

Previous 1 ... 6 7 8 9 10 ... 16 Next
Advertisements