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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -13,10 +13,12 @@ set_error_handler(function($_, $msg, $file) {
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--
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(1) "B"

View file

@ -8,11 +8,13 @@ set_error_handler(function($_, $msg, $file) {
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--
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"
Notice: Undefined variable: undefined in %s on line %d

View file

@ -24,7 +24,6 @@ new B;
?>
--EXPECTF--
Strict Standards: Redefining already defined constructor for class B in %s on line %d
array(2) {
[0]=>
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);
}
@ -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;
}
} 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;
} else if (zend_string_equals_literal(lcname, ZEND_DESTRUCTOR_FUNC_NAME)) {
ce->destructor = (zend_function *) op_array;

View file

@ -23,6 +23,7 @@
#include "zend_execute.h"
#include "zend_inheritance.h"
#include "zend_smart_str.h"
#include "zend_inheritance.h"
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 */
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 */
if (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:
* 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);
void zend_do_early_binding(void);
void zend_check_deprecated_constructor(const zend_class_entry *ce);
END_EXTERN_C()
#endif

View file

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

View file

@ -177,7 +177,7 @@ require_once('skipifconnectfailure.inc');
class foo {
public $foo;
function foo() {
function __construct() {
$this->foo = &$this->bar;
}
}

View file

@ -194,7 +194,7 @@ require_once('skipifconnectfailure.inc');
unset($bar); unset($id); unset($label_ref);
class foo {
public $foo;
public function foo() {
public function __construct() {
$this->foo = &$this->bar;
}
}
@ -219,8 +219,8 @@ require_once('skipifconnectfailure.inc');
class mega_bar extends bar {
private $id;
public $id_ref;
public function mega_bar() {
$this->foo();
public function __construct() {
parent::construct();
$this->id_ref = &$this->id;
}
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0
--FILE--
<?php
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->ID = $i;
$this->Name = $n;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -6,7 +6,7 @@ error_reporting(E_ALL);
class cr {
private $priv_member;
public $public_member;
function cr($val) {
function __construct($val) {
$this->priv_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 {
private $priv_member;
function cr($val) {
function __construct($val) {
$this->priv_member = $val;
}
static function comp_func_cr($a, $b) {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -7,7 +7,7 @@ class VariableStream {
var $position;
var $varname;
function VariableStream($var) {
function __construct($var) {
var_dump("constructor!");
}
@ -102,7 +102,7 @@ var_dump($myvar);
echo "Done\n";
?>
--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!"
line1
line2

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -14,7 +14,7 @@ class testcase {
private $tags;
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->chunk_size = $chunk_size;
$this->bom = $bom;

View file

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

View file

@ -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

View file

@ -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);
}

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