|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73300 crashe on late state binding call parent non static method
Submitted: 2016-10-12 09:55 UTC Modified: 2016-10-12 15:33 UTC
From: roman4e at gmail dot com Assigned: cmb (profile)
Status: Not a bug Package: Reproducible crash
PHP Version: 7.0.11 OS: Linux mint
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: roman4e at gmail dot com
New email:
PHP Version: OS:


 [2016-10-12 09:55 UTC] roman4e at gmail dot com
Trying to access parent method which overloaded in child with late state binding gets segmentation fault.

Test script:

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();

Expected result:
Do not known

Actual result:
Segmentation fault


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-10-12 14:09 UTC]
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2016-10-12 14:09 UTC]
This is expected behavior, because the script causes infinite
recursion, see <>, what is a programmer
 [2016-10-12 14:34 UTC] roman4e at gmail dot com
I think it should not be a segfault error but fatal error like "memory exceed" or too deep recursion, does it?
 [2016-10-12 15:33 UTC]
PHP does not check for infinite recursion for performance reasons.
See also <>.

You can install Xdebug in your development environment(s), and set
xdebug.max_nesting_level to an appropriate value.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Sep 21 14:01:25 2020 UTC