Discussion:
Codebabes: PHP
Daevid Vincent
2014-04-25 22:07:53 UTC
Permalink
https://codebabes.com/courses/php-virgin



*smh*
Daniel Brown
2014-04-28 17:35:03 UTC
Permalink
Post by Daevid Vincent
https://codebabes.com/courses/php-virgin
*smh*
Wow. There's a niche for everything.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Tiago Hori
2014-04-28 19:03:25 UTC
Permalink
I am still hopping it a tasteless joke.


Sent from my iPhone
Post by Daniel Brown
Post by Daevid Vincent
https://codebabes.com/courses/php-virgin
*smh*
Wow. There's a niche for everything.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Marc Guay
2014-04-28 19:25:59 UTC
Permalink
The only sane response: http://codedicks.com/
Post by Tiago Hori
I am still hopping it a tasteless joke.
Sent from my iPhone
Post by Daniel Brown
Post by Daevid Vincent
https://codebabes.com/courses/php-virgin
*smh*
Wow. There's a niche for everything.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Robert Cummings
2014-04-28 19:30:18 UTC
Permalink
Post by Daevid Vincent
https://codebabes.com/courses/php-virgin
*smh*
They should push the use of echo over print since it's a language
construct and not a function thus it benefits from no function overhead.

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.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Robert Cummings
2014-04-28 19:32:32 UTC
Permalink
Post by Robert Cummings
Post by Daevid Vincent
https://codebabes.com/courses/php-virgin
*smh*
They should push the use of echo over print since it's a language
construct and not a function thus it benefits from no function overhead.
Cheers,
Rob.
I'd like to retract this comment :) Apparent print is not a function.
Didn't it used to be?

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.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Ashley Sheridan
2014-04-28 20:07:58 UTC
Permalink
Well, it still requires 25% more typing :)
Post by Robert Cummings
Post by Robert Cummings
Post by Daevid Vincent
https://codebabes.com/courses/php-virgin
*smh*
They should push the use of echo over print since it's a language
construct and not a function thus it benefits from no function
overhead.
Post by Robert Cummings
Cheers,
Rob.
I'd like to retract this comment :) Apparent print is not a function.
Didn't it used to be?
Cheers,
Rob.
Thanks,
Ash
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Tedd Sperling
2014-04-29 12:33:50 UTC
Permalink
Post by Robert Cummings
They should push the use of echo over print since it's a language
construct and not a function thus it benefits from no function overhead.
Cheers,
Rob.
I'd like to retract this comment :) Apparent print is not a function. Didn't it used to be?
Cheers,
Rob.
--
Nope, you can't retract it. :-)

As for "print" being a function or construct, I dunno -- what's the difference?

Cheers,

tedd


_______________
tedd sperling
***@sperling.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Sebastian Krebs
2014-04-29 12:45:26 UTC
Permalink
Post by Robert Cummings
Post by Robert Cummings
Post by Robert Cummings
They should push the use of echo over print since it's a language
construct and not a function thus it benefits from no function overhead.
Cheers,
Rob.
I'd like to retract this comment :) Apparent print is not a function.
Didn't it used to be?
Post by Robert Cummings
Cheers,
Rob.
--
Nope, you can't retract it. :-)
As for "print" being a function or construct, I dunno -- what's the difference?
In the real world: You can never use functions without the paranthesis, but
you can never use language constructs as callbacks.

array_map($titles, 'echo'); // crash
Post by Robert Cummings
Cheers,
tedd
_______________
tedd sperling
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
github.com/KingCrunch
Daniel Brown
2014-04-29 13:11:29 UTC
Permalink
Post by Sebastian Krebs
Post by Tedd Sperling
As for "print" being a function or construct, I dunno -- what's the difference?
In the real world: You can never use functions without the paranthesis, but
you can never use language constructs as callbacks.
To be fair, and to muddy-up the waters even more....

