Sans POO
array(4) {
["name"]=>
string(4) "John"
["age"]=>
int(35)
["gender"]=>
string(3) "man"
["size"]=>
int(182)
}
Salut, je m'appelle John
J'ai 35ans et je mesure 182cm.
Class BankAccount
On crée le compte de John avec un solde initial de 2000€
On crée le compte de Lisa avec un solde initial de 5000€
On crée le compte de Lucas avec un solde initial de 0€
object(BankAccount)#1 (7) {
["balance"]=>
int(2000)
["iban"]=>
NULL
["owner"]=>
string(4) "John"
["type"]=>
NULL
["bankName"]=>
NULL
["currency"]=>
string(3) "€"
["country"]=>
string(2) "FR"
}
object(BankAccount)#2 (7) {
["balance"]=>
int(5000)
["iban"]=>
NULL
["owner"]=>
string(4) "Lisa"
["type"]=>
NULL
["bankName"]=>
NULL
["currency"]=>
string(3) "€"
["country"]=>
string(2) "FR"
}
object(BankAccount)#3 (7) {
["balance"]=>
int(0)
["iban"]=>
NULL
["owner"]=>
string(5) "Lucas"
["type"]=>
NULL
["bankName"]=>
NULL
["currency"]=>
string(3) "€"
["country"]=>
string(2) "FR"
}
On crédite le compte de John de 4000€
La balance est désormais de 6000€
object(BankAccount)#1 (7) {
["balance"]=>
int(6000)
["iban"]=>
NULL
["owner"]=>
string(4) "John"
["type"]=>
NULL
["bankName"]=>
NULL
["currency"]=>
string(3) "€"
["country"]=>
string(2) "FR"
}
On crédite le compte de Lisa de 2000€
La balance est désormais de 7000€
object(BankAccount)#2 (7) {
["balance"]=>
int(7000)
["iban"]=>
NULL
["owner"]=>
string(4) "Lisa"
["type"]=>
NULL
["bankName"]=>
NULL
["currency"]=>
string(3) "€"
["country"]=>
string(2) "FR"
}
Class Person
object(Person)#4 (4) {
["name"]=>
string(4) "John"
["age"]=>
int(35)
["gender"]=>
string(3) "man"
["size"]=>
int(182)
}
Salut, je m'appelle John.
J'ai 35 ans et je mesure 182cm.
object(Person)#5 (4) {
["name"]=>
string(4) "Lisa"
["age"]=>
int(32)
["gender"]=>
string(5) "woman"
["size"]=>
int(170)
}
Salut, je m'appelle Lisa.
J'ai 32 ans et je mesure 170cm.
object(Person)#6 (4) {
["name"]=>
string(5) "Lucas"
["age"]=>
int(72)
["gender"]=>
string(3) "man"
["size"]=>
NULL
}
Salut, je m'appelle Lucas.
J'ai 72 ans.
#Securisé
object(BankAccountSecured)#7 (4) {
["balance":"BankAccountSecured":private]=>
float(1000)
["iban":"BankAccountSecured":private]=>
NULL
["swift":"BankAccountSecured":private]=>
string(0) ""
["overdraft":"BankAccountSecured":private]=>
float(-500)
}
Mon Iban est
Mon découvert autorisé est de -500€