php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #55191 PHP Object Oriented Approach
Submitted: 2011-07-12 12:58 UTC Modified: 2011-07-12 13:48 UTC
From: takingsides at gmail dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: Irrelevant OS: -
Private report: No CVE-ID: None
 [2011-07-12 12:58 UTC] takingsides at gmail dot com
Description:
------------
I was just wondering in the new version of PHP (PHP 6) I understand is becoming 
more OOP based, such as C, Ruby etc. I was wondering if every single function is 
going to be placed into an object?

This change request is simply to suggest an architecture for the new OOP 
approach 
to PHP, similarly to C/C++/C# and Ruby/Rails. Notonly implementing an OOP 
approach, but also forcing strict typing.

$a = "0";
$b = 0;

var_dump( ($a == $b), ($a === $b) ); // bool(true) bool(false)

to make == act like == automatically so strings/ints/bools cannot compare as 
TRUE?

--- Also: OOP ideas ---

$var = "test"; // basically becomes $test = new Object("test", "string");
$var->strtolower(); // test.
$var->strtoupper(); // TEST.
$var->ucfirst()->substr(0, 2); // Te (st is cut off).

class Object {

   protected $_var; // variable data
   protected $_type; // string, int, bool, resource, etc.

   public function __construct($element) ...

   public function strtolower() {
      // code
      return $this;
   }
   public function strtoupper() ...

}


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-12 13:48 UTC] cataphract@php.net
-Status: Open +Status: Bogus
 [2011-07-12 13:48 UTC] cataphract@php.net
This is not the place for brainstorming; see the internals mailing list instead, though I can tell you that essentially redesigning the language will not be seriously considered.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 11:01:34 2024 UTC