echo 'echo'; // No parentheses needed....
echo('echo'); // .... but they can be used.
print('print'); // Seems common to see parentheses used here....
print 'print'; // .... but as a construct, they're not needed.
exit; // A language construct does not need parentheses....
exit(-1); // .... except in certain situations like this,
where data is passed.
continue; // However, there is yet another exception....
continue(2); // .... in that continue works with parentheses....
continue 2; // .... and without, but it is a control structure.
goto hell; // And yet, goto - another control structure - works....
goto(hell); // .... but only if you skip parentheses.
--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Tedd Sperling
2014-04-29 23:28:58 UTC
Permalink
Post by Daniel Brown
To be fair, and to muddy-up the waters even more....
echo 'echo'; // No parentheses needed....
echo('echo'); // .... but they can be used.
print('print'); // Seems common to see parentheses used here....
print 'print'; // .... but as a construct, they're not needed.
exit; // A language construct does not need parentheses....
exit(-1); // .... except in certain situations like this,
where data is passed.
continue; // However, there is yet another exception....
continue(2); // .... in that continue works with parentheses....
continue 2; // .... and without, but it is a control structure.
goto hell; // And yet, goto - another control structure - works....
goto(hell); // .... but only if you skip parentheses.
--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/
Don't forget Ouch(); //... it returns "My head hurts."

Also, with a function you can do this:

$squareRoot = "sqrt";
echo "The square root of 9 is " . $squareRoot(9); // a variable function

But, you can't do the same with a construct:

I want to go back to "I dunno" because that was simpler for me -- some things are just not meant to be learnt.

Cheers,

tedd

_______________
tedd sperling
***@sperling.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Tiago Hori
2014-04-30 00:11:00 UTC
Permalink
Still loving how we turned codebabes into something constructive!

Sent from my iPhone
Post by Tedd Sperling
Post by Daniel Brown
To be fair, and to muddy-up the waters even more....
echo 'echo'; // No parentheses needed....
echo('echo'); // .... but they can be used.
print('print'); // Seems common to see parentheses used here....
print 'print'; // .... but as a construct, they're not needed.
exit; // A language construct does not need parentheses....
exit(-1); // .... except in certain situations like this,
where data is passed.
continue; // However, there is yet another exception....
continue(2); // .... in that continue works with parentheses....
continue 2; // .... and without, but it is a control structure.
goto hell; // And yet, goto - another control structure - works....
goto(hell); // .... but only if you skip parentheses.
--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/
Don't forget Ouch(); //... it returns "My head hurts."
$squareRoot = "sqrt";
echo "The square root of 9 is " . $squareRoot(9); // a variable function
I want to go back to "I dunno" because that was simpler for me -- some things are just not meant to be learnt.
Cheers,
tedd
_______________
tedd sperling
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Robert Cummings
2014-04-30 03:26:43 UTC
Permalink
Post by Tedd Sperling
Post by Daniel Brown
To be fair, and to muddy-up the waters even more....
echo 'echo'; // No parentheses needed....
echo('echo'); // .... but they can be used.
print('print'); // Seems common to see parentheses used here....
print 'print'; // .... but as a construct, they're not needed.
exit; // A language construct does not need parentheses....
exit(-1); // .... except in certain situations like this,
where data is passed.
continue; // However, there is yet another exception....
continue(2); // .... in that continue works with parentheses....
continue 2; // .... and without, but it is a control structure.
goto hell; // And yet, goto - another control structure - works....
goto(hell); // .... but only if you skip parentheses.
--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/
Don't forget Ouch(); //... it returns "My head hurts."
$squareRoot = "sqrt";
echo "The square root of 9 is " . $squareRoot(9); // a variable function
But these days you can get pretty damn close:

<?php

$echo = function( $string ){ echo $string };
$echo( "I do indeed love true anonymous functions :)" );

?>

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.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Sebastian Krebs
2014-04-30 07:07:48 UTC
Permalink
Post by Daniel Brown
Post by Sebastian Krebs
Post by Tedd Sperling
As for "print" being a function or construct, I dunno -- what's the difference?
In the real world: You can never use functions without the paranthesis,
but
Post by Sebastian Krebs
you can never use language constructs as callbacks.
To be fair, and to muddy-up the waters even more....
echo 'echo'; // No parentheses needed....
echo('echo'); // .... but they can be used.
print('print'); // Seems common to see parentheses used here....
print 'print'; // .... but as a construct, they're not needed.
exit; // A language construct does not need parentheses....
exit(-1); // .... except in certain situations like this,
where data is passed.
continue; // However, there is yet another exception....
continue(2); // .... in that continue works with parentheses....
continue 2; // .... and without, but it is a control structure.
? control structures are language constructs too :? So of course it works
this way.
Post by Daniel Brown
goto hell; // And yet, goto - another control structure - works....
goto(hell); // .... but only if you skip parentheses.
And yet there are difference, of course ;) "class" is also a language
construct, but still you can't write

