php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #72462 documentation about static calls from secondary object is outdated
Submitted: 2016-06-21 06:16 UTC Modified: 2016-06-21 14:41 UTC
From: info at developiu dot it Assigned: cmb (profile)
Status: Closed Package: Documentation problem
PHP Version: 7.0.7 OS: centos linux
Private report: No CVE-ID: None
 [2016-06-21 06:16 UTC] info at developiu dot it
Description:
------------
http://php.net/manual/en/language.oop5.basic.php says: 
"The pseudo-variable $this is available when a method is called from within an object context. $this is a reference to the calling object (usually the object to which the method belongs, but possibly another object, if the method is called statically from the context of a secondary object)."
Immediately after that, a test script ("Example 2") is given with expected output.

In php 7 the value of this is set to null when calling statically from a secondary object (see http://php.net/manual/en/migration70.incompatible.php, section "Calls from incompatible context removed"), this documentation is now outdated.In fact, if I run the script "Example 2" I do not get the results expected in the documentation.

my php version:
[cesco@localhost ~]$ php --version
PHP 7.0.7 (cli) (built: May 28 2016 07:53:22) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
    with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans



have a nice day
Francesco


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-06-21 14:38 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=339436
Log: Fix #72462: documentation about static calls from secondary object is outdated
 [2016-06-21 14:40 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2016-06-21 14:40 UTC] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 [2016-06-21 14:41 UTC] info at developiu dot it
Thank you for the fast fix. have a nice day
 [2020-02-07 06:07 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=4392990fb654c30e30019ef1ed41721956dd5bf8
Log: Fix #72462: documentation about static calls from secondary object is outdated
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 04:00:01 2026 UTC