Skip to content

Commit db76b70

Browse files
hikari-no-yumenikic
authored andcommitted
Deprecate PHP 4 constructors
1 parent d252c9f commit db76b70

File tree

110 files changed

+219
-191
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+219
-191
lines changed

Zend/tests/019.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ class Point
201201
var $y;
202202
var $lable;
203203

204-
function Point($x, $y) {
204+
function __construct($x, $y) {
205205
$this->x = $x;
206206
$this->y = $y;
207207
}
@@ -1271,7 +1271,7 @@ bool(false)
12711271
bool(true)
12721272
array(3) {
12731273
[0]=>
1274-
string(5) "Point"
1274+
string(11) "__construct"
12751275
[1]=>
12761276
string(8) "setLable"
12771277
[2]=>

Zend/tests/bug18556.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ setlocale(LC_ALL, $g_lang);
88

99
class InfoBlob {
1010
var $foo;
11-
function InfoBlob() {
11+
function __construct() {
1212
$this->foo = "Foo";
1313
}
1414
}

Zend/tests/bug20240.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class test
99
{
1010
public $member;
1111

12-
function test() {
12+
function __construct() {
1313
$this->member = 1;
1414
register_shutdown_function(array($this, 'destructor'));
1515
}

Zend/tests/bug30080.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Bug #30080 (Passing array or non array of objects)
33
--FILE--
44
<?php
55
class foo {
6-
function foo($arrayobj) {
6+
function __construct($arrayobj) {
77
var_dump($arrayobj);
88
}
99
}

Zend/tests/bug32226.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Bug #32226 (SEGV with exception handler on non existing instance)
55

66
class A
77
{
8-
public function A()
8+
public function __construct()
99
{
1010
set_exception_handler(array($this, 'EH'));
1111

Zend/tests/bug39542/bug39542.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
class bug39542 {
3-
function bug39542() {
3+
function __construct() {
44
echo "ok\n";
55
}
66
}

Zend/tests/bug60536_001.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ class X {
88
}
99
class Y extends X {
1010
use T;
11-
function x() {
11+
function __construct() {
1212
return ++$this->x;
1313
}
1414
}
1515
class Z extends Y {
16-
function z() {
16+
function __construct() {
1717
return ++$this->x;
1818
}
1919
}
2020
$a = new Z();
21-
$a->x();
21+
$a->__construct();
2222
echo "DONE";
2323
?>
2424
--EXPECTF--

Zend/tests/bug65108.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class C {
88
}
99

1010
class B {
11-
public function B() {
11+
public function __construct() {
1212
$isCallable = is_callable(array(new C, 'f'));
1313
var_dump($isCallable);
1414
}

Zend/tests/bug65322.phpt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ set_error_handler(function($_, $msg, $file) {
1313
new B;
1414
});
1515

16-
eval('class A { function a() {} function __construct() {} }');
16+
/* This is just a particular example of a non-fatal compile-time error
17+
* If this breaks in future, just find another example and use it instead */
18+
eval('abstract class foo { abstract static function bar(); }');
1719

1820
?>
1921
--EXPECTF--
20-
string(50) "Redefining already defined constructor for class A"
22+
string(%d) "Static function foo::bar() should not be abstract"
2123
string(%d) "%s(%d) : eval()'d code"
2224
string(1) "B"

Zend/tests/errmsg_045.phpt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ set_error_handler(function($_, $msg, $file) {
88
echo $undefined;
99
});
1010

11-
eval('class A { function a() {} function __construct() {} }');
11+
/* This is just a particular example of a non-fatal compile-time error
12+
* If this breaks in future, just find another example and use it instead */
13+
eval('abstract class foo { abstract static function bar(); }');
1214

1315
?>
1416
--EXPECTF--
15-
string(50) "Redefining already defined constructor for class A"
17+
string(%d) "Static function foo::bar() should not be abstract"
1618
string(%d) "%s(%d) : eval()'d code"
1719

1820
Notice: Undefined variable: undefined in %s on line %d

0 commit comments

Comments
 (0)