Deprecate PHP 4 constructors

This commit is contained in:
Andrea Faulds 2015-03-31 16:10:22 +02:00 committed by Nikita Popov
parent d252c9f832
commit db76b708cf
110 changed files with 219 additions and 191 deletions

View file

@ -201,7 +201,7 @@ class Point
var $y; var $y;
var $lable; var $lable;
function Point($x, $y) { function __construct($x, $y) {
$this->x = $x; $this->x = $x;
$this->y = $y; $this->y = $y;
} }
@ -1271,7 +1271,7 @@ bool(false)
bool(true) bool(true)
array(3) { array(3) {
[0]=> [0]=>
string(5) "Point" string(11) "__construct"
[1]=> [1]=>
string(8) "setLable" string(8) "setLable"
[2]=> [2]=>

View file

@ -8,7 +8,7 @@ setlocale(LC_ALL, $g_lang);
class InfoBlob { class InfoBlob {
var $foo; var $foo;
function InfoBlob() { function __construct() {
$this->foo = "Foo"; $this->foo = "Foo";
} }
} }

View file

@ -9,7 +9,7 @@ class test
{ {
public $member; public $member;
function test() { function __construct() {
$this->member = 1; $this->member = 1;
register_shutdown_function(array($this, 'destructor')); register_shutdown_function(array($this, 'destructor'));
} }

View file

@ -3,7 +3,7 @@ Bug #30080 (Passing array or non array of objects)
--FILE-- --FILE--
<?php <?php
class foo { class foo {
function foo($arrayobj) { function __construct($arrayobj) {
var_dump($arrayobj); var_dump($arrayobj);
} }
} }

View file

@ -5,7 +5,7 @@ Bug #32226 (SEGV with exception handler on non existing instance)
class A class A
{ {
public function A() public function __construct()
{ {
set_exception_handler(array($this, 'EH')); set_exception_handler(array($this, 'EH'));

View file

@ -1,6 +1,6 @@
<?php <?php
class bug39542 { class bug39542 {
function bug39542() { function __construct() {
echo "ok\n"; echo "ok\n";
} }
} }

View file

@ -8,17 +8,17 @@ class X {
} }
class Y extends X { class Y extends X {
use T; use T;
function x() { function __construct() {
return ++$this->x; return ++$this->x;
} }
} }
class Z extends Y { class Z extends Y {
function z() { function __construct() {
return ++$this->x; return ++$this->x;
} }
} }
$a = new Z(); $a = new Z();
$a->x(); $a->__construct();
echo "DONE"; echo "DONE";
?> ?>
--EXPECTF-- --EXPECTF--

View file

@ -8,7 +8,7 @@ class C {
} }
class B { class B {
public function B() { public function __construct() {
$isCallable = is_callable(array(new C, 'f')); $isCallable = is_callable(array(new C, 'f'));
var_dump($isCallable); var_dump($isCallable);
} }

View file

@ -13,10 +13,12 @@ set_error_handler(function($_, $msg, $file) {
new B; new B;
}); });
eval('class A { function a() {} function __construct() {} }'); /* This is just a particular example of a non-fatal compile-time error
* If this breaks in future, just find another example and use it instead */
eval('abstract class foo { abstract static function bar(); }');
?> ?>
--EXPECTF-- --EXPECTF--
string(50) "Redefining already defined constructor for class A" string(%d) "Static function foo::bar() should not be abstract"
string(%d) "%s(%d) : eval()'d code" string(%d) "%s(%d) : eval()'d code"
string(1) "B" string(1) "B"

View file

@ -8,11 +8,13 @@ set_error_handler(function($_, $msg, $file) {
echo $undefined; echo $undefined;
}); });
eval('class A { function a() {} function __construct() {} }'); /* This is just a particular example of a non-fatal compile-time error
* If this breaks in future, just find another example and use it instead */
eval('abstract class foo { abstract static function bar(); }');
?> ?>
--EXPECTF-- --EXPECTF--
string(50) "Redefining already defined constructor for class A" string(%d) "Static function foo::bar() should not be abstract"
string(%d) "%s(%d) : eval()'d code" string(%d) "%s(%d) : eval()'d code"
Notice: Undefined variable: undefined in %s on line %d Notice: Undefined variable: undefined in %s on line %d

View file

@ -24,7 +24,6 @@ new B;
?> ?>
--EXPECTF-- --EXPECTF--
Strict Standards: Redefining already defined constructor for class B in %s on line %d
array(2) { array(2) {
[0]=> [0]=>
string(1) "a" string(1) "a"

View file

@ -3171,7 +3171,7 @@ void zend_compile_method_call(znode *result, zend_ast *ast, uint32_t type) /* {{
} }
/* }}} */ /* }}} */
zend_bool zend_is_constructor(zend_string *name) /* {{{ */ static zend_bool zend_is_constructor(zend_string *name) /* {{{ */
{ {
return zend_string_equals_literal_ci(name, ZEND_CONSTRUCTOR_FUNC_NAME); return zend_string_equals_literal_ci(name, ZEND_CONSTRUCTOR_FUNC_NAME);
} }
@ -4409,10 +4409,6 @@ void zend_begin_method_decl(zend_op_array *op_array, zend_string *name, zend_boo
ce->constructor = (zend_function *) op_array; ce->constructor = (zend_function *) op_array;
} }
} else if (zend_string_equals_literal(lcname, ZEND_CONSTRUCTOR_FUNC_NAME)) { } else if (zend_string_equals_literal(lcname, ZEND_CONSTRUCTOR_FUNC_NAME)) {
if (CG(active_class_entry)->constructor) {
zend_error(E_STRICT, "Redefining already defined constructor for class %s",
ce->name->val);
}
ce->constructor = (zend_function *) op_array; ce->constructor = (zend_function *) op_array;
} else if (zend_string_equals_literal(lcname, ZEND_DESTRUCTOR_FUNC_NAME)) { } else if (zend_string_equals_literal(lcname, ZEND_DESTRUCTOR_FUNC_NAME)) {
ce->destructor = (zend_function *) op_array; ce->destructor = (zend_function *) op_array;

View file

@ -23,6 +23,7 @@
#include "zend_execute.h" #include "zend_execute.h"
#include "zend_inheritance.h" #include "zend_inheritance.h"
#include "zend_smart_str.h" #include "zend_smart_str.h"
#include "zend_inheritance.h"
static void ptr_dtor(zval *zv) /* {{{ */ static void ptr_dtor(zval *zv) /* {{{ */
{ {
@ -1596,6 +1597,9 @@ ZEND_API void zend_do_bind_traits(zend_class_entry *ce) /* {{{ */
/* verify that all abstract methods from traits have been implemented */ /* verify that all abstract methods from traits have been implemented */
zend_verify_abstract_class(ce); zend_verify_abstract_class(ce);
/* Emit E_DEPRECATED for PHP 4 constructors */
zend_check_deprecated_constructor(ce);
/* now everything should be fine and an added ZEND_ACC_IMPLICIT_ABSTRACT_CLASS should be removed */ /* now everything should be fine and an added ZEND_ACC_IMPLICIT_ABSTRACT_CLASS should be removed */
if (ce->ce_flags & ZEND_ACC_IMPLICIT_ABSTRACT_CLASS) { if (ce->ce_flags & ZEND_ACC_IMPLICIT_ABSTRACT_CLASS) {
ce->ce_flags -= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS; ce->ce_flags -= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS;
@ -1603,6 +1607,29 @@ ZEND_API void zend_do_bind_traits(zend_class_entry *ce) /* {{{ */
} }
/* }}} */ /* }}} */
static zend_bool zend_has_deprecated_constructor(const zend_class_entry *ce) /* {{{ */
{
const zend_string *constructor_name;
if (!ce->constructor) {
return 0;
}
constructor_name = ce->constructor->common.function_name;
return !zend_binary_strcasecmp(
ce->name->val, ce->name->len,
constructor_name->val, constructor_name->len
);
}
/* }}} */
void zend_check_deprecated_constructor(const zend_class_entry *ce) /* {{{ */
{
if (zend_has_deprecated_constructor(ce)) {
zend_error(E_DEPRECATED, "Methods with the same name as their class will not be constructors in a future version of PHP; %s has a deprecated constructor", ce->name->val);
}
}
/* }}} */
/* /*
* Local variables: * Local variables:
* tab-width: 4 * tab-width: 4

View file

@ -33,6 +33,8 @@ ZEND_API void zend_do_bind_traits(zend_class_entry *ce);
ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce); ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce);
void zend_do_early_binding(void); void zend_do_early_binding(void);
void zend_check_deprecated_constructor(const zend_class_entry *ce);
END_EXTERN_C() END_EXTERN_C()
#endif #endif

View file

@ -76,7 +76,7 @@ class foo
public $s2; public $s2;
public $s3; public $s3;
function foo() function __construct()
{ {
global $sjis, $jis, $euc_jp; global $sjis, $jis, $euc_jp;
@ -92,7 +92,7 @@ class bar
public $s2; public $s2;
public $s3; public $s3;
function bar() function __construct()
{ {
global $sjis, $jis, $euc_jp; global $sjis, $jis, $euc_jp;

View file

@ -177,7 +177,7 @@ require_once('skipifconnectfailure.inc');
class foo { class foo {
public $foo; public $foo;
function foo() { function __construct() {
$this->foo = &$this->bar; $this->foo = &$this->bar;
} }
} }
@ -204,4 +204,4 @@ require_once('skipifconnectfailure.inc');
require_once("clean_table.inc"); require_once("clean_table.inc");
?> ?>
--EXPECTF-- --EXPECTF--
done! done!

View file

@ -194,7 +194,7 @@ require_once('skipifconnectfailure.inc');
unset($bar); unset($id); unset($label_ref); unset($bar); unset($id); unset($label_ref);
class foo { class foo {
public $foo; public $foo;
public function foo() { public function __construct() {
$this->foo = &$this->bar; $this->foo = &$this->bar;
} }
} }
@ -219,8 +219,8 @@ require_once('skipifconnectfailure.inc');
class mega_bar extends bar { class mega_bar extends bar {
private $id; private $id;
public $id_ref; public $id_ref;
public function mega_bar() { public function __construct() {
$this->foo(); parent::construct();
$this->id_ref = &$this->id; $this->id_ref = &$this->id;
} }
} }
@ -311,4 +311,4 @@ object(mega_bar)#5 (4) {
[%u|b%"foo"]=> [%u|b%"foo"]=>
&%unicode|string%(1) "a" &%unicode|string%(1) "a"
} }
done! done!

View file

@ -3,7 +3,7 @@ Bug #21758 (preg_replace_callback() not working with class methods)
--FILE-- --FILE--
<?php <?php
class Foo { class Foo {
function foo() { function __construct() {
$s = 'preg_replace() is broken'; $s = 'preg_replace() is broken';

View file

@ -21,7 +21,7 @@ class a {
class b { class b {
public $a; public $a;
function b(&$a) { function __construct(&$a) {
$this->a = &$a; $this->a = &$a;
} }
} }

View file

@ -15,7 +15,7 @@ error_reporting(E_ALL);
class TFoo { class TFoo {
public $c; public $c;
function TFoo($c) { function __construct($c) {
$this->c = $c; $this->c = $c;
} }
function inc() { function inc() {

View file

@ -21,7 +21,7 @@ class a {
class b { class b {
public $a; public $a;
function b(&$a) { function __construct(&$a) {
$this->a = &$a; $this->a = &$a;
} }
} }

View file

@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPComplexType { class SOAPComplexType {
function SOAPComplexType($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;

View file

@ -7,7 +7,7 @@ precision=14
--FILE-- --FILE--
<?php <?php
class SOAPStruct { class SOAPStruct {
function SOAPStruct($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;

View file

@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPStruct { class SOAPStruct {
function SOAPStruct($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;

View file

@ -7,7 +7,7 @@ precision=14
--FILE-- --FILE--
<?php <?php
class SOAPStruct { class SOAPStruct {
function SOAPStruct($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;

View file

@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPStruct { class SOAPStruct {
function SOAPStruct($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;

View file

@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class Person { class Person {
function Person($a=NULL, $i=NULL, $n=NULL, $m=NULL) { function __construct($a=NULL, $i=NULL, $n=NULL, $m=NULL) {
$this->Age = $a; $this->Age = $a;
$this->ID = $i; $this->ID = $i;
$this->Name = $n; $this->Name = $n;

View file

@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class Person { class Person {
function Person($a=NULL, $i=NULL, $n=NULL, $m=NULL) { function __construct($a=NULL, $i=NULL, $n=NULL, $m=NULL) {
$this->Age = $a; $this->Age = $a;
$this->ID = $i; $this->ID = $i;
$this->Name = $n; $this->Name = $n;
@ -16,7 +16,7 @@ class Person {
} }
} }
class Employee { class Employee {
function Employee($person=NULL,$id=NULL,$salary=NULL) { function __construct($person=NULL,$id=NULL,$salary=NULL) {
$this->person = $person; $this->person = $person;
$this->ID = $id; $this->ID = $id;
$this->salary = $salary; $this->salary = $salary;

View file

@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPStruct { class SOAPStruct {
function SOAPStruct($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;

View file

@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPStruct { class SOAPStruct {
function SOAPStruct($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;

View file

@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPStruct { class SOAPStruct {
function SOAPStruct($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;

View file

@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPStruct { class SOAPStruct {
function SOAPStruct($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;

View file

@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPStruct { class SOAPStruct {
function SOAPStruct($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;

View file

@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPStruct { class SOAPStruct {
function SOAPStruct($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;

View file

@ -7,7 +7,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPList { class SOAPList {
function SOAPList($s, $i, $c) { function __construct($s, $i, $c) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->child = $c; $this->child = $c;

View file

@ -7,7 +7,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPList { class SOAPList {
function SOAPList($s, $i, $c) { function __construct($s, $i, $c) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->child = $c; $this->child = $c;

View file

@ -7,7 +7,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPList { class SOAPList {
function SOAPList($s, $i, $c) { function __construct($s, $i, $c) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->child = $c; $this->child = $c;

View file

@ -7,7 +7,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPList { class SOAPList {
function SOAPList($s, $i, $c) { function __construct($s, $i, $c) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->child = $c; $this->child = $c;

View file

@ -7,7 +7,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPList { class SOAPList {
function SOAPList($s, $i, $c) { function __construct($s, $i, $c) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->child = $c; $this->child = $c;

View file

@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPStruct { class SOAPStruct {
function SOAPStruct($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;

View file

@ -8,14 +8,14 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPStruct { class SOAPStruct {
function SOAPStruct($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;
} }
} }
class BaseStruct { class BaseStruct {
function BaseStruct($f, $s) { function __construct($f, $s) {
$this->structMessage = $f; $this->structMessage = $f;
$this->shortMessage = $s; $this->shortMessage = $s;
} }

View file

@ -8,21 +8,21 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPStruct { class SOAPStruct {
function SOAPStruct($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;
} }
} }
class BaseStruct { class BaseStruct {
function BaseStruct($f, $s) { function __construct($f, $s) {
$this->structMessage = $f; $this->structMessage = $f;
$this->shortMessage = $s; $this->shortMessage = $s;
} }
} }
class ExtendedStruct extends BaseStruct { class ExtendedStruct extends BaseStruct {
function ExtendedStruct($f, $s, $x1, $x2, $x3) { function __construct($f, $s, $x1, $x2, $x3) {
$this->BaseStruct($f,$s); parent::__construct($f,$s);
$this->stringMessage = $x1; $this->stringMessage = $x1;
$this->intMessage = $x2; $this->intMessage = $x2;
$this->anotherIntMessage = $x3; $this->anotherIntMessage = $x3;

View file

@ -8,14 +8,14 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPStruct { class SOAPStruct {
function SOAPStruct($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;
} }
} }
class BaseStruct { class BaseStruct {
function BaseStruct($f, $s) { function __construct($f, $s) {
$this->structMessage = $f; $this->structMessage = $f;
$this->shortMessage = $s; $this->shortMessage = $s;
} }

View file

@ -8,14 +8,14 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPStruct { class SOAPStruct {
function SOAPStruct($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;
} }
} }
class BaseStruct { class BaseStruct {
function BaseStruct($f, $s) { function __construct($f, $s) {
$this->structMessage = $f; $this->structMessage = $f;
$this->shortMessage = $s; $this->shortMessage = $s;
} }

View file

@ -8,14 +8,14 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPStruct { class SOAPStruct {
function SOAPStruct($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;
} }
} }
class BaseStruct { class BaseStruct {
function BaseStruct($f, $s) { function __construct($f, $s) {
$this->structMessage = $f; $this->structMessage = $f;
$this->shortMessage = $s; $this->shortMessage = $s;
} }

View file

@ -7,29 +7,29 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPStruct { class SOAPStruct {
function SOAPStruct($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;
} }
} }
class BaseStruct { class BaseStruct {
function BaseStruct($f, $s) { function __construct($f, $s) {
$this->structMessage = $f; $this->structMessage = $f;
$this->shortMessage = $s; $this->shortMessage = $s;
} }
} }
class ExtendedStruct extends BaseStruct { class ExtendedStruct extends BaseStruct {
function ExtendedStruct($f, $s, $x1, $x2, $x3) { function __construct($f, $s, $x1, $x2, $x3) {
$this->BaseStruct($f,$s); parent::__construct($f,$s);
$this->stringMessage = $x1; $this->stringMessage = $x1;
$this->intMessage = $x2; $this->intMessage = $x2;
$this->anotherIntMessage = $x3; $this->anotherIntMessage = $x3;
} }
} }
class MoreExtendedStruct extends ExtendedStruct { class MoreExtendedStruct extends ExtendedStruct {
function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) { function __construct($f, $s, $x1, $x2, $x3, $b) {
$this->ExtendedStruct($f, $s, $x1, $x2, $x3); parent::__construct($f, $s, $x1, $x2, $x3);
$this->booleanMessage = $b; $this->booleanMessage = $b;
} }
} }

View file

@ -7,29 +7,29 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPStruct { class SOAPStruct {
function SOAPStruct($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;
} }
} }
class BaseStruct { class BaseStruct {
function BaseStruct($f, $s) { function __construct($f, $s) {
$this->structMessage = $f; $this->structMessage = $f;
$this->shortMessage = $s; $this->shortMessage = $s;
} }
} }
class ExtendedStruct extends BaseStruct { class ExtendedStruct extends BaseStruct {
function ExtendedStruct($f, $s, $x1, $x2, $x3) { function __construct($f, $s, $x1, $x2, $x3) {
$this->BaseStruct($f,$s); parent::__construct($f,$s);
$this->stringMessage = $x1; $this->stringMessage = $x1;
$this->intMessage = $x2; $this->intMessage = $x2;
$this->anotherIntMessage = $x3; $this->anotherIntMessage = $x3;
} }
} }
class MoreExtendedStruct extends ExtendedStruct { class MoreExtendedStruct extends ExtendedStruct {
function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) { function __construct($f, $s, $x1, $x2, $x3, $b) {
$this->ExtendedStruct($f, $s, $x1, $x2, $x3); parent::__construct($f, $s, $x1, $x2, $x3);
$this->booleanMessage = $b; $this->booleanMessage = $b;
} }
} }

View file

@ -7,29 +7,29 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPStruct { class SOAPStruct {
function SOAPStruct($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;
} }
} }
class BaseStruct { class BaseStruct {
function BaseStruct($f, $s) { function __construct($f, $s) {
$this->structMessage = $f; $this->structMessage = $f;
$this->shortMessage = $s; $this->shortMessage = $s;
} }
} }
class ExtendedStruct extends BaseStruct { class ExtendedStruct extends BaseStruct {
function ExtendedStruct($f, $s, $x1, $x2, $x3) { function __construct($f, $s, $x1, $x2, $x3) {
$this->BaseStruct($f,$s); parent::__construct($f,$s);
$this->stringMessage = $x1; $this->stringMessage = $x1;
$this->intMessage = $x2; $this->intMessage = $x2;
$this->anotherIntMessage = $x3; $this->anotherIntMessage = $x3;
} }
} }
class MoreExtendedStruct extends ExtendedStruct { class MoreExtendedStruct extends ExtendedStruct {
function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) { function __construct($f, $s, $x1, $x2, $x3, $b) {
$this->ExtendedStruct($f, $s, $x1, $x2, $x3); parent::__construct($f, $s, $x1, $x2, $x3);
$this->booleanMessage = $b; $this->booleanMessage = $b;
} }
} }

View file

@ -7,29 +7,29 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPStruct { class SOAPStruct {
function SOAPStruct($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;
} }
} }
class BaseStruct { class BaseStruct {
function BaseStruct($f, $s) { function __construct($f, $s) {
$this->structMessage = $f; $this->structMessage = $f;
$this->shortMessage = $s; $this->shortMessage = $s;
} }
} }
class ExtendedStruct extends BaseStruct { class ExtendedStruct extends BaseStruct {
function ExtendedStruct($f, $s, $x1, $x2, $x3) { function __construct($f, $s, $x1, $x2, $x3) {
$this->BaseStruct($f,$s); parent::__construct($f,$s);
$this->stringMessage = $x1; $this->stringMessage = $x1;
$this->intMessage = $x2; $this->intMessage = $x2;
$this->anotherIntMessage = $x3; $this->anotherIntMessage = $x3;
} }
} }
class MoreExtendedStruct extends ExtendedStruct { class MoreExtendedStruct extends ExtendedStruct {
function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) { function __construct($f, $s, $x1, $x2, $x3, $b) {
$this->ExtendedStruct($f, $s, $x1, $x2, $x3); parent::__construct($f, $s, $x1, $x2, $x3);
$this->booleanMessage = $b; $this->booleanMessage = $b;
} }
} }

View file

@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPStruct { class SOAPStruct {
function SOAPStruct($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;

View file

@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class BaseStruct { class BaseStruct {
function BaseStruct($f, $s) { function __construct($f, $s) {
$this->floatMessage = $f; $this->floatMessage = $f;
$this->shortMessage = $s; $this->shortMessage = $s;
} }

View file

@ -8,14 +8,14 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class BaseStruct { class BaseStruct {
function BaseStruct($f, $s) { function __construct($f, $s) {
$this->floatMessage = $f; $this->floatMessage = $f;
$this->shortMessage = $s; $this->shortMessage = $s;
} }
} }
class ExtendedStruct extends BaseStruct { class ExtendedStruct extends BaseStruct {
function ExtendedStruct($f, $s, $x1, $x2, $x3) { function __construct($f, $s, $x1, $x2, $x3) {
$this->BaseStruct($f,$s); parent::__construct($f,$s);
$this->stringMessage = $x1; $this->stringMessage = $x1;
$this->intMessage = $x2; $this->intMessage = $x2;
$this->anotherIntMessage = $x3; $this->anotherIntMessage = $x3;

View file

@ -8,14 +8,14 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPStruct { class SOAPStruct {
function SOAPStruct($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;
} }
} }
class BaseStruct { class BaseStruct {
function BaseStruct($f, $s) { function __construct($f, $s) {
$this->floatMessage = $f; $this->floatMessage = $f;
$this->shortMessage = $s; $this->shortMessage = $s;
} }

View file

@ -8,14 +8,14 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPStruct { class SOAPStruct {
function SOAPStruct($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;
} }
} }
class BaseStruct { class BaseStruct {
function BaseStruct($f, $s) { function __construct($f, $s) {
$this->floatMessage = $f; $this->floatMessage = $f;
$this->shortMessage = $s; $this->shortMessage = $s;
} }

View file

@ -8,14 +8,14 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPStruct { class SOAPStruct {
function SOAPStruct($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;
} }
} }
class BaseStruct { class BaseStruct {
function BaseStruct($f, $s) { function __construct($f, $s) {
$this->floatMessage = $f; $this->floatMessage = $f;
$this->shortMessage = $s; $this->shortMessage = $s;
} }

View file

@ -8,22 +8,22 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class BaseStruct { class BaseStruct {
function BaseStruct($f, $s) { function __construct($f, $s) {
$this->floatMessage = $f; $this->floatMessage = $f;
$this->shortMessage = $s; $this->shortMessage = $s;
} }
} }
class ExtendedStruct extends BaseStruct { class ExtendedStruct extends BaseStruct {
function ExtendedStruct($f, $s, $x1, $x2, $x3) { function __construct($f, $s, $x1, $x2, $x3) {
$this->BaseStruct($f,$s); parent::__construct($f,$s);
$this->stringMessage = $x1; $this->stringMessage = $x1;
$this->intMessage = $x2; $this->intMessage = $x2;
$this->anotherIntMessage = $x3; $this->anotherIntMessage = $x3;
} }
} }
class MoreExtendedStruct extends ExtendedStruct { class MoreExtendedStruct extends ExtendedStruct {
function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) { function __construct($f, $s, $x1, $x2, $x3, $b) {
$this->ExtendedStruct($f, $s, $x1, $x2, $x3); parent::__construct($f, $s, $x1, $x2, $x3);
$this->booleanMessage = $b; $this->booleanMessage = $b;
} }
} }

View file

@ -8,22 +8,22 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class BaseStruct { class BaseStruct {
function BaseStruct($f, $s) { function __construct($f, $s) {
$this->floatMessage = $f; $this->floatMessage = $f;
$this->shortMessage = $s; $this->shortMessage = $s;
} }
} }
class ExtendedStruct extends BaseStruct { class ExtendedStruct extends BaseStruct {
function ExtendedStruct($f, $s, $x1, $x2, $x3) { function __construct($f, $s, $x1, $x2, $x3) {
$this->BaseStruct($f,$s); parent::__construct($f,$s);
$this->stringMessage = $x1; $this->stringMessage = $x1;
$this->intMessage = $x2; $this->intMessage = $x2;
$this->anotherIntMessage = $x3; $this->anotherIntMessage = $x3;
} }
} }
class MoreExtendedStruct extends ExtendedStruct { class MoreExtendedStruct extends ExtendedStruct {
function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) { function __construct($f, $s, $x1, $x2, $x3, $b) {
$this->ExtendedStruct($f, $s, $x1, $x2, $x3); parent::__construct($f, $s, $x1, $x2, $x3);
$this->booleanMessage = $b; $this->booleanMessage = $b;
} }
} }

View file

@ -8,22 +8,22 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class BaseStruct { class BaseStruct {
function BaseStruct($f, $s) { function __construct($f, $s) {
$this->floatMessage = $f; $this->floatMessage = $f;
$this->shortMessage = $s; $this->shortMessage = $s;
} }
} }
class ExtendedStruct extends BaseStruct { class ExtendedStruct extends BaseStruct {
function ExtendedStruct($f, $s, $x1, $x2, $x3) { function __construct($f, $s, $x1, $x2, $x3) {
$this->BaseStruct($f,$s); parent::__construct($f,$s);
$this->stringMessage = $x1; $this->stringMessage = $x1;
$this->intMessage = $x2; $this->intMessage = $x2;
$this->anotherIntMessage = $x3; $this->anotherIntMessage = $x3;
} }
} }
class MoreExtendedStruct extends ExtendedStruct { class MoreExtendedStruct extends ExtendedStruct {
function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) { function __construct($f, $s, $x1, $x2, $x3, $b) {
$this->ExtendedStruct($f, $s, $x1, $x2, $x3); parent::__construct($f, $s, $x1, $x2, $x3);
$this->booleanMessage = $b; $this->booleanMessage = $b;
} }
} }

View file

@ -8,22 +8,22 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class BaseStruct { class BaseStruct {
function BaseStruct($f, $s) { function __construct($f, $s) {
$this->floatMessage = $f; $this->floatMessage = $f;
$this->shortMessage = $s; $this->shortMessage = $s;
} }
} }
class ExtendedStruct extends BaseStruct { class ExtendedStruct extends BaseStruct {
function ExtendedStruct($f, $s, $x1, $x2, $x3) { function __construct($f, $s, $x1, $x2, $x3) {
$this->BaseStruct($f,$s); parent::__construct($f,$s);
$this->stringMessage = $x1; $this->stringMessage = $x1;
$this->intMessage = $x2; $this->intMessage = $x2;
$this->anotherIntMessage = $x3; $this->anotherIntMessage = $x3;
} }
} }
class MoreExtendedStruct extends ExtendedStruct { class MoreExtendedStruct extends ExtendedStruct {
function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) { function __construct($f, $s, $x1, $x2, $x3, $b) {
$this->ExtendedStruct($f, $s, $x1, $x2, $x3); parent::__construct($f, $s, $x1, $x2, $x3);
$this->booleanMessage = $b; $this->booleanMessage = $b;
} }
} }

View file

@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPComplexType { class SOAPComplexType {
function SOAPComplexType($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;

View file

@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPComplexType { class SOAPComplexType {
function SOAPComplexType($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;

View file

@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPComplexType { class SOAPComplexType {
function SOAPComplexType($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;

View file

@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPComplexType { class SOAPComplexType {
function SOAPComplexType($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;

View file

@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPComplexType { class SOAPComplexType {
function SOAPComplexType($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;

View file

@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPComplexType { class SOAPComplexType {
function SOAPComplexType($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;

View file

@ -8,14 +8,14 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPComplexType { class SOAPComplexType {
function SOAPComplexType($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;
} }
} }
class SOAPComplexTypeComplexType { class SOAPComplexTypeComplexType {
function SOAPComplexTypeComplexType($s, $i, $f, $c) { function __construct($s, $i, $f, $c) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;

View file

@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPComplexTypeComplexType { class SOAPComplexTypeComplexType {
function SOAPComplexTypeComplexType($s, $i, $f, $c) { function __construct($s, $i, $f, $c) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;

View file

@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPMultiOccursComplexType { class SOAPMultiOccursComplexType {
function SOAPMultiOccursComplexType($s, $i, $f, $c) { function __construct($s, $i, $f, $c) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;

View file

@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0
--FILE-- --FILE--
<?php <?php
class SOAPComplexType { class SOAPComplexType {
function SOAPComplexType($s, $i, $f) { function __construct($s, $i, $f) {
$this->varString = $s; $this->varString = $s;
$this->varInt = $i; $this->varInt = $i;
$this->varFloat = $f; $this->varFloat = $f;

View file

@ -53,7 +53,7 @@ error_reporting(E_ALL);
class cr { class cr {
private $priv_member; private $priv_member;
public $public_member; public $public_member;
function cr($val) { function __construct($val) {
$this->priv_member = $val; $this->priv_member = $val;
$this->public_member = $val; $this->public_member = $val;
} }

View file

@ -6,7 +6,7 @@ error_reporting(E_ALL);
class cr { class cr {
private $priv_member; private $priv_member;
public $public_member; public $public_member;
function cr($val) { function __construct($val) {
$this->priv_member = $val; $this->priv_member = $val;
$this->public_member = $val; $this->public_member = $val;
} }

View file

@ -8,7 +8,7 @@ array_udiff_assoc(): Test return type and value for expected input
*/ */
class cr { class cr {
private $priv_member; private $priv_member;
function cr($val) { function __construct($val) {
$this->priv_member = $val; $this->priv_member = $val;
} }
static function comp_func_cr($a, $b) { static function comp_func_cr($a, $b) {
@ -38,4 +38,4 @@ array(3) {
["priv_member":"cr":private]=> ["priv_member":"cr":private]=>
int(23) int(23)
} }
} }

View file

@ -8,7 +8,7 @@ array_udiff():Test return type and value for expected input
*/ */
class cr { class cr {
private $priv_member; private $priv_member;
function cr($val) { function __construct($val) {
$this->priv_member = $val; $this->priv_member = $val;
} }
static function comp_func_cr($a, $b) { static function comp_func_cr($a, $b) {
@ -33,4 +33,4 @@ array(2) {
["priv_member":"cr":private]=> ["priv_member":"cr":private]=>
int(23) int(23)
} }
} }

View file

@ -8,7 +8,7 @@ array_udiff_uassoc(): Test return type and value for expected input
*/ */
class cr { class cr {
private $priv_member; private $priv_member;
function cr($val) { function __construct($val) {
$this->priv_member = $val; $this->priv_member = $val;
} }
static function comp_func_cr($a, $b) { static function comp_func_cr($a, $b) {
@ -42,4 +42,4 @@ array(3) {
["priv_member":"cr":private]=> ["priv_member":"cr":private]=>
int(23) int(23)
} }
} }

View file

@ -8,7 +8,7 @@ array_uintersect_assoc(): Test return type and value for expected input
*/ */
class cr { class cr {
private $priv_member; private $priv_member;
function cr($val) { function __construct($val) {
$this->priv_member = $val; $this->priv_member = $val;
} }
static function comp_func_cr($a, $b) { static function comp_func_cr($a, $b) {
@ -33,4 +33,4 @@ array(2) {
["priv_member":"cr":private]=> ["priv_member":"cr":private]=>
int(-15) int(-15)
} }
} }

View file

@ -8,7 +8,7 @@ array_uintersect(): Test return type and value for expected input
*/ */
class cr { class cr {
private $priv_member; private $priv_member;
function cr($val) { function __construct($val) {
$this->priv_member = $val; $this->priv_member = $val;
} }
static function comp_func_cr($a, $b) { static function comp_func_cr($a, $b) {
@ -38,4 +38,4 @@ array(3) {
["priv_member":"cr":private]=> ["priv_member":"cr":private]=>
int(-15) int(-15)
} }
} }

View file

@ -8,7 +8,7 @@ array_uintersect_uassoc(): Test return type and value for expected input
*/ */
class cr { class cr {
private $priv_member; private $priv_member;
function cr($val) { function __construct($val) {
$this->priv_member = $val; $this->priv_member = $val;
} }
static function comp_func_cr($a, $b) { static function comp_func_cr($a, $b) {
@ -37,4 +37,4 @@ array(2) {
["priv_member":"cr":private]=> ["priv_member":"cr":private]=>
int(-15) int(-15)
} }
} }

View file

@ -4,7 +4,7 @@ Bug #45312 (Segmentation fault on second request for array functions)
<?php <?php
class cr { class cr {
private $priv_member; private $priv_member;
function cr($val) { function __construct($val) {
$this->priv_member = $val; $this->priv_member = $val;
} }
static function comp_func_cr($a, $b) { static function comp_func_cr($a, $b) {

View file

@ -7,7 +7,7 @@ class VariableStream {
var $position; var $position;
var $varname; var $varname;
function VariableStream($var) { function __construct($var) {
var_dump("constructor!"); var_dump("constructor!");
} }
@ -102,7 +102,7 @@ var_dump($myvar);
echo "Done\n"; echo "Done\n";
?> ?>
--EXPECTF-- --EXPECTF--
Warning: Missing argument 1 for VariableStream::VariableStream() in %s on line %d Warning: Missing argument 1 for VariableStream::__construct() in %s on line %d
string(12) "constructor!" string(12) "constructor!"
line1 line1
line2 line2

View file

@ -30,7 +30,7 @@ echo "*** Testing stat() with filename & directory name stored inside an object
class names { class names {
public $var_name; public $var_name;
public function names($name) { public function __construct($name) {
$this->var_name = $name; $this->var_name = $name;
} }
} }

View file

@ -29,7 +29,7 @@ symlink("$file_path/lstat_stat_variation20.tmp", "$file_path/lstat_stat_variatio
echo "*** Testing lstat() with linkname stored inside an object/array ***\n"; echo "*** Testing lstat() with linkname stored inside an object/array ***\n";
class names { class names {
public $var_name; public $var_name;
public function names($name) { public function __construct($name) {
$this->var_name = $name; $this->var_name = $name;
} }
} }

View file

@ -28,7 +28,7 @@ fclose($file_handle);
// creating object with members as linkname // creating object with members as linkname
class object_temp { class object_temp {
public $linkname; public $linkname;
function object_temp($link) { function __construct($link) {
$this->linkname = $link; $this->linkname = $link;
} }
} }

View file

@ -36,7 +36,7 @@ fclose($fp);
echo "*** Testing symlink(), link(), linkinfo() and is_link() with linknames stored as members in an object ***\n"; echo "*** Testing symlink(), link(), linkinfo() and is_link() with linknames stored as members in an object ***\n";
class object_temp { class object_temp {
var $linkname; var $linkname;
function object_temp($link) { function __construct($link) {
$this->linkname = $link; $this->linkname = $link;
} }
} }

View file

@ -39,7 +39,7 @@ class object_class {
} }
public $array_var = array( "key1" => 1, "key2 " => 3); public $array_var = array( "key1" => 1, "key2 " => 3);
function object_class () { function __construct () {
$this->value1 = 5; $this->value1 = 5;
$this->object_class1 = $this; $this->object_class1 = $this;
} }
@ -65,7 +65,7 @@ class contains_object_class
echo "func() is called \n"; echo "func() is called \n";
} }
function contains_object_class () { function __construct () {
$this->class_object1 = new object_class(); $this->class_object1 = new object_class();
$this->class_object2 = new object_class(); $this->class_object2 = new object_class();
$this->class_object3 = $this->class_object1; $this->class_object3 = $this->class_object1;

View file

@ -38,7 +38,7 @@ class point
var $x; var $x;
var $y; var $y;
function point($x, $y) { function __construct($x, $y) {
$this->x = $x; $this->x = $x;
$this->y = $y; $this->y = $y;
} }

View file

@ -71,7 +71,7 @@ class contains_object_class
echo "func() is called \n"; echo "func() is called \n";
} }
function contains_object_class () { function __construct () {
$this->class_object1 = new object_class(); $this->class_object1 = new object_class();
$this->no_member_class_object = new no_member_class(); $this->no_member_class_object = new no_member_class();
} }
@ -784,4 +784,4 @@ bool(true)
object_class::foo1 object_class::foo1
bool(true) bool(true)
object_class::foo1 object_class::foo1
===DONE=== ===DONE===

View file

@ -61,7 +61,7 @@ class myClass
private $private_var; private $private_var;
protected $protected_var; protected $protected_var;
function myClass ( ) { function __construct ( ) {
$this->foo_object = new foo(); $this->foo_object = new foo();
$this->public_var = 10; $this->public_var = 10;
$this->public_var1 = new foo(); $this->public_var1 = new foo();

View file

@ -155,7 +155,7 @@ class object_class
protected $protected_var1 = "string_1"; protected $protected_var1 = "string_1";
protected $protected_var2; protected $protected_var2;
function object_class ( ) { function __construct ( ) {
$this->value = 50; $this->value = 50;
$this->public_var2 = 11; $this->public_var2 = 11;
$this->private_var2 = 21; $this->private_var2 = 21;
@ -191,7 +191,7 @@ class contains_object_class
echo "func() is called \n"; echo "func() is called \n";
} }
function contains_object_class () { function __construct () {
$this->class_object1 = new object_class(); $this->class_object1 = new object_class();
$this->class_object2 = new object_class(); $this->class_object2 = new object_class();
$this->class_object3 = $this->class_object1; $this->class_object3 = $this->class_object1;

View file

@ -148,7 +148,7 @@ class object_class
protected $protected_var1 = "string_1"; protected $protected_var1 = "string_1";
protected $protected_var2; protected $protected_var2;
function object_class ( ) { function __construct ( ) {
$this->value = 50; $this->value = 50;
$this->public_var2 = 11; $this->public_var2 = 11;
$this->private_var2 = 21; $this->private_var2 = 21;
@ -184,7 +184,7 @@ class contains_object_class
echo "func() is called \n"; echo "func() is called \n";
} }
function contains_object_class () { function __construct () {
$this->class_object1 = new object_class(); $this->class_object1 = new object_class();
$this->class_object2 = new object_class(); $this->class_object2 = new object_class();
$this->class_object3 = $this->class_object1; $this->class_object3 = $this->class_object1;

View file

@ -233,7 +233,7 @@ class myClass
private $private_var; private $private_var;
protected $protected_var; protected $protected_var;
function myClass ( ) { function __construct ( ) {
$this->foo_object = new foo(); $this->foo_object = new foo();
$this->public_var = 10; $this->public_var = 10;
$this->public_var1 = new foo(); $this->public_var1 = new foo();

View file

@ -61,7 +61,7 @@ class myClass
private $private_var; private $private_var;
protected $protected_var; protected $protected_var;
function myClass ( ) { function __construct ( ) {
$this->foo_object = new foo(); $this->foo_object = new foo();
$this->public_var = 10; $this->public_var = 10;
$this->public_var1 = new foo(); $this->public_var1 = new foo();

View file

@ -6,7 +6,7 @@ serialize_precision=100
<?php <?php
class t class t
{ {
function t() function __construct()
{ {
$this->a = "hallo"; $this->a = "hallo";
} }
@ -18,7 +18,7 @@ class s
public $b; public $b;
public $c; public $c;
function s() function __construct()
{ {
$this->a = "hallo"; $this->a = "hallo";
$this->b = "php"; $this->b = "php";

View file

@ -4,7 +4,7 @@ Bug #14293 (serialize() and __sleep())
<?php <?php
class t class t
{ {
function t() function __construct()
{ {
$this->a = 'hello'; $this->a = 'hello';
} }

View file

@ -6,7 +6,7 @@ class test
{ {
public $a, $b; public $a, $b;
function test() function __construct()
{ {
$this->a = 7; $this->a = 7;
$this->b = 2; $this->b = 2;

View file

@ -19,7 +19,7 @@ echo "\n--- Testing Abstract Class ---\n";
// abstract class // abstract class
abstract class Name abstract class Name
{ {
public function Name() { public function __construct() {
$this->a = 10; $this->a = 10;
$this->b = 12.222; $this->b = 12.222;
$this->c = "string"; $this->c = "string";

View file

@ -10,7 +10,7 @@ Bug: tidy segfaults with markup=false
abstract class BaseClass { abstract class BaseClass {
private static $tidyconfig; private static $tidyconfig;
public function BaseClass() { public function __construct() {
$this->tidyconfig = array( $this->tidyconfig = array(
'indent' => false, 'indent' => false,
'clean' => true, 'clean' => true,
@ -38,7 +38,7 @@ abstract class BaseClass {
} }
class ChildClass extends BaseClass { class ChildClass extends BaseClass {
public function ChildClass() { public function __construct() {
parent::__construct(); parent::__construct();
} }

View file

@ -14,7 +14,7 @@ class testcase {
private $tags; private $tags;
private $chunk_size; private $chunk_size;
function testcase($enc, $chunk_size = 0, $bom = 0, $omit_prologue = 0) { function __construct($enc, $chunk_size = 0, $bom = 0, $omit_prologue = 0) {
$this->encoding = $enc; $this->encoding = $enc;
$this->chunk_size = $chunk_size; $this->chunk_size = $chunk_size;
$this->bom = $bom; $this->bom = $bom;

View file

@ -10,7 +10,7 @@ error_reporting=2047
class MyCloneable { class MyCloneable {
static $id = 0; static $id = 0;
function MyCloneable() { function __construct() {
$this->id = self::$id++; $this->id = self::$id++;
} }

View file

@ -6,7 +6,7 @@ ZE2 The new constructor/destructor is called
<?php <?php
class early { class early {
function early() { function __construct() {
echo __CLASS__ . "::" . __FUNCTION__ . "\n"; echo __CLASS__ . "::" . __FUNCTION__ . "\n";
} }
function __destruct() { function __destruct() {
@ -24,7 +24,7 @@ class late {
} }
$t = new early(); $t = new early();
$t->early(); $t->__construct();
unset($t); unset($t);
$t = new late(); $t = new late();
//unset($t); delay to end of script //unset($t); delay to end of script
@ -32,8 +32,8 @@ $t = new late();
echo "Done\n"; echo "Done\n";
?> ?>
--EXPECTF-- --EXPECTF--
early::early early::__construct
early::early early::__construct
early::__destruct early::__destruct
late::__construct late::__construct
Done Done

View file

@ -6,7 +6,7 @@ ZE2 dereferencing of objects from methods
<?php <?php
class Name { class Name {
function Name($_name) { function __construct($_name) {
$this->name = $_name; $this->name = $_name;
} }
@ -18,7 +18,7 @@ class Name {
class Person { class Person {
private $name; private $name;
function person($_name, $_address) { function __construct($_name, $_address) {
$this->name = new Name($_name); $this->name = new Name($_name);
} }

Some files were not shown because too many files have changed in this diff Show more