Try the following to see it
<?php
class A {
}
function foo(A $a = 1) {
;
}
foo();
?> 8 1320
On 13 Jan., 04:56, "Peter Pei" <yan...@telus.comwrote:
Try the following to see it
<?php
*class A {
*}
*function foo(A $a = 1) {
* ;
*}
*foo();
?>
I get this, which isn't missleading:
>>>
Fatal error: Default value for parameters with a class type hint can
only be NULL in /Applications/MAMP/htdocs/compile/includes/
CParser.inc.php on line 12
<<<
On 13 Jan., 05:01, seaside <seaside...@mac.comwrote:
On 13 Jan., 04:56, "Peter Pei" <yan...@telus.comwrote:
Try the following to see it
<?php
*class A {
*}
*function foo(A $a = 1) {
* ;
*}
*foo();
?>
I get this, which isn't missleading:
.. since you can't pass anything else.
On 13 Jan., 05:01, seaside <seaside...@mac.comwrote:
On 13 Jan., 04:56, "Peter Pei" <yan...@telus.comwrote:
Try the following to see it
<?php
*class A {
*}
*function foo(A $a = 1) {
* ;
*}
*foo();
?>
I get this, which isn't missleading:
... since you can't define any other default value [sorry, typo in my
previous posting]
Peter Pei wrote:
Try the following to see it
<?php
class A {
}
function foo(A $a = 1) {
;
}
foo();
?>
So, what is your error? I'm not necessarily running the same version as
you.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
==================
right, my screen cut off part of the msg ;-)
On Jan 12, 7:56 pm, "Peter Pei" <yan...@telus.comwrote:
Try the following to see it
<?php
class A {
}
function foo(A $a = 1) {
;
}
foo();
?>
i dont see code like this before, try the following.. hope this will
help.. :P
<?php
class A {
var $val;
function A($value)
{
$this->val = $val;
}
}
function foo(new A(1))
{
print $a->val
}
foo();
?>
On Jan 13, 12:16 am, "radmissio...@gmail.com" <radmissio...@gmail.com>
wrote:
On Jan 12, 7:56 pm, "Peter Pei" <yan...@telus.comwrote:
Try the following to see it
<?php
class A {
}
function foo(A $a = 1) {
;
}
foo();
?>
i dont see code like this before, try the following.. hope this will
help.. :P
<?php
class A {
var $val;
function A($value)
{
$this->val = $val;
}
}
function foo(new A(1))
{
print $a->val
}
foo();
?>
im not familiar with the versions.. :P This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Brian Kelley |
last post by:
I accidentally derived a class from a module (types instead of
types.Dicttype)
>>> import types
>>> class f(types): pass
....
Traceback (most recent call last):
File "<stdin>", line 1, in ?...
|
by: j |
last post by:
Anyone here feel that "global variables" is misleading for variables
whose scope is file scope? "global" seems to imply global visibility,
while this isn't true for variables whose scope is file...
|
by: Fehy |
last post by:
The code below, while compiled with .NET 2003, produce misleading error
description:
c:\Work\error\exmaple\exmaple\exmaple.cpp(17) : error C2501: 'makeerror' :
missing storage-class or type...
|
by: Juho Schultz |
last post by:
if ((data > 0) or
(datadict.has_key)):
Traceback (most recent call last):
File "reduce.py", line 524, in remove_badvalues
if ((data > 0) or
TypeError: unsubscriptable object
However, the...
|
by: LuciferLeo |
last post by:
given i = 0,
I know i = i + 1 and i += 1 are all correct
but when I type:
>>> i++
the interpreter replies:
File "<stdin>", line 1
i++
^
SyntaxError: invalid syntax
|
by: Claudio Grondi |
last post by:
Here an example of what I mean
(Python 2.4.2, IDLE 1.1.2, Windows XP SP2, NTFS file system, 80 GByte
large file):
Traceback (most recent call last):
File "<pyshell#1>", line 1, in -toplevel-...
|
by: jkn |
last post by:
Hi all
Python 2.4.2 (#1, Apr 26 2006, 23:35:31)
on
linux2
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
File "<stdin>", line 1, in...
|
by: Erik Johnson |
last post by:
I ran into a problem I didn't understand at first. I got part of it figured
out. Let me first demonstrate the original problem:
class Super(object):
def __init__(self):
self._class = 'Super'...
|
by: MC |
last post by:
I had 2 folders I couldn't move or delete. Each had contained the
executable from a console-mode Visual Studio 2008 C# application. On trying
to move the folders I got the entirely misleading UAC...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |