RE: [PHP] Require() vs Include()

From: Date: Tue, 14 Nov 2000 05:12:55 +0000
Subject: RE: [PHP] Require() vs Include()
Groups: php.general 
Request: Send a blank email to php-general+get-25131@lists.php.net to get a copy of this message
Does that mean that we can freely write to the whole mailing list (the whole world) DO NEVER USE REQUIRE() SINCE THERE'S INCLUDE() WHICH IS 100.00% BETTER ? I mean, in something require() is still being good, isn't it? Cheers, Maxim Maletsky -----Original Message----- From: Lars Torben Wilson [mailto:torben@php.net] Sent: Tuesday, November 14, 2000 3:06 PM To: Maxim Maletsky Cc: Lawrence.Sheed@dfait-maeci.gc.ca; php-general@lists.php.net Subject: RE: [PHP] Require() vs Include() Maxim Maletsky writes: > OK, then. > > what is the reason require() exists? > > > If it works the exactly same way as include() except that include can be > more flexible why would we use require() then? > > Any performance issues? > usability? > security? > > Thanks Lawrence, In PHP 3, it was quite a bit faster than include(). There were other semantic differences between the two as well, such as return values etc. Performance appears to now be pretty much the same; you can return values with include() now, and so forth and so on. BTW, require() will fail in a completely different way from include() when it can't find the target file. include() will simply return a false value, whereas require() will spit out a great big 'Fatal error' and halt script execution. -- +----------------------------------------------------------------+ |Torben Wilson <torben@php.net> Netmill iTech| |http://www.coastnet.com/~torben http://www.netmill.fi| |Ph: 1 250 383-9735 torben@netmill.fi| +----------------------------------------------------------------+ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#25131) next »