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
 [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: Mon Dec 30 14:01:28 2024 UTC