Toon posts:

[php] functies includen binnen een class pt2

Pagina: 1
Acties:
  • 32 views sinds 30-01-2008

Verwijderd

Topicstarter
ik zie dat mnijn topic is gesloten omdat het volgens sommige mensen om simpel debuggen ging. Ik werk nu al bijna 2 jaar met php, heb genoeg ervareing met andere talen waaronder JAVA, C#, ASP en ik weet echt wel wanneer ik moet debuggen en wanneer niet.

Als bewijs dat mijn topic te snel is gelsoten vond ik op PHP.net:

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
It appears as if "include()" and "require()" cannot appear inside a class definition, but outside a class method.

For example, the construct
class A {
include ('class_a_methods.php');
}
returns an error (unexpected T_INCLUDE), but
class A {
function foo() {
include ('class_a_foo_method.php');
}
}
works as expected.

This is a slight annoyance if one wants to keep class code in manageable chunks.

  • drm
  • Registratie: Februari 2001
  • Laatst online: 09-06-2025

drm

f0pc0dert

fijn. Volgende keer klagen in LA of 't liefst gewoon met mail met 't betreffende modje.

edit:

BTW, als het "gewoon op PHP.net" stond, waarom moest je dan toch een topic openen? Volgens mij is er dan sowieso iets mis.

[ Voor 45% gewijzigd door drm op 02-12-2002 11:06 ]

Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz


Dit topic is gesloten.