php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70215 segfault when __invoke is static
Submitted: 2015-08-08 14:00 UTC Modified: 2015-08-08 14:18 UTC
From: sjon at hortensius dot net Assigned: bwoebi (profile)
Status: Closed Package: Reproducible crash
PHP Version: 7.0.0beta3 OS: archlinux
Private report: No CVE-ID: None
 [2015-08-08 14:00 UTC] sjon at hortensius dot net
Description:
------------
PHP correctly shows a Warning, but also segfaults when executing the script. This should be fixed, or the Warning should be updated to a Fatal instead

7beta3 is the only version that has this problem as can be seen on http://3v4l.org/C9KDr

Test script:
---------------
<?php

class A {
	public static function __invoke()
    {
        echo __CLASS__;
    }
}

class B extends A {
}

$b = new B;

$b();

Expected result:
----------------
Warning: The magic method __invoke() must have public visibility and cannot be static in /in/C9KDr on line 4
A

Actual result:
--------------
Warning: The magic method __invoke() must have public visibility and cannot be static in /in/C9KDr on line 4
Process exited with code 139.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-08-08 14:18 UTC] bwoebi@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: bwoebi
 [2015-08-08 14:19 UTC] bwoebi@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=cab75d8b00b6e86f6e2ede1ba3b3bd35518fc3bd
Log: Fixed bug #70215 (segfault when __invoke is static)
 [2015-08-08 14:19 UTC] bwoebi@php.net
-Status: Assigned +Status: Closed
 [2015-08-18 16:24 UTC] ab@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=cab75d8b00b6e86f6e2ede1ba3b3bd35518fc3bd
Log: Fixed bug #70215 (segfault when __invoke is static)
 [2016-07-20 11:37 UTC] davey@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=cab75d8b00b6e86f6e2ede1ba3b3bd35518fc3bd
Log: Fixed bug #70215 (segfault when __invoke is static)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC