Category Archives: php

  • -

Deprecated features in php7.0

Category : php

Deprecated features in php7.0

Deprecated features in php7.0










PHP 4 style constructors

PHP 4 style constructors (methods that have the same name as the class they are defined in) are deprecated, and will be removed in the future. PHP 7 will emit E_DEPRECATED if a PHP 4 constructor is the only constructor defined within a class. Classes that implement a __construct() method are unaffected.

class foo {
    function foo() {
        echo ‘I am the constructor’;
The above example will output:

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; foo has a deprecated constructor in example.php on line 3
Static calls to non-static methods

Static calls to methods that are not declared static are deprecated, and may be removed in the future.

class foo {
    function bar() {
        echo ‘I am not static!’;

The above example will output:

Deprecated: Non-static method foo::bar() should not be called statically in – on line 8
I am not static!
password_hash() salt option

The salt option for the password_hash() function has been deprecated to prevent developers from generating their own (usually insecure) salts. The function itself generates a cryptographically secure salt when no salt is provided by the developer – therefore custom salt generation should not be needed.

capture_session_meta SSL context option

The capture_session_meta SSL context option has been deprecated. SSL metadata is now available through the stream_get_meta_data() function.

Content taken from

  • -

Changed functions in php7

Category : php

Changed functions in php7

Changed functions in php7










debug_zval_dump() now prints “int” instead of “long”, and “float” instead of “double”

dirname() now optionally takes a second parameter, depth, to get the name of the directory depth levels up from the current directory.

getrusage() is now supported on Windows.

mktime() and gmmktime() functions no longer accept is_dst parameter.

preg_replace() function no longer supports “\e” (PREG_REPLACE_EVAL). preg_replace_callback() should be used instead.

setlocale() function no longer accepts category passed as string. LC_* constants must be used instead.

exec(), system() and passthru() functions have NULL byte protection now.

  • -

New global constants in php7

Category : php

New global constants in php7

New global constants in php7










Core Predefined Constants in php








  • -

What are removed extensions in php7

Category : php

What are removed extensions in php7

What are removed extensions in php7










Removed Extensions and SAPIs

Removed Extensions


Removed SAPIs


  • -

php 7 other changes

Category : php

php 7 other changes

php 7 other changes











Globally reserved words as property, constant, and method names within classes, interfaces, and traits are now allowed. This reduces the surface of BC breaks when new keywords are introduced and avoids naming restrictions on APIs.

This is particularly useful when creating internal DSLs with fluent interfaces:

// 'new', 'private', and 'for' were previously unusable
Project::new('Project Name')->private()->for('purpose here')->with('username here');

The only limitation is that the class keyword still cannot be used as a constant name, otherwise it would conflict with the class name resolution syntax (ClassName::class)

Content taken from

  • -

New features in php7.0

Category : php

New features in php7.0

New features in php7.0










Scalar type declarations

Scalar type declarations come in two flavours: coercive (default) and strict. The following types for parameters can now be enforced (either coercively or strictly): strings (string), integers (int), floating-point numbers (float), and booleans (bool). They augment the other types introduced in PHP 5: class names, interfaces, array and callable.

// Coercive mode
function sumOfInts(int …$ints)
    return array_sum($ints);

var_dump(sumOfInts(2, ‘3’, 4.1));
The above example will output:

To enable strict mode, a single declare directive must be placed at the top of the file. This means that the strictness of typing for scalars is configured on a per-file basis. This directive not only affects the type declarations of parameters, but also a function’s return type (see return type declarations, built-in PHP functions, and functions from loaded extensions.

Full documentation and examples of scalar type declarations can be found in the type declaration reference.

Return type declarations

PHP 7 adds support for return type declarations. Similarly to argument type declarations, return type declarations specify the type of the value that will be returned from a function. The same types are available for return type declarations as are available for argument type declarations.


function arraysSum(array …$arrays): array
    return array_map(function(array $array): int {
        return array_sum($array);
    }, $arrays);

print_r(arraysSum([1,2,3], [4,5,6], [7,8,9]));
The above example will output:

    [0] => 6
    [1] => 15
    [2] => 24
Full documentation and examples of return type declarations can be found in the return type declarations. reference.

Null coalesce operator

The null coalesce operator (??) has been added as syntactic sugar for the common case of needing to use a ternary in conjunction with isset(). It returns its first operand if it exists and is not NULL; otherwise it returns its second operand.

// Fetches the value of $_GET[‘user’] and returns ‘nobody’
// if it does not exist.
$username = $_GET[‘user’] ?? ‘nobody’;
// This is equivalent to:
$username = isset($_GET[‘user’]) ? $_GET[‘user’] : ‘nobody’;

// Coalesces can be chained: this will return the first
// defined value out of $_GET[‘user’], $_POST[‘user’], and
// ‘nobody’.
$username = $_GET[‘user’] ?? $_POST[‘user’] ?? ‘nobody’;

Spaceship operator

The spaceship operator is used for comparing two expressions. It returns an integer less than, equal to, or greater than zero when $a is respectively less than, equal to, or greater than $b. Comparisons are performed according to PHP’s usual type comparison rules.

// Integers
echo 1 <=> 1; // 0
echo 1 <=> 2; // -1
echo 2 <=> 1; // 1

// Floats
echo 1.5 <=> 1.5; // 0
echo 1.5 <=> 2.5; // -1
echo 2.5 <=> 1.5; // 1
// Strings
echo “a” <=> “a”; // 0
echo “a” <=> “b”; // -1
echo “b” <=> “a”; // 1

Constant arrays using define()

Array constants can now be defined with define(). In PHP 5.6, they could only be defined with const.

define(‘ANIMALS’, [

echo ANIMALS[1]; // outputs “cat”

Anonymous classes

Support for anonymous classes has been added via new class. These can be used in place of full class definitions for throwaway objects:

interface Logger {
    public function log(string $msg);

class Application {
    private $logger;

    public function getLogger(): Logger {
         return $this->logger;

    public function setLogger(Logger $logger) {
         $this->logger = $logger;

$app = new Application;
$app->setLogger(new class implements Logger {
    public function log(string $msg) {
        echo $msg;

The above example will output:

object(class@anonymous)#2 (0) {
Full documentation can be found in the anonymous class reference.

Unicode codepoint escape syntax

This takes a Unicode codepoint in hexadecimal form, and outputs that codepoint in UTF-8 to a double-quoted string or a heredoc. Any valid codepoint is accepted, with leading 0’s being optional.

echo “\u{aa}”;
echo “\u{0000aa}”;
echo “\u{9999}”;
The above example will output:

ª (same as before but with optional leading 0’s)


Closure::call() is a more performant, shorthand way of temporarily binding an object scope to a closure and invoking it.

class A {private $x = 1;}

// Pre PHP 7 code
$getXCB = function() {return $this->x;};
$getX = $getXCB->bindTo(new A, ‘A’); // intermediate closure
echo $getX();

// PHP 7+ code
$getX = function() {return $this->x;};
echo $getX->call(new A);
The above example will output:


Filtered unserialize()

This feature seeks to provide better security when unserializing objects on untrusted data. It prevents possible code injections by enabling the developer to whitelist classes that can be unserialized.


// converts all objects into __PHP_Incomplete_Class object
$data = unserialize($foo, [“allowed_classes” => false]);

// converts all objects into __PHP_Incomplete_Class object except those of MyClass and MyClass2
$data = unserialize($foo, [“allowed_classes” => [“MyClass”, “MyClass2”]);

// default behaviour (same as omitting the second argument) that accepts all classes
$data = unserialize($foo, [“allowed_classes” => true]);


The new IntlChar class seeks to expose additional ICU functionality. The class itself defines a number of static methods and constants that can be used to manipulate unicode characters.


printf(‘%x’, IntlChar::CODEPOINT_MAX);
echo IntlChar::charName(‘@’);
The above example will output:

In order to use this class, the Intl extension must be installed.

Expectations in php7.0

Expectations are a backwards compatible enhancement to the older assert() function. They allow for zero-cost assertions in production code, and provide the ability to throw custom exceptions when the assertion fails.

While the old API continues to be maintained for compatibility, assert() is now a language construct, allowing the first parameter to be an expression rather than just a string to be evaluated or a boolean value to be tested.

ini_set(‘assert.exception’, 1);

class CustomError extends AssertionError {}

assert(false, new CustomError(‘Some error message’));
The above example will output:

Fatal error: Uncaught CustomError: Some error message
Full details on this feature, including how to configure it in both development and production environments, can be found in the expectations section of the assert() reference.

Group use declarations in php7.0

Classes, functions and constants being imported from the same namespace can now be grouped together in a single use statement.

// Pre PHP 7 code
use some\namespace\ClassA;
use some\namespace\ClassB;
use some\namespace\ClassC as C;

use function some\namespace\fn_a;
use function some\namespace\fn_b;
use function some\namespace\fn_c;

use const some\namespace\ConstA;
use const some\namespace\ConstB;
use const some\namespace\ConstC;

// PHP 7+ code
use some\namespace\{ClassA, ClassB, ClassC as C};
use function some\namespace\{fn_a, fn_b, fn_c};
use const some\namespace\{ConstA, ConstB, ConstC};

Generator Return Expressions

This feature builds upon the generator functionality introduced into PHP 5.5. It enables for a return statement to be used within a generator to enable for a final expression to be returned (return by reference is not allowed). This value can be fetched using the new Generator::getReturn() method, which may only be used once the generator has finishing yielding values.


$gen = (function() {
    yield 1;
    yield 2;

    return 3;

foreach ($gen as $val) {
    echo $val, PHP_EOL;

echo $gen->getReturn(), PHP_EOL;
The above example will output:

Being able to explicitly return a final value from a generator is a handy ability to have. This is because it enables for a final value to be returned by a generator (from perhaps some form of coroutine computation) that can be specifically handled by the client code executing the generator. This is far simpler than forcing the client code to firstly check whether the final value has been yielded, and then if so, to handle that value specifically.

Generator delegation in php

Generators can now delegate to another generator, Traversable object or array automatically, without needing to write boilerplate in the outermost generator by using the yield from construct.

function gen()
    yield 1;
    yield 2;
    yield from gen2();

function gen2()
    yield 3;
    yield 4;

foreach (gen() as $val)
    echo $val, PHP_EOL;
The above example will output:


Integer division with intdiv()

The new intdiv() function performs an integer division of its operands and returns it.

var_dump(intdiv(10, 3));
The above example will output:


Session options

session_start() now accepts an array of options that override the session configuration directives normally set in php.ini.

These options have also been expanded to support session.lazy_write, which is on by default and causes PHP to only overwrite any session file if the session data has changed, and read_and_close, which is an option that can only be passed to session_start() to indicate that the session data should be read and then the session should immediately be closed unchanged.

For example, to set session.cache_limiter to private and immediately close the session after reading it:

    ‘cache_limiter’ => ‘private’,
    ‘read_and_close’ => true,


The new preg_replace_callback_array() function enables code to be written more cleanly when using the preg_replace_callback() function. Prior to PHP 7, callbacks that needed to be executed per regular expression required the callback function to be polluted with lots of branching.

Now, callbacks can be registered to each regular expression using an associative array, where the key is a regular expression and the value is a callback.

CSPRNG Functions in php

Two new functions have been added to generate cryptographically secure integers and strings in a cross platform way: random_bytes() and random_int().

list() can always unpack objects implementing ArrayAccess

Previously, list() was not guaranteed to operate correctly with objects implementing ArrayAccess. This has been fixed.


Content taken from

  • -

New Classes and Interfaces in php7.0

Category : php

New Classes and Interfaces in php7.0

New Classes and Interfaces in php7.0










Exception Hierarchy






Session Handling


  • -

  • -

PHP-Fusion´s features at a glance

Category : php

PHP-Fusion´s features at a glance

PHP-Fusion´s features at a glance










General Information of php fusion

License : AGPL
Programming Language : PHP 5
Data Management : MySQL
PDO & MySQL Database layer
IPv6 Support
XHTML 1.0 Valid

Basic Features of php fusion

SEO – Search Engine Optimization
SEF – Search Engine Friendly URLs
Theming – Front and Back-end
Multilingual Capabilities
User Preferences
Multi Site
Web Links
News System
Photo Gallery
Articles System
FaQ System
Contact Form
Multilingual API
Comments API
Ratings API
Search API
Site Polls
Forum Polls

Output Handling of php fusion

Custom head tags for all scripts
Custom Output Handlers
Output Manipulation
Dynamic Page Titles

Themes of php fusion
Front-end Themes
Back-end Themes
Table Themes
Div Themes

Customization Options of php fusion

Custom SEO/SEF Modules
Custom Multilingual content
Custom URL error reports
Custom Search Modules
Custom User Fields
Custom Infusions
Custom BBCodes
Custom Themes
Custom Smileys
Custom Panels
Custom Pages

Security of php fusion
Members Management (Suspensions, Bans, Security Bans, Anonymize, Deactivate)
Users can log in on different devices simultaneously setting
Maintenance mode can be activated
Unique Form Tokens
MIME file checker
Bad words list
Email Bans
Password Hashing
Admin Rights
Securimage 2
Panel Disabling
Admin Password
User Admin Separated by Rights
Flood Control
Bad Words Filter
Flood Auto Ban Option
SHA256 password hashing
Individual salt for all users
Errors only visible for Administrators

Site settings of php fusion

Site Protocol
Site Host
Site Path
Site Port
Site Keywords
Site Description
Site Locale
Enabled Languages
SMTP Port    
SMTP Authentication
SMTP Username    
SMTP Password
Site Theme
Admin Theme
Error Log
User Log
Default search location
Admin Password Reset
Drag and Drop panels
Edit robots.txt
Custom Error Logging
Use TinyMCE HTML editor
Allow Guests to post
Enable comment system
Enable avatar comments
Enable ratings system
Enable visitor counter
Display site render time ( Yes, All, Yes, Only Admins, No )
Login method ( Username, Email or Both )
Tables with Multilingual content toggler for each Addon
Enabling / Disabling user Theme Changes
Include or Exclude a panel from certain pages
Include or Exclude a panel from certain Languages
Choice of Captchas
SEO / SEF Engine (On or Off)

User Levels
User Groups
User Fields
User Fields Categories
Public / Private Profiles Option
Super Admin All Access
Submissions ( News, Photos, Articles, Links, Downloads )
Edit / Delete Own Comments
Edit / Delete own Shouts
Admin Options in Profile
User Avatar Auto Resize
Members Management
User Bans
Private Messages
IP Bans
Registration Terms
User Management Admin Settings
Visitor Counter Toggle On / Off
Online Users Panel
User Info Panel
Email activation
Custom required fields
Avatar Resize

News Language
Start and end date
Custom News Images
News Image Link Option
Number of news items displayed Option

Forum Language
Forum Privileges
Forum Categories
Moderation Feature
Thread Tracking
Usergroup as Moderator
Forum Polls
Mass Post Delete
Mass Thread Delete
Post Moving / Merging
Seperate Forum Prune
Image Resizing
Forum Ranks
Forum Threads Panels
Flood Control
Print Post
Print Thread
Numbered Posts
Links to Posts
Member IP Visible for Admins
Locale buttons
Edit / Delete own Posts
Locale dependent forum buttons
User Group Forum Ranks
Multiple attachments
Attachment rights
Display default avatar image
Post Edit Reason
Post Auto Merger
Go to Top

Article Language


Web Links
Site Name
Site URL

Photo Albums
Move Images
Photo Upload
Album Language
Album ordering
Photo ordering
GD Compression
Photo Mass Uploads
Delete Full Albums

Short description
URL or File upload
Calculate file size toggler
License option
O/S option
Version option
Homepage option
Copyright option
Filesize option

Time and Date Settings
News & Articles date formats
Sub-header date formats
Forum date formats
Default timezones
Short date format
Long date format
Server offset
Guests offset

3rd party components
jQuery Cookie
jQuery UI
jQuery Highlight

Labels for check boxes
Items Per Page Settings (Forums, Articles, Downloads, News, Links, Shouts)
Enable disable Comments & Ratings Admin Option
Hidden threads / posts / comments / shouts
PHP Info
CSS Classes
Captcha API

Custom Admin Rights
Custom Multilanguage Table Rights

Language panel
User Info panel
Member poll panel
Forum threads panel
CSS Navigation panel
Latest articles panel
Welcome message panel
Latest comments panel
Latest downloads panel
Forum threads list panel
RSS Feeds panel

Content taken from

  • -


Category : php













PHP development began in 1994 when Rasmus Lerdorf wrote a series of Common Gateway Interface (CGI) binaries in C, which he used to maintain his personal homepage. He extended them to add the ability to work with web forms and to communicate with databases, and called this implementation “Personal Home Page/Forms Interpreter” or PHP/FI.

PHP/FI could be used to build simple, dynamic web applications. Lerdorf initially announced the release of PHP/FI as “Personal Home Page Tools (PHP Tools) version 1.0” publicly to accelerate bug location and improve the code, on the Usenet discussion group comp.infosystems.www.authoring.cgi on June 8, 1995. This release already had the basic functionality that PHP has as of 2013. This included Perl-like variables, form handling, and the ability to embed HTML. The syntax resembled that of Perl but was simpler, more limited and less consistent.

Early PHP was not intended to be a new programming language, and grew organically, with Lerdorf noting in retrospect: “I don’t know how to stop it, there was never any intent to write a programming language […] I have absolutely no idea how to write a programming language, I just kept adding the next logical step on the way.”[16] A development team began to form and, after months of work and beta testing, officially released PHP/FI 2 in November 1997.

One criticism of PHP is that it was not originally designed, but instead it was developed organically; among other things, this has led to inconsistent naming of functions and inconsistent ordering of their parameters. In some cases, the function names were chosen to match the lower-level libraries which PHP was “wrapping”, while in some very early versions of PHP the length of the function names was used internally as a hash function, so names were chosen to improve the distribution of hash values.

PHP 3 and 4

Zeev Suraski and Andi Gutmans rewrote the parser in 1997 and formed the base of PHP 3, changing the language’s name to the recursive acronym PHP: Hypertext Preprocessor.Afterwards, public testing of PHP 3 began, and the official launch came in June 1998. Suraski and Gutmans then started a new rewrite of PHP’s core, producing the Zend Engine in 1999. They also founded Zend Technologies in Ramat Gan, Israel.

On May 22, 2000, PHP 4, powered by the Zend Engine 1.0, was released. As of August 2008 this branch reached version 4.4.9. PHP 4 is no longer under development nor will any security updates be released.


On July 13, 2004, PHP 5 was released, powered by the new Zend Engine II. PHP 5 included new features such as improved support for object-oriented programming, the PHP Data Objects (PDO) extension (which defines a lightweight and consistent interface for accessing databases), and numerous performance enhancements. In 2008 PHP 5 became the only stable version under development. Late static binding had been missing from PHP and was added in version 5.3.

Many high-profile open-source projects ceased to support PHP 4 in new code as of February 5, 2008, because of the GoPHP5 initiative, provided by a consortium of PHP developers promoting the transition from PHP 4 to PHP 5.

Over time, PHP interpreters became available on most existing 32-bit and 64-bit operating systems, either by building them from the PHP source code, or by using pre-built binaries. For the PHP versions 5.3 and 5.4, the only available Microsoft Windows binary distributions were 32-bit x86 builds, requiring Windows 32-bit compatibility mode while using Internet Information Services (IIS) on a 64-bit Windows platform. PHP version 5.5 made the 64-bit x86-64 builds available for Microsoft Windows.

PHP 6 and Unicode[edit]

PHP received mixed reviews due to lacking native Unicode support at the core language level.[33][34] In 2005, a project headed by Andrei Zmievski was initiated to bring native Unicode support throughout PHP, by embedding the International Components for Unicode (ICU) library, and representing text strings as UTF-16 internally. Since this would cause major changes both to the internals of the language and to user code, it was planned to release this as version 6.0 of the language, along with other major features then in development.

However, a shortage of developers who understood the necessary changes, and performance problems arising from conversion to and from UTF-16, which is rarely used in a web context, led to delays in the project.[37] As a result, a PHP 5.3 release was created in 2009, with many non-Unicode features back-ported from PHP 6, notably namespaces. In March 2010, the project in its current form was officially abandoned, and a PHP 5.4 release was prepared containing most remaining non-Unicode features from PHP 6, such as traits and closure re-binding.[38] Initial hopes were that a new plan would be formed for Unicode integration, but as of 2014 none has been adopted.

PHP 7[edit]

As of 2015, work is underway on a new major PHP version named PHP 7. There was some dispute as to whether the next major version of PHP was to be called PHP 6 or PHP 7. While the PHP 6 Unicode experiment had never been released, a number of articles and book titles referenced the old PHP 6 name, which might have caused confusion if a new release were to reuse the PHP 6 name. After a vote, the name PHP 7 was chosen.

PHP 7 gets its foundations from an experimental PHP branch that was originally named phpng (PHP next generation), which aims at optimizing PHP performance by refactoring the Zend Engine while retaining near-complete language compatibility. As of 14 July 2014, WordPress-based benchmarks, which serve as the main benchmark suite for the phpng project, show an almost 100% increase in performance. Changes from phpng are also expected to make it easier to improve performance in the future, as more compact data structures and other changes are seen as better suited for a successful migration to a just-in-time (JIT) compiler. Because of the significant changes, this reworked Zend Engine will be called Zend Engine 3, succeeding the Zend Engine 2 used in PHP 5.

Because of phpng’s major internal changes, it would have to go into a new major version of PHP, rather than a minor 5.x release, according to PHP’s release process,[44] thus spawning PHP 7. Major versions of PHP are allowed to break code backwards-compatibility, and so PHP 7 presented an opportunity to make other improvements beyond phpng that require backwards-compatibility breaks. In particular, the following backwards-compatibility breaks were made:

Many “fatal” or “recoverable”-level legacy PHP “errors” were replaced with modern object-oriented exceptions[45]

The syntax for variable dereferencing was reworked to be more internally consistent and complete, allowing the use of ->, [], (), {}, and :: operators with arbitrary meaningful left-hand-side expressions

Support for legacy PHP 4-style constructor methods was deprecated
The behaviour of the foreach statement was changed to be more predictable

Constructors for the few classes built-in to PHP which returned null upon failure were changed to throw an exception instead, for consistency

Several unmaintained or deprecated SAPIs and extensions were removed from the PHP core, most notably the legacy mysql extension

The behaviour of the list() operator was changed to remove support for strings

Support for legacy ASP-style PHP code delimeters (<% and %>, <script language=php> and </script>) was removed

An oversight allowing a switch statement to have multiple default clauses was fixed

Support for hexadecimal number support in some implicit conversions from strings to number types was removed

The left-shift and right-shift operators were changed to behave more consistently across platforms

Conversions between integers and floating point numbers were tightened and made more consistent across platforms.

PHP 7 will also include new language features. Most notably, it will introduce return type declarations, which will complement its existing parameter type declarations, and support for the scalar types (integer, float, string and boolean) in parameter and return type declarations.

Content taken from

Fatal error: Call to undefined function weblizar_navigation() in /home/websolutionsdone/public_html/wp-content/themes/ielts-career/category.php on line 23