From: Operating system: PHP version: 6SVN-2010-04-19 (snap) Package: Strings related Bug Type: Feature/Change Request Bug description:String Objects?
Description:
------------
To make PHP more object-oriented it would be useful to give primitives
(Strings
especially, as they have a large number of related functions) a more OO
interface.
In the same way PHP5 introduced ArrayObject, it would be useful to create a
StringObject in PHP6.
E.g. example usage:
<?php
//Some example usage
$str = 'Foo';
echo $str->toLower();
echo $str->replace('Foo', 'Bar');
echo $str->replace('Foo', 'Bar')->toLower(); //ideally needs inbuilt
support for
chaining
echo $str; //could be done using __toString()
?>
This can be achieved at the moment by defining a StringObject class and
using
$str = new String('My String'); or similar. However, the usefulness is
limited
because there's no way to automatically wrap all strings within the
application.
--
Edit bug report at http://bugs.php.net/bug.php?id=51598&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=51598&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=51598&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=51598&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=51598&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=51598&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=51598&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=51598&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=51598&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=51598&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=51598&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=51598&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=51598&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=51598&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=51598&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51598&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51598&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=51598&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=51598&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=51598&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=51598&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=51598&r=mysqlcfg
