Ok, sorry, I have been off the ZE2 list for a while (just joined back).
Where is there more info on what the type hints do in ZE2. I am curious as
I wrote the RFC.
Brian.
dealnews
----- Original Message -----
From: "Timm Friebe" <[EMAIL PROTECTED]>
To: "Brian Moon" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, March 27, 2003 11:40 AM
Subject: Re: [PHP-DEV] Type hints revisited [IllegalArgumentException
instead of E_ERROR]
| On Thu, 2003-03-27 at 18:32, Brian Moon wrote:
| > Has type hinting for functions been implemented in ZE2?
|
| Type hints apply to global functions just as they do for class methods.
|
| <?php
| class Date {
| private
| $utime = 0;
|
| public function __construct($arg= -1) {
| if (is_int($arg)) {
| $this->utime= $arg < 0 ? time() : $arg;
| } else {
| $this->utime= strtotime($arg);
| }
| }
|
| public function toString($fmt= 'r') {
| return date($fmt, $this->utime);
| }
| }
|
| function print_date(Date $date, $fmt) {
| echo $date->toString($fmt);
| }
|
| print_date(new Date(), $argv[1]);
| echo "\n";
| ?>
| [EMAIL PROTECTED]:~/devel/php > ./php5/sapi/cli/php date.php "Y-m-d"
| 2003-03-27
|
| - Timm
|
|
| --
| PHP Internals - PHP Runtime Development Mailing List
| To unsubscribe, visit: http://www.php.net/unsub.php
|
|
|
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php