diff options
| author | Andrea Faulds <ajf@ajf.me> | 2015-03-31 16:10:22 +0200 |
|---|---|---|
| committer | Nikita Popov <nikic@php.net> | 2015-03-31 17:55:27 +0200 |
| commit | db76b708cf14ed2794d26600c0e49df8aa36fbea (patch) | |
| tree | 043fe016f4319fea36c3208af06c227ceb7bb459 /tests | |
| parent | d252c9f8324a1fac35aac01b7de7cc800ea76865 (diff) | |
| download | php-git-db76b708cf14ed2794d26600c0e49df8aa36fbea.tar.gz | |
Deprecate PHP 4 constructors
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/classes/clone_006.phpt | 2 | ||||
| -rw-r--r-- | tests/classes/ctor_dtor.phpt | 8 | ||||
| -rw-r--r-- | tests/classes/dereferencing_001.phpt | 4 | ||||
| -rw-r--r-- | tests/classes/object_reference_001.phpt | 2 | ||||
| -rw-r--r-- | tests/lang/028.phpt | 2 | ||||
| -rw-r--r-- | tests/lang/030.phpt | 2 | ||||
| -rw-r--r-- | tests/lang/035.phpt | 2 | ||||
| -rw-r--r-- | tests/lang/bug20175.phpt | 4 | ||||
| -rw-r--r-- | tests/lang/bug21849.phpt | 2 | ||||
| -rw-r--r-- | tests/lang/bug21961.phpt | 4 | ||||
| -rw-r--r-- | tests/lang/bug23489.phpt | 2 | ||||
| -rw-r--r-- | tests/lang/bug24926.phpt | 2 | ||||
| -rw-r--r-- | tests/lang/error_2_exception_001.phpt | 2 |
13 files changed, 19 insertions, 19 deletions
diff --git a/tests/classes/clone_006.phpt b/tests/classes/clone_006.phpt index de22fec151..15f0a5ec52 100644 --- a/tests/classes/clone_006.phpt +++ b/tests/classes/clone_006.phpt @@ -10,7 +10,7 @@ error_reporting=2047 class MyCloneable { static $id = 0; - function MyCloneable() { + function __construct() { $this->id = self::$id++; } diff --git a/tests/classes/ctor_dtor.phpt b/tests/classes/ctor_dtor.phpt index ea6813cc96..6af863e576 100644 --- a/tests/classes/ctor_dtor.phpt +++ b/tests/classes/ctor_dtor.phpt @@ -6,7 +6,7 @@ ZE2 The new constructor/destructor is called <?php class early { - function early() { + function __construct() { echo __CLASS__ . "::" . __FUNCTION__ . "\n"; } function __destruct() { @@ -24,7 +24,7 @@ class late { } $t = new early(); -$t->early(); +$t->__construct(); unset($t); $t = new late(); //unset($t); delay to end of script @@ -32,8 +32,8 @@ $t = new late(); echo "Done\n"; ?> --EXPECTF-- -early::early -early::early +early::__construct +early::__construct early::__destruct late::__construct Done diff --git a/tests/classes/dereferencing_001.phpt b/tests/classes/dereferencing_001.phpt index dd2aba78e5..886baeb288 100644 --- a/tests/classes/dereferencing_001.phpt +++ b/tests/classes/dereferencing_001.phpt @@ -6,7 +6,7 @@ ZE2 dereferencing of objects from methods <?php class Name { - function Name($_name) { + function __construct($_name) { $this->name = $_name; } @@ -18,7 +18,7 @@ class Name { class Person { private $name; - function person($_name, $_address) { + function __construct($_name, $_address) { $this->name = new Name($_name); } diff --git a/tests/classes/object_reference_001.phpt b/tests/classes/object_reference_001.phpt index 74acb5de13..f114d1aa95 100644 --- a/tests/classes/object_reference_001.phpt +++ b/tests/classes/object_reference_001.phpt @@ -8,7 +8,7 @@ ZE2 object references class Foo { public $name; - function Foo() { + function __construct() { $this->name = "I'm Foo!\n"; } } diff --git a/tests/lang/028.phpt b/tests/lang/028.phpt index bd4525ee60..2c51b79cb2 100644 --- a/tests/lang/028.phpt +++ b/tests/lang/028.phpt @@ -28,7 +28,7 @@ function dafna() class dafna_class { - function dafna_class() { + function __construct() { $this->myname = "Dafna"; } function GetMyName() { diff --git a/tests/lang/030.phpt b/tests/lang/030.phpt index 758369bf08..9ee40ea5aa 100644 --- a/tests/lang/030.phpt +++ b/tests/lang/030.phpt @@ -3,7 +3,7 @@ $this in constructor test --FILE-- <?php class foo { - function foo($name) { + function __construct($name) { $GLOBALS['List']= &$this; $this->Name = $name; $GLOBALS['List']->echoName(); diff --git a/tests/lang/035.phpt b/tests/lang/035.phpt index 9472999f47..a5e3a7f4cc 100644 --- a/tests/lang/035.phpt +++ b/tests/lang/035.phpt @@ -5,7 +5,7 @@ ZE2: set_exception_handler() --FILE-- <?php class MyException extends Exception { - function MyException($_error) { + function __construct($_error) { $this->error = $_error; } diff --git a/tests/lang/bug20175.phpt b/tests/lang/bug20175.phpt index bee3688d66..a3fdd297e1 100644 --- a/tests/lang/bug20175.phpt +++ b/tests/lang/bug20175.phpt @@ -95,7 +95,7 @@ $oop_global = 0; class oop_class { var $oop_name; - function oop_class() { + function __construct() { global $oop_global; echo "oop_class()\n"; $this->oop_name = 'oop:' . ++$oop_global; @@ -105,7 +105,7 @@ class oop_class { class oop_test { static $oop_value; - function oop_test() { + function __construct() { echo "oop_test()\n"; } diff --git a/tests/lang/bug21849.phpt b/tests/lang/bug21849.phpt index 30b311320b..2ce99769d9 100644 --- a/tests/lang/bug21849.phpt +++ b/tests/lang/bug21849.phpt @@ -5,7 +5,7 @@ Bug #21849 (self::constant doesn't work as method's default parameter) class foo { const bar = "fubar\n"; - function foo($arg = self::bar) { + function __construct($arg = self::bar) { echo $arg; } } diff --git a/tests/lang/bug21961.phpt b/tests/lang/bug21961.phpt index 24581d663e..9b7199208d 100644 --- a/tests/lang/bug21961.phpt +++ b/tests/lang/bug21961.phpt @@ -8,7 +8,7 @@ Bug #21961 (get_parent_class() segfault) class man { public $name, $bars; - function man() + function __construct() { $this->name = 'Mr. X'; $this->bars = array(); @@ -29,7 +29,7 @@ class bar extends man { public $name; - function bar($w) + function __construct($w) { $this->name = $w; } diff --git a/tests/lang/bug23489.phpt b/tests/lang/bug23489.phpt index 645bb1b7df..c8535c5123 100644 --- a/tests/lang/bug23489.phpt +++ b/tests/lang/bug23489.phpt @@ -3,7 +3,7 @@ Bug #23489 (ob_start() is broken with method callbacks) --FILE-- <?php class Test { - function Test() { + function __construct() { ob_start( array( $this, 'transform' diff --git a/tests/lang/bug24926.phpt b/tests/lang/bug24926.phpt index 3d2cc7008b..8f853dba47 100644 --- a/tests/lang/bug24926.phpt +++ b/tests/lang/bug24926.phpt @@ -9,7 +9,7 @@ class foo { public $functions = array(); - function foo() + function __construct() { $function = create_function('', 'return "FOO\n";'); print($function()); diff --git a/tests/lang/error_2_exception_001.phpt b/tests/lang/error_2_exception_001.phpt index 61f45d47d5..9596ba2331 100644 --- a/tests/lang/error_2_exception_001.phpt +++ b/tests/lang/error_2_exception_001.phpt @@ -6,7 +6,7 @@ ZE2 errors caught as exceptions <?php class MyException extends Exception { - function MyException($_errno, $_errmsg) { + function __construct($_errno, $_errmsg) { $this->errno = $_errno; $this->errmsg = $_errmsg; } |