class (foo) extends (bar) {}
Post by Daniel Brown
--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/
--
github.com/KingCrunch
Kumar Saurabh Sinha
2014-04-29 12:46:14 UTC
Permalink
Difference between Language Construct & Functions:

*Language Constructs*
Constructs are elements that are built-into the language and, therefore,
follow special
rules. 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:

echo 10;print (10);

Another very important construct is die(), which is itself an alias of
exit(). It allows
you to terminate the script’s output and either output a string or return a
numeric
status to the process that called the script.

Thanks & Regards

*Kumar Saurabh Sinha*
+91-9971047719 | +91-8595436700
Post by Robert Cummings
Post by Robert Cummings
Post by Robert Cummings
They should push the use of echo over print since it's a language
construct and not a function thus it benefits from no function overhead.
Cheers,
Rob.
I'd like to retract this comment :) Apparent print is not a function.
Didn't it used to be?
Post by Robert Cummings
Cheers,
Rob.
--
Nope, you can't retract it. :-)
As for "print" being a function or construct, I dunno -- what's the difference?
Cheers,
tedd
_______________
tedd sperling
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Christoph Becker
2014-04-29 13:38:17 UTC
Permalink
Post by Kumar Saurabh Sinha
*Language Constructs*
Constructs are elements that are built-into the language and, therefore,
follow special
rules.
ACK.
Post by Kumar Saurabh Sinha
Perhaps the most common of them is the echo statement, which allows
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()
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).
--
Christoph M. Becker
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Robert Cummings
2014-04-29 13:52:04 UTC
Permalink
Post by Christoph Becker
Post by Kumar Saurabh Sinha
*Language Constructs*
Constructs are elements that are built-into the language and, therefore,
follow special
rules.
ACK.
Post by Kumar Saurabh Sinha
Perhaps the most common of them is the echo statement, which allows
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()
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.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Sebastian Krebs
2014-04-30 07:08:20 UTC
Permalink
Post by Kumar Saurabh Sinha
Post by Kumar Saurabh Sinha
*Language Constructs*
Constructs are elements that are built-into the language and, therefore,
follow special
rules.
ACK.
Post by Kumar Saurabh Sinha
Perhaps the most common of them is the echo statement, which
allows
Post by Kumar Saurabh Sinha
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
Post by Kumar Saurabh Sinha
print()
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).
like "require" and "include" has too.
Post by Kumar Saurabh Sinha
--
Christoph M. Becker
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
github.com/KingCrunch
Shawn McKenzie
2014-04-29 14:09:40 UTC
Permalink
Also, they cannot be called using variable functions. Notice however that
though echo doesn't return a value, print does.


On Tue, Apr 29, 2014 at 7:46 AM, Kumar Saurabh Sinha <
Post by Kumar Saurabh Sinha
*Language Constructs*
Constructs are elements that are built-into the language and, therefore,
follow special
rules. Perhaps the most common of them is the echo statement, which allows
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()
echo 10;print (10);
Another very important construct is die(), which is itself an alias of
exit(). It allows
you to terminate the script’s output and either output a string or return a
numeric
status to the process that called the script.
Thanks & Regards
*Kumar Saurabh Sinha*
+91-9971047719 | +91-8595436700
Post by Robert Cummings
Post by Robert Cummings
Post by Robert Cummings
They should push the use of echo over print since it's a language
construct and not a function thus it benefits from no function
overhead.
Post by Robert Cummings
Post by Robert Cummings
Post by Robert Cummings
Cheers,
Rob.
I'd like to retract this comment :) Apparent print is not a function.
Didn't it used to be?
Post by Robert Cummings
Cheers,
Rob.
--
Nope, you can't retract it. :-)
As for "print" being a function or construct, I dunno -- what's the difference?
Cheers,
tedd
_______________
tedd sperling
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Tiago Hori
2014-04-29 14:30:40 UTC
Permalink
I am glad you guys transformed a conversation that started with code babes PHP into something constructive! I learned a lot.

T.

