- If the file contains only php code, there is no need to add the final
?>
ending. - There is no need for ending semicolon if:
- it is the only line between php-tags
<?php echo "Hello" ?>
- it is the last line of the file before ending
?>
tag.
- it is the only line between php-tags
- echo is faster than print and latter returns value 1
<?php echo print "Hello"?>
returnsHello1
- $this refers to object, so you can't get it as a variable's name.
- Variables can be sign as reference—if value changes, you change too!
<?php $x = 3; $z=&$x; $x=1; echo $z ?>
returns1
Learning PHP The Right Way vol 1
Notes for myself from youtube tutorial Full PHP 8 Tutorial - Learn PHP The Right Way by Program With Gio.
Video nr 3: Basic PHP Syntax - PHP 8 Tutorial