php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #47172 new interface suggest
Submitted: 2009-01-20 18:34 UTC Modified: 2012-11-14 01:02 UTC
From: info at netmosfera dot it Assigned:
Status: Wont fix Package: SPL related
PHP Version: 5.3.0alpha3 OS: irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
2 + 9 = ?
Subscribe to this entry?

 
 [2009-01-20 18:34 UTC] info at netmosfera dot it
Description:
------------
hello

please read the code!

hth

Reproduce code:
---------------
interface FirstLast //? lol!
{
    public function (Boolean) isFirst();
    public function (Boolean) isLast();
}

$x= new ArrayObject(Array(1,2,3,4,5,6,7)); // implements this..

foreach($x as $item)
{
    if($x->isFirst()) echo "<ul>";
    echo "<li>" . $item . "</li>";
    if($x->isLast()) echo "</ul>";
}


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-20 19:43 UTC] info at netmosfera dot it
another useful interface:

interface PrintReadable
{
     public printR();
}

print_r(new ArrayObject(.....));

useful to improve readability on items like this:

ArrayObject Object
(
    [storage:ArrayObject:private] => Array
        (
            [0] => ArrayObject Object
                (
                    [storage:ArrayObject:private] => Array
                        (
                            [0] => ArrayObject Object
                                (
                                    [storage:ArrayObject:private] => Array
                                        (
                                        )

                                )

                        )

                )

            [1] => ciao
        )

)
 [2011-04-08 20:45 UTC] jani@php.net
-Package: Feature/Change Request +Package: SPL related
 [2012-11-14 01:02 UTC] levim@php.net
-Status: Open +Status: Wont fix
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 23:01:26 2024 UTC