Sent from my iPhone
Post by Shawn McKenzie
Also, they cannot be called using variable functions. Notice however that
though echo doesn't return a value, print does.
On Tue, Apr 29, 2014 at 7:46 AM, Kumar Saurabh Sinha <
Post by Kumar Saurabh Sinha
*Language Constructs*
Constructs are elements that are built-into the language and, therefore,
follow special
rules. Perhaps the most common of them is the echo statement, which allows
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()
echo 10;print (10);
Another very important construct is die(), which is itself an alias of
exit(). It allows
you to terminate the script’s output and either output a string or return a
numeric
status to the process that called the script.
Thanks & Regards
*Kumar Saurabh Sinha*
+91-9971047719 | +91-8595436700
Post by Robert Cummings
Post by Robert Cummings
Post by Robert Cummings
They should push the use of echo over print since it's a language
construct and not a function thus it benefits from no function
overhead.
Post by Robert Cummings
Post by Robert Cummings
Post by Robert Cummings
Cheers,
Rob.
I'd like to retract this comment :) Apparent print is not a function.
Didn't it used to be?
Post by Robert Cummings
Cheers,
Rob.
--
Nope, you can't retract it. :-)
As for "print" being a function or construct, I dunno -- what's the difference?
Cheers,
tedd
_______________
tedd sperling
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Marc Guay
2014-04-29 14:32:10 UTC
Permalink
I can't help but wonder what Leia thinks of all this.
Post by Shawn McKenzie
Also, they cannot be called using variable functions. Notice however that
though echo doesn't return a value, print does.
On Tue, Apr 29, 2014 at 7:46 AM, Kumar Saurabh Sinha <
Post by Kumar Saurabh Sinha
*Language Constructs*
Constructs are elements that are built-into the language and, therefore,
follow special
rules. Perhaps the most common of them is the echo statement, which allows
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()
echo 10;print (10);
Another very important construct is die(), which is itself an alias of
exit(). It allows
you to terminate the script’s output and either output a string or return a
numeric
status to the process that called the script.
Thanks & Regards
*Kumar Saurabh Sinha*
+91-9971047719 | +91-8595436700
Post by Robert Cummings
Post by Robert Cummings
Post by Robert Cummings
They should push the use of echo over print since it's a language
construct and not a function thus it benefits from no function
overhead.
Post by Robert Cummings
Post by Robert Cummings
Post by Robert Cummings
Cheers,
Rob.
I'd like to retract this comment :) Apparent print is not a function.
Didn't it used to be?
Post by Robert Cummings
Cheers,
Rob.
--
Nope, you can't retract it. :-)
As for "print" being a function or construct, I dunno -- what's the difference?
Cheers,
tedd
_______________
tedd sperling
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Robert Cummings
2014-04-29 14:41:42 UTC
Permalink
Send me her number and I'll ask ;)
Post by Marc Guay
I can't help but wonder what Leia thinks of all this.
Post by Shawn McKenzie
Also, they cannot be called using variable functions. Notice however that
though echo doesn't return a value, print does.
On Tue, Apr 29, 2014 at 7:46 AM, Kumar Saurabh Sinha <
Post by Kumar Saurabh Sinha
*Language Constructs*
Constructs are elements that are built-into the language and, therefore,
follow special
rules. Perhaps the most common of them is the echo statement, which allows
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()
echo 10;print (10);
Another very important construct is die(), which is itself an alias of
exit(). It allows
you to terminate the script’s output and either output a string or return a
numeric
status to the process that called the script.
Thanks & Regards
*Kumar Saurabh Sinha*
+91-9971047719 | +91-8595436700
Post by Robert Cummings
Post by Robert Cummings
Post by Robert Cummings
They should push the use of echo over print since it's a language
construct and not a function thus it benefits from no function
overhead.
Post by Robert Cummings
Post by Robert Cummings
Post by Robert Cummings
Cheers,
Rob.
I'd like to retract this comment :) Apparent print is not a function.
Didn't it used to be?
Post by Robert Cummings
Cheers,
Rob.
--
Nope, you can't retract it. :-)
As for "print" being a function or construct, I dunno -- what's the difference?
Cheers,
tedd
_______________
tedd sperling
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
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.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Shawn McKenzie
2014-04-29 14:04:37 UTC
Permalink
You are not required to use parentheses with its argument list.
Post by Robert Cummings
Post by Robert Cummings
Post by Robert Cummings
They should push the use of echo over print since it's a language
construct and not a function thus it benefits from no function overhead.
Cheers,
Rob.
I'd like to retract this comment :) Apparent print is not a function.
Didn't it used to be?
Post by Robert Cummings
Cheers,
Rob.
--
Nope, you can't retract it. :-)
As for "print" being a function or construct, I dunno -- what's the difference?
Cheers,
tedd
_______________
tedd sperling
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Loading...