TODOS OS PASSOS
PARA A
CERTIFICAÇÃO PHP
WHO DOESN’T
WANT TO BE
CERTIFIED ?
CERTIFICATIONUNIVERSITY
GENERAL
PURPOSE
YOU GET EXACTLY
WHAT YOU WANT
STAY UP TO
DATE
LEARN WELL
KNOWN
TECHNOLOGIES
STUDY ON YOUR
TIME AT HOME
MUST BE
PRESENTIAL
DOES THE
MARKET CARE?
++;
++;
????????
WHAT SHOULD I
EXPECT?
+ =
PHP BASICS
$coração = 'Hello';
echo $coração;
class Cächaça
{
}
$cachaça = new Cächaça();
BITWISE
a bitwise operation operates on one or more
bit patterns or binary numerals at the level of
their individual bits.
It is a fast, primitive action directly supported
by the processor, and is used to manipulate
values for comparisons and calculations
& AND
| OR
^ XOR
>> RIGHT
<< LEFT
Bits that are set in
both $a AND $b
are set.
http://php.net/manual/en/language.operators.bitwise.php
& - AND
0 & 0 = 0
0 & 1 = 0
1 & 0 = 0
1 & 1 = 1
print (4 & 8);
Bits that are set in
either $a OR $b
are set.
http://php.net/manual/en/language.operators.bitwise.php
| - OR
0 | 0 = 0
0 | 1 = 1
1 | 0 = 1
1 | 1 = 1
print (2 | 7);
Bits that are set in
$a OR $b but not
BOTH are set.
http://php.net/manual/en/language.operators.bitwise.php
| - XOR
0 ^ 0 = 0
0 ^ 1 = 1
1 ^ 0 = 1
1 ^ 1 = 0
print (3 ^ 9);
128 64 32 16 8 4 2 1
1 1 1 1 1 1 1 1 255
128 64 32 16 8 4 2 1
0 0 0 0 0 1 0 0 4
0 0 0 0 1 0 0 0 8
print (4 & 8);
& - AND
128 64 32 16 8 4 2 1
0 0 0 0 0 0 1 0 2
0 0 0 0 0 1 1 1 7
print (2 | 7);
| - OR
128 64 32 16 8 4 2 1
0 0 0 0 0 0 1 1 3
0 0 0 0 1 0 0 1 9
print (3 ^ 9);
^ - XOR
& AND
| OR
^ XOR
>> RIGHT
<< LEFT
Shift the bits of $a
$b steps to the right
(each step means
"divide by two")
http://php.net/manual/en/language.operators.bitwise.php
bit leftmost / 2 ^ bit rightmost
>> - Shift right
print (4 >> 6);
4 / 2 ^ 6 = 0
Shift the bits of $a $b
steps to the left (each
step means "multiply
by two")
http://php.net/manual/en/language.operators.bitwise.php
bit leftmost * 2 ^ bit rightmost
<< - Shift left
print (7 << 9);
7 * 2 ^ 9 = 3584
Bits that are set in
$a are not set, and
vice versa.
http://php.net/manual/en/language.operators.bitwise.php
~ - Not
~x = -x -1
print (~9);
~9 = -9 -1 = -10
exit(253);
php execute.php
http://www.phpinternalsbook.com/
STREAMS
I/O
file_get_contents
fopen
!= ?
$context = stream_context_create([
'http' => [
'method' => 'GET'
]
]);
print file_get_contents(
'http://api.phpconference.com.br',
false,
$context
);
$context = stream_context_create([
'http' => [
'method' => 'POST',
'header' => 'Content-Type: application/x-www-form-urlencoded',
'content' => 'field=value'
]
]);
print file_get_contents(
'http://api.phpexperience2017.com.br',
false,
$context
);
fopen(
‘file.txt’, ‘r+’
);
fopen(
‘file://file.txt’, ‘r+’
);
!= ?
O.O.PObject . Oriented . Programming
LATE STATIC BINDING
X
SELF
class A {
public static function who() {
echo __CLASS__;
}
public static function test() {
self::who();
}
}
class B extends A {
public static function who() {
echo __CLASS__;
}
}
B::test();
class A {
public static function who() {
echo __CLASS__;
}
public static function test() {
static::who();
}
}
class B extends A {
public static function who() {
echo __CLASS__;
}
}
B::test();
OBJECT CLONING
class A {
public $name;
}
$a = new A();
$b = clone $a;
var_dump($a == $b);
class A {
public $name;
}
$a = new A();
$a->name = 'Ana';
$b = clone $a;
$b->name = 'Clark';
var_dump($a == $b);
class B {
public $lastName;
}
class A {
public $name;
public $lastName;
public function __construct()
{
$this->lastName = new B();
}
}
$a = new A();
$a->lastName->lastName = 'River';
$b = clone $a;
$b->lastName->lastName = 'Dom';
var_dump($a == $b);
ARRAY
sort();
rsort();
asort();
ksort();
krsort();
usort();
A
K
U
R
ASSOCIATIVE
KEY
USER
REVERSE
sort();
rsort();
asort();
ksort();
krsort();
usort();
array_diff_ukey
array_diff_uassoc
array_​intersect_​assoc
array_​intersect_​uassoc
array_​intersect_​ukey
DON’T
FORGET !
Todos os passos para a certificação PHP - PHPExperience2017
Todos os passos para a certificação PHP - PHPExperience2017

Todos os passos para a certificação PHP - PHPExperience2017