Bug #73300 [Opn->Nab]: crashe on late state binding call parent non static method
| From: | cmb@php.net | Date: | Wed, 12 Oct 2016 14:10:00 +0000 |
| Subject: | Bug #73300 [Opn->Nab]: crashe on late state binding call parent non static method | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-204636@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73300&edit=1
ID: 73300
Updated by: cmb@php.net
Reported by: roman4e at gmail dot com
Summary: crashe on late state binding call parent non static
method
-Status: Open
+Status: Not a bug
Type: Bug
Package: Reproducible crash
Operating System: Linux mint
PHP Version: 7.0.11
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This is expected behavior, because the script causes infinite
recursion, see <https://3v4l.org/c1lM1>, what is a
programmer
error.
Previous Comments:
------------------------------------------------------------------------
[2016-10-12 09:55:34] roman4e at gmail dot com
Description:
------------
Trying to access parent method which overloaded in child with late state binding gets segmentation
fault.
Test script:
---------------
<?php
class A {
protected $data = [1,2,3,5];
public function data() { return $this->data; }
}
class B extends A {
protected $data = [5,6,7,89];
public function data() { return static::data(); }
}
$b = new B();
var_dump($b->data());
Expected result:
----------------
Do not known
Actual result:
--------------
Segmentation fault
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73300&edit=1