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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: info at netmosfera dot it
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Sat Dec 21 12:01:31 2024 UTC