|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #59562 extend Spl-class and override a methode
Submitted: 2011-01-06 05:28 UTC Modified: 2017-01-10 08:15 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: coola at arcor dot de Assigned:
Status: Suspended Package: SPL_Types (PECL)
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: coola at arcor dot de
New email:
PHP Version: OS:


 [2011-01-06 05:28 UTC] coola at arcor dot de

i would like to do something like that:

   class A extends SplInt // extends SplInt
      protected $x;
      protected $y;
      public function __construct($x, $y)
         $this->x = $x;
         $this->y = $y;
      public function splIntMethode($other, $operator) // override SplInt-Methode
         if($operator != '+')
            throw new Exception();
         if(!($other instanceof A))
            throw new Exception();

         return new A($this->x + $other->x, $this->y + $other->y);
   $a0 = new A(1,2);
   $a1 = new A(3,4); // $a1 is the '$other'-Objekt at methode splIntMethode
   $a2 = $a0 + $a1;  // $operator +


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-07-02 21:10 UTC] tobihille at gmail dot com
Crashed on my System (PHP 5.5 fpm on OpenSuse) when extending SplType.

At least Extension of SplType should be possible.

My Code:


class ConvChar extends SplType
    private $__default = 0;

    public function __construct($initial_value, $strict = true)
        $this->__default = $initial_value;
 [2017-01-10 08:15 UTC]
-Status: Open +Status: Suspended
 [2017-01-10 08:15 UTC]
Suspending this report as the extension have not had a release for almost 5 years.  Please revive this if the extension once again shows life
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 01 05:01:29 2024 UTC