For Programmers: Free Programming Magazines  


Home > Archive > PHP Zend Engine > November 2005 > RE: [ZEND-ENGINE-CVS] cvs: ZendEngine2(PHP_5_1)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RE: [ZEND-ENGINE-CVS] cvs: ZendEngine2(PHP_5_1)
Andi Gutmans

2005-11-18, 6:56 pm

At 11:51 PM 11/17/2005, Dmitry Stogov wrote:
>I don't see any reason not allow null as default value for arguments with
>array type hint.


It's not a valid array value.


>In real OOP languages "array" just a special class.


But we're not a real OOP language, we are PHP. Arrays are native
types (and I hope they remain so), and I think it's cleaner to
require people to write an empty array as the default value.


>The situation before this patch was buggy.
>Compiler allowed (array $a = null), but executor emited error.


Maybe we should fix the compiler?

Andi

[color=darkred]
>Thanks. Dmitry.
>
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com