var $y;
var $lable;
- function Point($x, $y) {
+ function __construct($x, $y) {
$this->x = $x;
$this->y = $y;
}
bool(true)
array(3) {
[0]=>
- string(5) "Point"
+ string(11) "__construct"
[1]=>
string(8) "setLable"
[2]=>
class InfoBlob {
var $foo;
- function InfoBlob() {
+ function __construct() {
$this->foo = "Foo";
}
}
{
public $member;
- function test() {
+ function __construct() {
$this->member = 1;
register_shutdown_function(array($this, 'destructor'));
}
--FILE--
<?php
class foo {
- function foo($arrayobj) {
+ function __construct($arrayobj) {
var_dump($arrayobj);
}
}
class A
{
- public function A()
+ public function __construct()
{
set_exception_handler(array($this, 'EH'));
<?php
class bug39542 {
- function bug39542() {
+ function __construct() {
echo "ok\n";
}
}
}
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--
}
class B {
- public function B() {
+ public function __construct() {
$isCallable = is_callable(array(new C, 'f'));
var_dump($isCallable);
}
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"
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
?>
--EXPECTF--
-Strict Standards: Redefining already defined constructor for class B in %s on line %d
array(2) {
[0]=>
string(1) "a"
}
/* }}} */
-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);
}
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;
#include "zend_execute.h"
#include "zend_inheritance.h"
#include "zend_smart_str.h"
+#include "zend_inheritance.h"
static void ptr_dtor(zval *zv) /* {{{ */
{
/* 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;
}
/* }}} */
+
+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
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
public $s2;
public $s3;
- function foo()
+ function __construct()
{
global $sjis, $jis, $euc_jp;
public $s2;
public $s3;
- function bar()
+ function __construct()
{
global $sjis, $jis, $euc_jp;
class foo {
public $foo;
- function foo() {
+ function __construct() {
$this->foo = &$this->bar;
}
}
require_once("clean_table.inc");
?>
--EXPECTF--
-done!
\ No newline at end of file
+done!
unset($bar); unset($id); unset($label_ref);
class foo {
public $foo;
- public function foo() {
+ public function __construct() {
$this->foo = &$this->bar;
}
}
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;
}
}
[%u|b%"foo"]=>
&%unicode|string%(1) "a"
}
-done!
\ No newline at end of file
+done!
--FILE--
<?php
class Foo {
- function foo() {
+ function __construct() {
$s = 'preg_replace() is broken';
class b {
public $a;
- function b(&$a) {
+ function __construct(&$a) {
$this->a = &$a;
}
}
class TFoo {
public $c;
- function TFoo($c) {
+ function __construct($c) {
$this->c = $c;
}
function inc() {
class b {
public $a;
- function b(&$a) {
+ function __construct(&$a) {
$this->a = &$a;
}
}
--FILE--
<?php
class SOAPComplexType {
- function SOAPComplexType($s, $i, $f) {
+ function __construct($s, $i, $f) {
$this->varString = $s;
$this->varInt = $i;
$this->varFloat = $f;
--FILE--
<?php
class SOAPStruct {
- function SOAPStruct($s, $i, $f) {
+ function __construct($s, $i, $f) {
$this->varString = $s;
$this->varInt = $i;
$this->varFloat = $f;
--FILE--
<?php
class SOAPStruct {
- function SOAPStruct($s, $i, $f) {
+ function __construct($s, $i, $f) {
$this->varString = $s;
$this->varInt = $i;
$this->varFloat = $f;
--FILE--
<?php
class SOAPStruct {
- function SOAPStruct($s, $i, $f) {
+ function __construct($s, $i, $f) {
$this->varString = $s;
$this->varInt = $i;
$this->varFloat = $f;
--FILE--
<?php
class SOAPStruct {
- function SOAPStruct($s, $i, $f) {
+ function __construct($s, $i, $f) {
$this->varString = $s;
$this->varInt = $i;
$this->varFloat = $f;
--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;
--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;
}
}
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;
--FILE--
<?php
class SOAPStruct {
- function SOAPStruct($s, $i, $f) {
+ function __construct($s, $i, $f) {
$this->varString = $s;
$this->varInt = $i;
$this->varFloat = $f;
--FILE--
<?php
class SOAPStruct {
- function SOAPStruct($s, $i, $f) {
+ function __construct($s, $i, $f) {
$this->varString = $s;
$this->varInt = $i;
$this->varFloat = $f;
--FILE--
<?php
class SOAPStruct {
- function SOAPStruct($s, $i, $f) {
+ function __construct($s, $i, $f) {
$this->varString = $s;
$this->varInt = $i;
$this->varFloat = $f;
--FILE--
<?php
class SOAPStruct {
- function SOAPStruct($s, $i, $f) {
+ function __construct($s, $i, $f) {
$this->varString = $s;
$this->varInt = $i;
$this->varFloat = $f;
--FILE--
<?php
class SOAPStruct {
- function SOAPStruct($s, $i, $f) {
+ function __construct($s, $i, $f) {
$this->varString = $s;
$this->varInt = $i;
$this->varFloat = $f;
--FILE--
<?php
class SOAPStruct {
- function SOAPStruct($s, $i, $f) {
+ function __construct($s, $i, $f) {
$this->varString = $s;
$this->varInt = $i;
$this->varFloat = $f;
--FILE--
<?php
class SOAPList {
- function SOAPList($s, $i, $c) {
+ function __construct($s, $i, $c) {
$this->varString = $s;
$this->varInt = $i;
$this->child = $c;
--FILE--
<?php
class SOAPList {
- function SOAPList($s, $i, $c) {
+ function __construct($s, $i, $c) {
$this->varString = $s;
$this->varInt = $i;
$this->child = $c;
--FILE--
<?php
class SOAPList {
- function SOAPList($s, $i, $c) {
+ function __construct($s, $i, $c) {
$this->varString = $s;
$this->varInt = $i;
$this->child = $c;
--FILE--
<?php
class SOAPList {
- function SOAPList($s, $i, $c) {
+ function __construct($s, $i, $c) {
$this->varString = $s;
$this->varInt = $i;
$this->child = $c;
--FILE--
<?php
class SOAPList {
- function SOAPList($s, $i, $c) {
+ function __construct($s, $i, $c) {
$this->varString = $s;
$this->varInt = $i;
$this->child = $c;
--FILE--
<?php
class SOAPStruct {
- function SOAPStruct($s, $i, $f) {
+ function __construct($s, $i, $f) {
$this->varString = $s;
$this->varInt = $i;
$this->varFloat = $f;
--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;
}
--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;
--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;
}
--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;
}
--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;
}
--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;
}
}
--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;
}
}
--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;
}
}
--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;
}
}
--FILE--
<?php
class SOAPStruct {
- function SOAPStruct($s, $i, $f) {
+ function __construct($s, $i, $f) {
$this->varString = $s;
$this->varInt = $i;
$this->varFloat = $f;
--FILE--
<?php
class BaseStruct {
- function BaseStruct($f, $s) {
+ function __construct($f, $s) {
$this->floatMessage = $f;
$this->shortMessage = $s;
}
--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;
--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;
}
--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;
}
--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;
}
--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;
}
}
--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;
}
}
--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;
}
}
--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;
}
}
--FILE--
<?php
class SOAPComplexType {
- function SOAPComplexType($s, $i, $f) {
+ function __construct($s, $i, $f) {
$this->varString = $s;
$this->varInt = $i;
$this->varFloat = $f;
--FILE--
<?php
class SOAPComplexType {
- function SOAPComplexType($s, $i, $f) {
+ function __construct($s, $i, $f) {
$this->varString = $s;
$this->varInt = $i;
$this->varFloat = $f;
--FILE--
<?php
class SOAPComplexType {
- function SOAPComplexType($s, $i, $f) {
+ function __construct($s, $i, $f) {
$this->varString = $s;
$this->varInt = $i;
$this->varFloat = $f;
--FILE--
<?php
class SOAPComplexType {
- function SOAPComplexType($s, $i, $f) {
+ function __construct($s, $i, $f) {
$this->varString = $s;
$this->varInt = $i;
$this->varFloat = $f;
--FILE--
<?php
class SOAPComplexType {
- function SOAPComplexType($s, $i, $f) {
+ function __construct($s, $i, $f) {
$this->varString = $s;
$this->varInt = $i;
$this->varFloat = $f;
--FILE--
<?php
class SOAPComplexType {
- function SOAPComplexType($s, $i, $f) {
+ function __construct($s, $i, $f) {
$this->varString = $s;
$this->varInt = $i;
$this->varFloat = $f;
--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;
--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;
--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;
--FILE--
<?php
class SOAPComplexType {
- function SOAPComplexType($s, $i, $f) {
+ function __construct($s, $i, $f) {
$this->varString = $s;
$this->varInt = $i;
$this->varFloat = $f;
class cr {
private $priv_member;
public $public_member;
- function cr($val) {
+ function __construct($val) {
$this->priv_member = $val;
$this->public_member = $val;
}
class cr {
private $priv_member;
public $public_member;
- function cr($val) {
+ function __construct($val) {
$this->priv_member = $val;
$this->public_member = $val;
}
*/
class cr {
private $priv_member;
- function cr($val) {
+ function __construct($val) {
$this->priv_member = $val;
}
static function comp_func_cr($a, $b) {
["priv_member":"cr":private]=>
int(23)
}
-}
\ No newline at end of file
+}
*/
class cr {
private $priv_member;
- function cr($val) {
+ function __construct($val) {
$this->priv_member = $val;
}
static function comp_func_cr($a, $b) {
["priv_member":"cr":private]=>
int(23)
}
-}
\ No newline at end of file
+}
*/
class cr {
private $priv_member;
- function cr($val) {
+ function __construct($val) {
$this->priv_member = $val;
}
static function comp_func_cr($a, $b) {
["priv_member":"cr":private]=>
int(23)
}
-}
\ No newline at end of file
+}
*/
class cr {
private $priv_member;
- function cr($val) {
+ function __construct($val) {
$this->priv_member = $val;
}
static function comp_func_cr($a, $b) {
["priv_member":"cr":private]=>
int(-15)
}
-}
\ No newline at end of file
+}
*/
class cr {
private $priv_member;
- function cr($val) {
+ function __construct($val) {
$this->priv_member = $val;
}
static function comp_func_cr($a, $b) {
["priv_member":"cr":private]=>
int(-15)
}
-}
\ No newline at end of file
+}
*/
class cr {
private $priv_member;
- function cr($val) {
+ function __construct($val) {
$this->priv_member = $val;
}
static function comp_func_cr($a, $b) {
["priv_member":"cr":private]=>
int(-15)
}
-}
\ No newline at end of file
+}
<?php
class cr {
private $priv_member;
- function cr($val) {
+ function __construct($val) {
$this->priv_member = $val;
}
static function comp_func_cr($a, $b) {
var $position;
var $varname;
- function VariableStream($var) {
+ function __construct($var) {
var_dump("constructor!");
}
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
class names {
public $var_name;
- public function names($name) {
+ public function __construct($name) {
$this->var_name = $name;
}
}
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;
}
}
// creating object with members as linkname
class object_temp {
public $linkname;
- function object_temp($link) {
+ function __construct($link) {
$this->linkname = $link;
}
}
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;
}
}
}
public $array_var = array( "key1" => 1, "key2 " => 3);
- function object_class () {
+ function __construct () {
$this->value1 = 5;
$this->object_class1 = $this;
}
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;
var $x;
var $y;
- function point($x, $y) {
+ function __construct($x, $y) {
$this->x = $x;
$this->y = $y;
}
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();
}
object_class::foo1
bool(true)
object_class::foo1
-===DONE===
\ No newline at end of file
+===DONE===
private $private_var;
protected $protected_var;
- function myClass ( ) {
+ function __construct ( ) {
$this->foo_object = new foo();
$this->public_var = 10;
$this->public_var1 = new foo();
protected $protected_var1 = "string_1";
protected $protected_var2;
- function object_class ( ) {
+ function __construct ( ) {
$this->value = 50;
$this->public_var2 = 11;
$this->private_var2 = 21;
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;
protected $protected_var1 = "string_1";
protected $protected_var2;
- function object_class ( ) {
+ function __construct ( ) {
$this->value = 50;
$this->public_var2 = 11;
$this->private_var2 = 21;
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;
private $private_var;
protected $protected_var;
- function myClass ( ) {
+ function __construct ( ) {
$this->foo_object = new foo();
$this->public_var = 10;
$this->public_var1 = new foo();
private $private_var;
protected $protected_var;
- function myClass ( ) {
+ function __construct ( ) {
$this->foo_object = new foo();
$this->public_var = 10;
$this->public_var1 = new foo();
<?php
class t
{
- function t()
+ function __construct()
{
$this->a = "hallo";
}
public $b;
public $c;
- function s()
+ function __construct()
{
$this->a = "hallo";
$this->b = "php";
<?php
class t
{
- function t()
+ function __construct()
{
$this->a = 'hello';
}
{
public $a, $b;
- function test()
+ function __construct()
{
$this->a = 7;
$this->b = 2;
// abstract class
abstract class Name
{
- public function Name() {
+ public function __construct() {
$this->a = 10;
$this->b = 12.222;
$this->c = "string";
abstract class BaseClass {
private static $tidyconfig;
- public function BaseClass() {
+ public function __construct() {
$this->tidyconfig = array(
'indent' => false,
'clean' => true,
}
class ChildClass extends BaseClass {
- public function ChildClass() {
+ public function __construct() {
parent::__construct();
}
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;
class MyCloneable {
static $id = 0;
- function MyCloneable() {
+ function __construct() {
$this->id = self::$id++;
}
<?php
class early {
- function early() {
+ function __construct() {
echo __CLASS__ . "::" . __FUNCTION__ . "\n";
}
function __destruct() {
}
$t = new early();
-$t->early();
+$t->__construct();
unset($t);
$t = new late();
//unset($t); delay to end of script
echo "Done\n";
?>
--EXPECTF--
-early::early
-early::early
+early::__construct
+early::__construct
early::__destruct
late::__construct
Done
<?php
class Name {
- function Name($_name) {
+ function __construct($_name) {
$this->name = $_name;
}
class Person {
private $name;
- function person($_name, $_address) {
+ function __construct($_name, $_address) {
$this->name = new Name($_name);
}
class Foo {
public $name;
- function Foo() {
+ function __construct() {
$this->name = "I'm Foo!\n";
}
}
class dafna_class {
- function dafna_class() {
+ function __construct() {
$this->myname = "Dafna";
}
function GetMyName() {
--FILE--
<?php
class foo {
- function foo($name) {
+ function __construct($name) {
$GLOBALS['List']= &$this;
$this->Name = $name;
$GLOBALS['List']->echoName();
--FILE--
<?php
class MyException extends Exception {
- function MyException($_error) {
+ function __construct($_error) {
$this->error = $_error;
}
class oop_class {
var $oop_name;
- function oop_class() {
+ function __construct() {
global $oop_global;
echo "oop_class()\n";
$this->oop_name = 'oop:' . ++$oop_global;
class oop_test {
static $oop_value;
- function oop_test() {
+ function __construct() {
echo "oop_test()\n";
}
class foo {
const bar = "fubar\n";
- function foo($arg = self::bar) {
+ function __construct($arg = self::bar) {
echo $arg;
}
}
class man
{
public $name, $bars;
- function man()
+ function __construct()
{
$this->name = 'Mr. X';
$this->bars = array();
{
public $name;
- function bar($w)
+ function __construct($w)
{
$this->name = $w;
}
--FILE--
<?php
class Test {
- function Test() {
+ function __construct() {
ob_start(
array(
$this, 'transform'
public $functions = array();
- function foo()
+ function __construct()
{
$function = create_function('', 'return "FOO\n";');
print($function());
<?php
class MyException extends Exception {
- function MyException($_errno, $_errmsg) {
+ function __construct($_errno, $_errmsg) {
$this->errno = $_errno;
$this->errmsg = $_errmsg;
}