Please enable JavaScript.
Coggle requires JavaScript to display documents.
PHP 7.4 - Coggle Diagram
PHP 7.4
Interview Question
can you extend final defined class?
final public function moreTesting() {}
final class/method
prevent overriding
child class
method
Error Types
Notices
simple
non-critical errors
script executing
accessing undefined variable
Warning
more important to Notices
[ie.]include() - not exist
Fatal
causes termination
i.e. - accesing property of non-existent obj
require - non-existent filw
_construct()
all objects has this built-in method
called immediately after object is being created
initialize class property
destructor
takes no paramter
Enable error reporting
php.ini - display_errors = on
ini_set('display_errors',1)
error_reporting(E_ALL)
ways to redirect a php page
redirect(url)
header("Location:url")
js
window.location.href = '';
PHP version
changes
:red_flag:
How to submit w/o submit button
[JS] document.form.submit()
LAMP
open-source
ob_start :red_flag:
$_SERVER["REMOTE_ADDR"]
OOP
Class VS interface
inteface - dont contait business logic
method signature
defined templte for implementing class
single inheritance only
class can be extended from one single class
about
server-side scripting language
basic
variable
value placeholder, change overtime
begin $
constant
cannot change value overtime
define("MONTHS", 12);
comments
single // and #
multi-line : /**/
8 data types
5 simple types
integers ($myInt = 45)
whole num
no fractional part
-10 or 132
bases
base 10 - decimal
5235
-823
base 2 - binary
01011001
base 8 - octal
0123
base 16 - hexadecimal
0x2A
floating points ($myFloat = 3.1415)
simple decimal - 2.34
scientific notation - 7.2e6
boolean ($myBoolan = TRUE)
non-zero integer = TRUE
empty string or "0" = false
NULL = FALSE
NULL ($myNull = NULL)
no value
NULL = FALSE
string ($myString = "Hello")
series of character
''
""
2 compound type
array ($myArr = array("PHP", "rocks");)
objects ($myObj = new Myclass;)
Special type
Resources (mysql_connect("a", "b", "c"))
contents
text
images
other file type
interact database
web language based on script
dynamically create
generated web page
history
means:
PHP: Hypertext Preproccesor
resembled
Perl
C
MISC
PEAR
PHP Extension and Application Repository
extends PHP
provides a higher level of programming for web dev
coding
how
execute from command line
specify file name
sample
php script.php
used PHP CLI
run interactive PHP shell from CLI
php -a