<?php
class Foo {
public function __construct($a, $b)
{
var_dump($a, $b);
}
}
class Bar {
public function __construct($a)
{
var_dump($a);
}
}
class Baz {
public function __construct($a, $b)
{
Foo::__construct($a, $b);
}
}
$baz = new Baz("foo", "bar");
Fatal error: Uncaught Error: Non-static method Foo::__construct() cannot be called statically in /in/dbc21:20
Stack trace:
#0 /in/dbc21(24): Baz->__construct('foo', 'bar')
#1 {main}
thrown in /in/dbc21 on line 20
Process exited with code 255.
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Fatal error: Non-static method Foo::__construct() cannot be called statically, assuming $this from incompatible context in /in/dbc21 on line 20
Process exited with code 255.