# required argument after an optional should make it required

- Thread: https://externals.io/message/55632
- Original archive: https://news-web.php.net/php.internals/55632
- Started by Ferenc Kovacs on 2011-09-26T23:43:12+00:00
- Messages: 4
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #55632 — Ferenc Kovacs — 2011-09-26T23:43:12+00:00

URL: https://externals.io/message/55632#55632

Hi.

I've just found a nice feature request in the bugtracker:
https://bugs.php.net/bug.php?id=53399

what do you think about it?

-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu

---

## #55633 — Laruence — 2011-09-27T03:36:36+00:00

URL: https://externals.io/message/55632#55633 · In reply to: #55632

Hi:
   +1 for this

thanks

2011/9/27 Ferenc Kovacs <tyra3l@gmail.com>:
> Hi.
>
> I've just found a nice feature request in the bugtracker:
> https://bugs.php.net/bug.php?id=53399
>
> what do you think about it?
>
> --
> Ferenc Kovács
> @Tyr43l - http://tyrael.hu
>
> --
> 
> 
>
>



-- 
Laruence  Xinchen Hui
http://www.laruence.com/

---

## #55635 — Nikita Popov — 2011-09-27T05:11:58+00:00

URL: https://externals.io/message/55632#55635 · In reply to: #55632

One thing I noticed this *could* be useful for is allowing null values
on typehinted arguments:
function f(TypeHint $arg = null, $arg2);
$arg can now be either instanceof TypeHint or null.

(Just noting that it does influence behavior sometimes, not that this
is relevant.)

Nikita


> Hi.
>
> I've just found a nice feature request in the bugtracker:
> https://bugs.php.net/bug.php?id=53399
>
> what do you think about it?
>
> --
> Ferenc Kovács
> @Tyr43l - http://tyrael.hu

---

## #55811 — Stas Malyshev — 2011-10-16T00:20:09+00:00

URL: https://externals.io/message/55632#55811 · In reply to: #55632

Hi!


> Hi.
>
> I've just found a nice feature request in the bugtracker:
> https://bugs.php.net/bug.php?id=53399
>
> what do you think about it?

I think the idea is good, however the patch seems too complicated. I do 
not think we need additional flag and not sure why would we need 
additional pass through arguments to do it - if we say everything after 
certain arg is optional, then we already know how to do it, we have 
settings for that in args structure. And we can detect this stuation 
immediately when we parse the arguments on compile.


-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
