BugTrack/2146
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
* PHP 5.1.1 で大量の Notice が出る [#g07d4a71]
- ページ: [[BugTrack2]]
- 投稿者: [[teanan]]
- 優先順位: 重要
- 状態: 却下
- カテゴリー: 本体バグ
- 投稿日: 2005-12-29 (木) 10:54:42
- バージョン:
** メッセージ [#ef024fca]
PHP Version 5.1.1 の環境で、error_reporting(E_ALL) にして...
Notice: Only variable references should be returned by r...
***/lib/convert_html.php on line 144
** 参考 [#wb5afc78]
- http://ns1.php.gr.jp/pipermail/php-users/2005-July...
直接の原因は参照返しの関数でnewしたオブジェクトをそのま...
ことにあります。とりあえずバッファ変数に入れてあげること...
いです。
** 関連 [#j48cfc35]
- [[BugTrack/632]] PHP5で動作しない
- [[BugTrack2/106]] PHP5.0.5でFatal error
- [[BugTrack2/82]] php-5.1.0b2で正常動作しない。
- [[BugTrack2/185]] PHP 4.4.0 および PHP 5.1.0 以降では、...
--------
*コメント [#u90fe433]
- Noticeが出ないように、対策してみました。 -- [[teanan]] ...
-- [[cvs:lib/convert_html.php]] (1.17) [[diff to 1.16>cvs...
- lib/convert_html.phpを1.17にしたらPHP4.4.0で動かなくな...
Fatal error: Call to a member function on a non-object i...
です。PHP5.1.1では問題なく動きました((paraeditパッチをあ...
-- PHP4.4.1でも同じエラーが出ました。 -- [[okkez]] &new{2...
- ご迷惑をおかけして申し訳ないです。至急調査します。 -- [...
- PHP 4.3.8にてエラーです。 -- [[hirokasa]] &new{2005-12-...
- とりあえず、cvsを前のリビジョンに戻しました。 -- [[tean...
-- お疲れ様です。今後という事で構わないのですが、「元に戻...
-- 了解いたしました。ご迷惑をおかけして申し訳ありません。...
-- 該当のリビジョン 1.17 をcheckoutした[[冒険者]]向け: c...
- いえいえ。現状の対応案はどんなものだったのでしょうか :)...
-- このような形で対応しました。Factory_hoge 全て同様の対...
function & Factory_DList(& $root, $text)
{
$out = explode('|', ltrim($text), 2);
if (count($out) < 2) {
- return Factory_Inline($text);
+ $_ret_object = Factory_Inline($text);
} else {
- return new DList($out);
+ $_ret_object = new DList($out);
}
+ return $_ret_object;
}
- ありがとうございます。そういえばコミットメールでこのパ...
- [[BugTrack2/185]] -- &new{2006-06-23 (金) 23:07:05};
- PHP 5.2.1において、convert_html.php,v 1.18がNotice出し...
Notice: Only variable references should be returned by r...
Notice: Only variable references should be returned by r...
上記と同じ問題のようです。
lib/convert_html.php(100): return new Paragraph(' ' . ...
lib/convert_html.php(102): return new Inline($text);
lib/convert_html.php(112): return new DList($out);
lib/convert_html.php(122): return new Table($out);
lib/convert_html.php(132): return new YTable(csv_explo...
lib/convert_html.php(145): return new Div($matches);
lib/convert_html.php(154): return new Div($matches);...
lib/convert_html.php(157): return new Div($matches);...
lib/convert_html.php(162): return new Paragraph($text);
lib/convert_html.php以外は大丈夫そうです。
- [[cvs:lib/convert_html.php]] (1.20) を次のように修正す...
// Returns inline-related object
function & Factory_Inline($text)
{
// Check the first letter of the line
if (substr($text, 0, 1) == '~') {
- return new Paragraph(' ' . substr($text, 1));
+ $_ret_object = & new Paragraph(' ' . substr($text, 1));
} else {
- return new Inline($text);
+ $_ret_object = & new Inline($text);
}
+ return $_ret_object;
}
function & Factory_DList(& $root, $text)
{
$out = explode('|', ltrim($text), 2);
if (count($out) < 2) {
- return Factory_Inline($text);
+ $_ret_object = & Factory_Inline($text);
} else {
- return new DList($out);
+ $_ret_object = & new DList($out);
}
+ return $_ret_object;
}
// '|'-separated table
function & Factory_Table(& $root, $text)
{
if (! preg_match('/^\|(.+)\|([hHfFcC]?)$/', $text, $ou...
- return Factory_Inline($text);
+ $_ret_object = & Factory_Inline($text);
} else {
- return new Table($out);
+ $_ret_object = & new Table($out);
}
+ return $_ret_object;
}
// Comma-separated table
function & Factory_YTable(& $root, $text)
{
if ($text == ',') {
- return Factory_Inline($text);
+ $_ret_object = & Factory_Inline($text);
} else {
- return new YTable(csv_explode(',', substr($text, 1)));
+ $_ret_object = & new YTable(csv_explode(',', substr($...
}
+ return $_ret_object;
}
function & Factory_Div(& $root, $text)
{
$matches = array();
// Seems block plugin?
if (PKWKEXP_DISABLE_MULTILINE_PLUGIN_HACK) {
// Usual code
if (preg_match('/^\#([^\(]+)(?:\((.*)\))?/', $text, $...
exist_plugin_convert($matches[1])) {
- return new Div($matches);
+ $_ret_object = & new Div($matches);
+ return $_ret_object;
}
} else {
// Hack code
if(preg_match('/^#([^\(\{]+)(?:\(([^\r]*)\))?(\{*)/',...
exist_plugin_convert($matches[1])) {
$len = strlen($matches[3]);
$body = array();
if ($len == 0) {
- return new Div($matches); // Seems legacy block plu...
+ $_ret_object = & new Div($matches); // Seems legacy...
+ return $_ret_object;
} else if (preg_match('/\{{' . $len . '}\s*\r(.*)\r\...
$matches[2] .= "\r" . $body[1] . "\r";
- return new Div($matches); // Seems multiline-enable...
+ $_ret_object = & new Div($matches); // Seems multil...
+ return $_ret_object;
}
}
}
- return new Paragraph($text);
+ $_ret_object = & new Paragraph($text);
+ return $_ret_object;
}
teanan さんの対応案との違いは、参照渡しでバッファ変数に代...
-- Factory_Inline関数にて代入する変数名(もしくはreturnす...
// Returns inline-related object
function & Factory_Inline($text)
{
// Check the first letter of the line
if (substr($text, 0, 1) == '~') {
- return new Paragraph(' ' . substr($text, 1));
+ $_ret_object = & new Paragraph(' ' . substr($text, 1));
} else {
- return new Inline($text);
+ $_ret_object = & new Inline($text);
}
+ return $_ret_object;
}
// やりとりを簡潔にしましたよ -- henoheno
// ありがとうございます。リストの階層がこっちのほうが適切...
// 構造的にはその方がいいみたいですね。この場で何が起こっ...
-- コピペするさいに、そこだけコードがごっちゃになってまし...
#comment
終了行:
* PHP 5.1.1 で大量の Notice が出る [#g07d4a71]
- ページ: [[BugTrack2]]
- 投稿者: [[teanan]]
- 優先順位: 重要
- 状態: 却下
- カテゴリー: 本体バグ
- 投稿日: 2005-12-29 (木) 10:54:42
- バージョン:
** メッセージ [#ef024fca]
PHP Version 5.1.1 の環境で、error_reporting(E_ALL) にして...
Notice: Only variable references should be returned by r...
***/lib/convert_html.php on line 144
** 参考 [#wb5afc78]
- http://ns1.php.gr.jp/pipermail/php-users/2005-July...
直接の原因は参照返しの関数でnewしたオブジェクトをそのま...
ことにあります。とりあえずバッファ変数に入れてあげること...
いです。
** 関連 [#j48cfc35]
- [[BugTrack/632]] PHP5で動作しない
- [[BugTrack2/106]] PHP5.0.5でFatal error
- [[BugTrack2/82]] php-5.1.0b2で正常動作しない。
- [[BugTrack2/185]] PHP 4.4.0 および PHP 5.1.0 以降では、...
--------
*コメント [#u90fe433]
- Noticeが出ないように、対策してみました。 -- [[teanan]] ...
-- [[cvs:lib/convert_html.php]] (1.17) [[diff to 1.16>cvs...
- lib/convert_html.phpを1.17にしたらPHP4.4.0で動かなくな...
Fatal error: Call to a member function on a non-object i...
です。PHP5.1.1では問題なく動きました((paraeditパッチをあ...
-- PHP4.4.1でも同じエラーが出ました。 -- [[okkez]] &new{2...
- ご迷惑をおかけして申し訳ないです。至急調査します。 -- [...
- PHP 4.3.8にてエラーです。 -- [[hirokasa]] &new{2005-12-...
- とりあえず、cvsを前のリビジョンに戻しました。 -- [[tean...
-- お疲れ様です。今後という事で構わないのですが、「元に戻...
-- 了解いたしました。ご迷惑をおかけして申し訳ありません。...
-- 該当のリビジョン 1.17 をcheckoutした[[冒険者]]向け: c...
- いえいえ。現状の対応案はどんなものだったのでしょうか :)...
-- このような形で対応しました。Factory_hoge 全て同様の対...
function & Factory_DList(& $root, $text)
{
$out = explode('|', ltrim($text), 2);
if (count($out) < 2) {
- return Factory_Inline($text);
+ $_ret_object = Factory_Inline($text);
} else {
- return new DList($out);
+ $_ret_object = new DList($out);
}
+ return $_ret_object;
}
- ありがとうございます。そういえばコミットメールでこのパ...
- [[BugTrack2/185]] -- &new{2006-06-23 (金) 23:07:05};
- PHP 5.2.1において、convert_html.php,v 1.18がNotice出し...
Notice: Only variable references should be returned by r...
Notice: Only variable references should be returned by r...
上記と同じ問題のようです。
lib/convert_html.php(100): return new Paragraph(' ' . ...
lib/convert_html.php(102): return new Inline($text);
lib/convert_html.php(112): return new DList($out);
lib/convert_html.php(122): return new Table($out);
lib/convert_html.php(132): return new YTable(csv_explo...
lib/convert_html.php(145): return new Div($matches);
lib/convert_html.php(154): return new Div($matches);...
lib/convert_html.php(157): return new Div($matches);...
lib/convert_html.php(162): return new Paragraph($text);
lib/convert_html.php以外は大丈夫そうです。
- [[cvs:lib/convert_html.php]] (1.20) を次のように修正す...
// Returns inline-related object
function & Factory_Inline($text)
{
// Check the first letter of the line
if (substr($text, 0, 1) == '~') {
- return new Paragraph(' ' . substr($text, 1));
+ $_ret_object = & new Paragraph(' ' . substr($text, 1));
} else {
- return new Inline($text);
+ $_ret_object = & new Inline($text);
}
+ return $_ret_object;
}
function & Factory_DList(& $root, $text)
{
$out = explode('|', ltrim($text), 2);
if (count($out) < 2) {
- return Factory_Inline($text);
+ $_ret_object = & Factory_Inline($text);
} else {
- return new DList($out);
+ $_ret_object = & new DList($out);
}
+ return $_ret_object;
}
// '|'-separated table
function & Factory_Table(& $root, $text)
{
if (! preg_match('/^\|(.+)\|([hHfFcC]?)$/', $text, $ou...
- return Factory_Inline($text);
+ $_ret_object = & Factory_Inline($text);
} else {
- return new Table($out);
+ $_ret_object = & new Table($out);
}
+ return $_ret_object;
}
// Comma-separated table
function & Factory_YTable(& $root, $text)
{
if ($text == ',') {
- return Factory_Inline($text);
+ $_ret_object = & Factory_Inline($text);
} else {
- return new YTable(csv_explode(',', substr($text, 1)));
+ $_ret_object = & new YTable(csv_explode(',', substr($...
}
+ return $_ret_object;
}
function & Factory_Div(& $root, $text)
{
$matches = array();
// Seems block plugin?
if (PKWKEXP_DISABLE_MULTILINE_PLUGIN_HACK) {
// Usual code
if (preg_match('/^\#([^\(]+)(?:\((.*)\))?/', $text, $...
exist_plugin_convert($matches[1])) {
- return new Div($matches);
+ $_ret_object = & new Div($matches);
+ return $_ret_object;
}
} else {
// Hack code
if(preg_match('/^#([^\(\{]+)(?:\(([^\r]*)\))?(\{*)/',...
exist_plugin_convert($matches[1])) {
$len = strlen($matches[3]);
$body = array();
if ($len == 0) {
- return new Div($matches); // Seems legacy block plu...
+ $_ret_object = & new Div($matches); // Seems legacy...
+ return $_ret_object;
} else if (preg_match('/\{{' . $len . '}\s*\r(.*)\r\...
$matches[2] .= "\r" . $body[1] . "\r";
- return new Div($matches); // Seems multiline-enable...
+ $_ret_object = & new Div($matches); // Seems multil...
+ return $_ret_object;
}
}
}
- return new Paragraph($text);
+ $_ret_object = & new Paragraph($text);
+ return $_ret_object;
}
teanan さんの対応案との違いは、参照渡しでバッファ変数に代...
-- Factory_Inline関数にて代入する変数名(もしくはreturnす...
// Returns inline-related object
function & Factory_Inline($text)
{
// Check the first letter of the line
if (substr($text, 0, 1) == '~') {
- return new Paragraph(' ' . substr($text, 1));
+ $_ret_object = & new Paragraph(' ' . substr($text, 1));
} else {
- return new Inline($text);
+ $_ret_object = & new Inline($text);
}
+ return $_ret_object;
}
// やりとりを簡潔にしましたよ -- henoheno
// ありがとうございます。リストの階層がこっちのほうが適切...
// 構造的にはその方がいいみたいですね。この場で何が起こっ...
-- コピペするさいに、そこだけコードがごっちゃになってまし...
#comment
ページ名: