[PHP-DEV] Assign return value of function to property or replace parse error with nice fatal error

2016-07-11 Thread Khawer .
It would be better if we can assign return value of function to property. If not at least we should generate a nice error message. Currently when we try to assign return value of function to property we get the following error: Parse error: syntax error, unexpected '(', expecting ',' or ';' in in

[PHP-DEV] Change -> to dot(.)

2017-07-05 Thread Khawer .
In all major programming languages we access object properties and methods using dot(.). C#: Abc Abc = new Abc(); Abc.method(); Java: Abc Abc = new Abc(); Abc.method(); JavaScript: var apple = new function() { this.name = "Test"; } alert(apple.name()); Why not to make PHP similar to these

[PHP-DEV] Partial Classes

2017-07-06 Thread Khawer .
Partial Classes If we are using same class for different purposes we can extend it, and add new properties and methods. But we will also have to use new class name, when we create objects. C# provides a better concept "Partial Classes". Why not to also implement it in PHP? Example: Partial Class

[PHP-DEV] Changes in namespace importing

2017-11-23 Thread Khawer .
We use 'use' keyword to import other namespaces, namespace classes, namespace functions, and namespace constants. Example 1) use abc; (Import abc namespace) 2) use abc\ClassB; (Import ClassB from abc namespace) 3) use function abc\sayhello; (Import sayhello function from abc namespace) 4) use con