放棄 PHP4 的 Object Reference

編寫、設計網頁與程式。

版主: hamu278, 銘仔

版面規則
  • 本版面亦可以討論網頁寄存公司

Re: 放棄 PHP4 的 Object Reference

文章Puff » 2008-09-26, 17:28

bananasims 寫:
Puff 寫:It seems that PHP6 will remove the support of this thing
代碼: 選擇全部
$something = "My name is [b]{$name}[/b], I like to play [b]{$games}[/b]";


I'm not sure but someone says that on his/her blog :oops:

對我無乜影響 :D

我以前就寫
代碼: 選擇全部
$something = 'My name is [b]'.$name.'[/b], I like to play [b]'.$games.'[/b]';

而家就
代碼: 選擇全部
$something = 'My name is [b]' . $name . '[/b], I like to play [b]' . $games . '[/b]';


Discuz! 好興咁
代碼: 選擇全部
$something = "My name is [b]$name[/b], I like to play [b]$games[/b]";

I know the {} string scope(?) from phpBB3 :lol:

$sth = append_sid("{$phpbb_root_path}index.$phpEx"); (?)

I'm now confusing should I continue to use this method
Wholehearted plastics are stranger than fiction.
Puff
木星會員
 
文章: 343
註冊時間: 2008-08-30, 05:22

Re: 放棄 PHP4 的 Object Reference

文章bananasims » 2008-09-26, 17:29

諗起,我寫 SQL 都成日用呢個 :oops:
影像.從心 At the heart of the ímage
bananasims
太陽會員
 
文章: 13541
註冊時間: 2005-09-22, 00:00

Re: 放棄 PHP4 的 Object Reference

文章Puff » 2008-09-26, 17:33

http://wiki.php.net/todo/php60

It seems that removing "{}" is dropped on todo-list already.
Wholehearted plastics are stranger than fiction.
Puff
木星會員
 
文章: 343
註冊時間: 2008-08-30, 05:22

Re: 放棄 PHP4 的 Object Reference

文章bananasims » 2008-09-26, 17:41

佢無話移除喎…
影像.從心 At the heart of the ímage
bananasims
太陽會員
 
文章: 13541
註冊時間: 2005-09-22, 00:00

Re: 放棄 PHP4 的 Object Reference

文章Puff » 2008-09-26, 17:45

bananasims 寫:佢無話移除喎…

I mean it is dropped from the todo-list :oops:

My poor english :cry:
Wholehearted plastics are stranger than fiction.
Puff
木星會員
 
文章: 343
註冊時間: 2008-08-30, 05:22

Re: 放棄 PHP4 的 Object Reference

文章ntf » 2008-09-26, 17:53

bananasims 寫:
ntf 寫:
bananasims 寫:哦,明白
我而家先知 PHP 4 都有 constructor…
可能兩個都要保留 :oops:
代碼: 選擇全部
class test
{
   function test()
   {
      $this->__constructor();
   }

   function __constructor()
   {
      // code
   }
}


無乜 PHP 5 開發經驗,唔知可唔可以 $this->__constructor();
仲有,個 extends 我一向唔識用 :oops: 次次用親都話搵唔到個 object
以我理解,係整個新既 class 去將入面既 function 同埋 variable 加落去個 object 到
對 class 無乜研究,我都係識嗰啲 protect private protected 嗰啲


唔係 $this->__constructor(); 係 __construct

例:
代碼: 選擇全部
class example{
       function __construct($string) {
             echo $string;
   }
}

