473,320 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

misleading error message

Try the following to see it
<?php
class A {
}
function foo(A $a = 1) {
;
}
foo();
?>
Jan 13 '08 #1
8 1320
am using .2.5
Jan 13 '08 #2
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
<<<

Jan 13 '08 #3
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.

Jan 13 '08 #4
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]
Jan 13 '08 #5
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
==================

Jan 13 '08 #6
right, my screen cut off part of the msg ;-)
Jan 13 '08 #7
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();
?>
Jan 13 '08 #8
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
Jan 13 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
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 ?...
5
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...
0
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...
2
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...
6
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
8
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-...
5
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...
4
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'...
1
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...
0
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...
0
isladogs
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...
0
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...
0
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...
0
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...
1
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)...
0
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...
0
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
0
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.