|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Member
Iscritto dal: Dec 2007
Messaggi: 60
|
[PHP] - Problema con una semplice classe
Ciao a tutti,
ho un problema nel' eseguzione di una classe php... Al momento dell'eseguzione incontro il seguente errore Parse error: syntax error, unexpected '{' in <nomefile> on line 3 dove <nomefile> è il file *.php che eseguo ecco il codice Codice:
<?php
Class A
{
function foo()
{
********if (isset($this)){
************echo '$this is defined(';
************echo get_class($this);
************echo ")\n";
********}else{
************echo "\$this is not defined.\n";
********}
****}
}
$a=new A();
$a->foo();
A::foo();
?>
Grazie
__________________
"Commputer programming is tremendous fun. Like music, it is a skill that derives from an unknown blend of innate talent and constant practice." Larry O’Brien & Bruce Eckel Ultima modifica di arthurgp : 03-06-2008 alle 16:51. |
|
|
|
|
|
#2 |
|
Senior Member
Iscritto dal: May 2005
Città: Napoli - Fuorigrotta
Messaggi: 471
|
Codice:
<?php
Class A
{
function foo()
{
********if (isset($this)){
************echo '$this is defined(';
************echo get_class($this);
************echo ")\n";
********}else{
************echo "\$this is not defined.\n";
********}
}
}
$a=new A();
$a->foo();
A::foo();
?>
__________________
Acquisti sul mercatino: grabrihc, LucaXbox360, Yarsha,micanto1,American horizo,Fnac,schumyFast,STECCO,Ezechiele25,17 Vendite sul mercatino: musodatopo,alexbands,mspr,anto.wajo |
|
|
|
|
|
#3 |
|
Member
Iscritto dal: Dec 2007
Messaggi: 60
|
Non so come mai, ho aggiornato MAMP che mi fa da gestore php,mysql e apache in MacOSx e ora funziona tutto...
Grazie lo stesso
__________________
"Commputer programming is tremendous fun. Like music, it is a skill that derives from an unknown blend of innate talent and constant practice." Larry O’Brien & Bruce Eckel |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 16:15.



















