40 lines
758 B
Plaintext
40 lines
758 B
Plaintext
In PHP 5 both the way to declare a constructor and the way to make a call to a parent constructor have evolved. When declaring constructors with the PHP5 ``++__construct++`` name, nested calls to parent constructors should also use the new ``++__constructor++`` name.
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
----
|
|
class Foo extends Bar {
|
|
function __construct() {
|
|
parent::Bar();
|
|
}
|
|
}
|
|
----
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
----
|
|
class Foo extends Bar {
|
|
function __construct() {
|
|
parent::__construct();
|
|
}
|
|
}
|
|
----
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::message.adoc[]
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::comments-and-links.adoc[]
|
|
endif::env-github,rspecator-view[]
|