Re: Codebabes: PHP

From: Date: Tue, 29 Apr 2014 13:52:04 +0000
Subject: Re: Codebabes: PHP
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-323219@lists.php.net to get a copy of this message
On 14-04-29 09:38 AM, Christoph Becker wrote:
Kumar Saurabh Sinha wrote:
Difference between Language Construct & Functions: *Language Constructs* Constructs are elements that are built-into the language and, therefore, follow special rules.
ACK.
         Perhaps the most common of them is the echo statement, which allows
you to write data to the script’s output: echo 10; // will output 10 It’s important to understand that echo is not a function and, as such, it does not have a return value. If you need to output data through a function, you can use print() instead:
print is a language construct and not a function. Try e.g. call_user_func('print', 'foo'); However, it's interesting that print nonetheless has a return value (which always is 1).
One of the most popular constructs has a return value: isset. Cheers, Rob. -- E-Mail Disclaimer: Information contained in this message and any attached documents is considered confidential and legally protected. This message is intended solely for the addressee(s). Disclosure, copying, and distribution are prohibited unless authorized.

« previous php.general (#323219) next »