Mailinglisten-Archive |
On Sun, 6 Jun 1999, Manuel Hossfeld wrote:
> Genau. Das ist auch völlig normal, denn require und include sind beides bloß
> "language constructs", und keine "normalen Funktionen", d.h. sie "returnen"
> nichts. Also kannst Du so eine Zuweisung wie oben auch nicht machen. Das geht
> dann AFIAK erst in Zend bzw. PHP4. Obwohl ich bezweifle, ob das dann das wäre,
> was Du willst (denn dabei wird normalerweise nur ein exit-code returned)...
> Du möchtest aber offenbar den Inhalt eines Files in einer Variable zwecks
> Weiterverarbeitung speichern.
Jetzt bist Du aber etwas reingefallen.
New Functionality in Zend:
include() and eval() are now functions, and not statements. That means
they return a value. The default return value from include() and eval() is
1, so that you can do if (include()) without further coding. The return
value may be changed by returning a value from the global scope of the
included file or the evaluated string. For example, if 'return 7;' is
executed in the global scope of foo.inc, include("foo.inc") would evaluate
to 7.
-Egon
php::bar PHP Wiki - Listenarchive