Zitat:
Zitat von meikel Stimmt seit PHP 5.3.3 nicht mehr, weil der 'alte' Konstruktor nach der PHP4-Syntax nicht mehr ausgeführt wird.
Meinen Scripten schadet das nicht, weil ich die PHP5 Syntax verwende. Was mich allerdings ärgert ist, daß weder PEAR noch Horde uneingeschränkt PHP 5.3.3 kompatibel ist. |
Muss ich dich leider korrigieren, wie es aussieht:
PHP 5.3.5
PHP-Code:
<?php
echo phpversion();
class Old {
var $some = 'test';
function Old($string = 'old'){
$this->some = $string;
}
}
$old = new Old;
echo "\n Ohne Namespace:" .$old->some;
Output:
Code:
5.3.5
Ohne Namespace:old
PHP-Code:
namespace Foo;
echo |phpversion();
class Old {
var $some = 'test';
function Old($string = 'OldWithNS'){
$this->some = $string;
}
}
$old = new |Foo|Old;
echo "\n" .$old->some;
Output: (Code für Forum angepasst, da Bavkslashes anscheinend nicht angezeigt werden)
Der Post von Asterixus ist korrekt.