$x=new example('hello world");


順道一提 interface 都幾好用

PHP 4 可唔可以咁寫?
Puff 寫:Thanks for the answer by ntf :lol:

PHP4 is now stopped supporting by the official so I think I will rewrite a part of my forum-program into PHP5 OO-style :lol:

Now look forward to PHP6 :lol:


我估你都唔會再用 register_globals 同埋 magic_quotes_gpc :D



php4 用 __construct 等回冇反應
public protected 等keyword 會有error

我唔建議用 namespace , Lambda functions and closures 因多數人仲用緊 5.2.x

php最有問題係 成日都加野 , 不過加左野d人有未必更新左= =
最後由 ntf 於 2008-09-26, 17:56 編輯,總共編輯了 1 次。
ntf
天王星會員
 
文章: 36
註冊時間: 2008-05-25, 12:02

Re: 放棄 PHP4 的 Object Reference

文章bananasims » 2008-09-26, 17:54

Puff 寫:
bananasims 寫:佢無話移除喎…

I mean it is dropped from the todo-list :oops:

My poor english :cry:

我明你講乜,你即係話你既 todo-list 無咗「移除 { }」呢樣野
我想問下你邊個 blog 睇到?
影像.從心 At the heart of the ímage
bananasims
太陽會員
 
文章: 13541
註冊時間: 2005-09-22, 00:00

Re: 放棄 PHP4 的 Object Reference

文章bananasims » 2008-09-26, 17:55

ntf 寫:
bananasims 寫:
ntf 寫:
bananasims 寫:哦,明白
我而家先知 PHP 4 都有 constructor…
可能兩個都要保留 :oops:
代碼: 選擇全部
class test
{
   function test()
   {
      $this->__constructor();
   }

   function __constructor()
   {
      // code
   }
}


無乜 PHP 5 開發經驗,唔知可唔可以 $this->__constructor();
仲有,個 extends 我一向唔識用 :oops: 次次用親都話搵唔到個 object
以我理解,係整個新既 class 去將入面既 function 同埋 variable 加落去個 object 到
對 class 無乜研究,我都係識嗰啲 protect private protected 嗰啲


唔係 $this->__constructor(); 係 __construct

例:
代碼: 選擇全部
class example{
       function __construct($string) {
             echo $string;
   }
}

$x=new example('hello world");


順道一提 interface 都幾好用

PHP 4 可唔可以咁寫?
Puff 寫:Thanks for the answer by ntf :lol:

PHP4 is now stopped supporting by the official so I think I will rewrite a part of my forum-program into PHP5 OO-style :lol:

Now look forward to PHP6 :lol:


我估你都唔會再用 register_globals 同埋 magic_quotes_gpc :D



php4 用 __construct 等回冇反應
public protected 等keyword 會有error

我唔建議用namespace,因多數人仲用緊 5.2.x

而家仲有咁多網存用 PHP 4…
__construct 佢當係一個 function :oops:
public private 嗰堆我都試過 error :D 因為當時唔知原來 WC 係 PHP4
影像.從心 At the heart of the ímage
bananasims
太陽會員
 
文章: 13541
註冊時間: 2005-09-22, 00:00

Re: 放棄 PHP4 的 Object Reference

文章Puff » 2008-09-26, 17:57

bananasims 寫:
Puff 寫:
bananasims 寫:佢無話移除喎…

I mean it is dropped from the todo-list :oops:

My poor english :cry:

我明你講乜,你即係話你既 todo-list 無咗「移除 { }」呢樣野
我想問下你邊個 blog 睇到?

Search by google ;)
Forgotten already :lol:
Wholehearted plastics are stranger than fiction.
Puff
木星會員
 
文章: 343
註冊時間: 2008-08-30, 05:22

Re: 放棄 PHP4 的 Object Reference

文章Puff » 2008-09-26, 17:58

I wanna know why some hostings do not use PHP5. :oops:
Wholehearted plastics are stranger than fiction.
Puff
木星會員
 
文章: 343
註冊時間: 2008-08-30, 05:22

Re: 放棄 PHP4 的 Object Reference

文章bananasims » 2008-09-26, 18:01

Puff 寫:I wanna know why some hostings do not use PHP5. :oops:

相容性…你可以用 .htaccess AddHandler,不過就無得用 php_flag 閂 register_globals
影像.從心 At the heart of the ímage
bananasims
太陽會員
 
文章: 13541
註冊時間: 2005-09-22, 00:00

Re: 放棄 PHP4 的 Object Reference

文章Puff » 2008-09-26, 18:06

bananasims 寫:
Puff 寫:I wanna know why some hostings do not use PHP5. :oops:

相容性…你可以用 .htaccess AddHandler,不過就無得用 php_flag 閂 register_globals

:oops:
well...
I think that my program will not released in a year

Maybe PHP4 will be disappeared after a year. :oops:

No being compatibility to PHP4 then :lol:

Furthermore, my server is also using WCHost,

but they defaultly install PHP5 to me :roll:

---

Where is ntf's "LE"? :roll:
I can't find it on ntf's website.
Wholehearted plastics are stranger than fiction.
Puff
木星會員
 
文章: 343
註冊時間: 2008-08-30, 05:22

Re: 放棄 PHP4 的 Object Reference

文章bananasims » 2008-09-26, 18:12

Puff 寫:
bananasims 寫:
Puff 寫:I wanna know why some hostings do not use PHP5. :oops:

相容性…你可以用 .htaccess AddHandler,不過就無得用 php_flag 閂 register_globals

:oops:
well...
I think that my program will not released in a year

Maybe PHP4 will be disappeared after a year. :oops:

No being compatibility to PHP4 then :lol:

Furthermore, my server is also using WCHost,

but they defaultly install PHP5 to me :roll:

---

Where is ntf's "LE"? :roll:
I can't find it on ntf's website.

咁好?用咩 server?
影像.從心 At the heart of the ímage
bananasims
太陽會員
 
文章: 13541
註冊時間: 2005-09-22, 00:00

Re: 放棄 PHP4 的 Object Reference

文章ntf » 2008-09-26, 18:24

Puff 寫:
bananasims 寫:
Puff 寫:I wanna know why some hostings do not use PHP5. :oops:

相容性…你可以用 .htaccess AddHandler,不過就無得用 php_flag 閂 register_globals

:oops:
well...
I think that my program will not released in a year

Maybe PHP4 will be disappeared after a year. :oops:

No being compatibility to PHP4 then :lol:

Furthermore, my server is also using WCHost,

but they defaultly install PHP5 to me :roll:

---

Where is ntf's "LE"? :roll:
I can't find it on ntf's website.


http://webmaster-hk.co.cc/discuz/thread-460-1-1.html

要最新直接找我 (大至上係重新整理一下 d script , 增加更新script)
ntf
天王星會員
 
文章: 36
註冊時間: 2008-05-25, 12:02

Re: 放棄 PHP4 的 Object Reference

文章Puff » 2008-09-26, 20:02

bananasims 寫:
Puff 寫:
bananasims 寫:
Puff 寫:I wanna know why some hostings do not use PHP5. :oops:

相容性…你可以用 .htaccess AddHandler,不過就無得用 php_flag 閂 register_globals

:oops:
well...
I think that my program will not released in a year

Maybe PHP4 will be disappeared after a year. :oops:

No being compatibility to PHP4 then :lol:

Furthermore, my server is also using WCHost,

but they defaultly install PHP5 to me :roll:

---

Where is ntf's "LE"? :roll:
I can't find it on ntf's website.

咁好?用咩 server?

Well, originally is use P-D 2.XGhz...
But WCHost said the CPU is too hot,
so they changed the CPU into Core 2 Duo for us (of coz free :oops:
Wholehearted plastics are stranger than fiction.
Puff
木星會員
 
文章: 343
註冊時間: 2008-08-30, 05:22

Re: 放棄 PHP4 的 Object Reference

文章bananasims » 2008-09-26, 20:04

無天理,我要求轉去 PHP 5 既 server 佢死都唔肯。
影像.從心 At the heart of the ímage
bananasims
太陽會員
 
文章: 13541
註冊時間: 2005-09-22, 00:00

Re: 放棄 PHP4 的 Object Reference

文章Puff » 2008-09-26, 23:31

bananasims 寫:無天理,我要求轉去 PHP 5 既 server 佢死都唔肯。

插佢 :o
Wholehearted plastics are stranger than fiction.
Puff
木星會員
 
文章: 343
註冊時間: 2008-08-30, 05:22

上一頁

回到 [B1] 網頁製作、程式編寫與介面設計



誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 3 位訪客