The document is a presentation on PHP classes and object-oriented programming. It defines key concepts like classes, objects, methods, and attributes. It provides an example dog class with bark() and name attributes. It demonstrates how to define a class, create objects from a class, and call methods. The presentation also covers inheritance, class scope, constructors, and deleting objects. It discusses reasons for using object-oriented programming like code reuse and maintenance.
If you are new to programing in general OR if you started programing in php before Object-Oriented Programming was even available, this presentation is designed to help you get up to speed on Object-Oriented terminology and give you practical skills as well as resources to continue learning.
For beginners who want to go to the next level of OOP in PHP, we talk about magic methods, iterators, filters, some parts of the SPL, the subject/observer pattern and how you can build classes that have a lot of power and responsibility by implementing interfaces and then type-hinting and using just methods that are defined in the interface. Prefer composition over inheritance.
This is the third set of slightly updated slides from a Perl programming course that I held some years ago.
I want to share it with everyone looking for intransitive Perl-knowledge.
A table of content for all presentations can be found at i-can.eu.
The source code for the examples and the presentations in ODP format are on https://github.com/kberov/PerlProgrammingCourse
PHP 8.0 is expected to be released by the end of the year, so it’s time to take a first look at the next major version of PHP. Attributes, union types, and a just-in-time compiler are likely the flagship features of this release, but there are many more improvements to be excited about. As PHP 8.0 is a major version, this release also includes backwards-incompatible changes, many of which are centered around stricter error handling and more type safety.
This talk will discuss new features already implemented in PHP 8, backwards-compatibility breaks to watch out for, as well as some features that are still under discussion.
Perl, a cross-platform, open-source computer programming language used widely in the commercial and private computing sectors. Perl is a favourite among Web developers for its flexible, continually evolving text-processing and problem-solving capabilities.
PHP 8.1 brings Enums, one of the most requested features in PHP.
Enums, or Enumerations, allow creating strict and type-safe structures for fixed values. An Enum structure can hold a number of values that can also be backed with integer or string values.
In this comprehensive session, we will discover what Enums are, why they are useful, how to apply them on our applications, and things to watch out for when using Enums.
This PPT gives information about:
Advanced Theories
Inheriting Classes
Inheriting Constructors and Destructors
Overriding Methods
Access Control
Using the Scope Resolution Operator
Creating Static Members
Abstract Classes and Methods
If you are new to programing in general OR if you started programing in php before Object-Oriented Programming was even available, this presentation is designed to help you get up to speed on Object-Oriented terminology and give you practical skills as well as resources to continue learning.
For beginners who want to go to the next level of OOP in PHP, we talk about magic methods, iterators, filters, some parts of the SPL, the subject/observer pattern and how you can build classes that have a lot of power and responsibility by implementing interfaces and then type-hinting and using just methods that are defined in the interface. Prefer composition over inheritance.
This is the third set of slightly updated slides from a Perl programming course that I held some years ago.
I want to share it with everyone looking for intransitive Perl-knowledge.
A table of content for all presentations can be found at i-can.eu.
The source code for the examples and the presentations in ODP format are on https://github.com/kberov/PerlProgrammingCourse
PHP 8.0 is expected to be released by the end of the year, so it’s time to take a first look at the next major version of PHP. Attributes, union types, and a just-in-time compiler are likely the flagship features of this release, but there are many more improvements to be excited about. As PHP 8.0 is a major version, this release also includes backwards-incompatible changes, many of which are centered around stricter error handling and more type safety.
This talk will discuss new features already implemented in PHP 8, backwards-compatibility breaks to watch out for, as well as some features that are still under discussion.
Perl, a cross-platform, open-source computer programming language used widely in the commercial and private computing sectors. Perl is a favourite among Web developers for its flexible, continually evolving text-processing and problem-solving capabilities.
PHP 8.1 brings Enums, one of the most requested features in PHP.
Enums, or Enumerations, allow creating strict and type-safe structures for fixed values. An Enum structure can hold a number of values that can also be backed with integer or string values.
In this comprehensive session, we will discover what Enums are, why they are useful, how to apply them on our applications, and things to watch out for when using Enums.
This PPT gives information about:
Advanced Theories
Inheriting Classes
Inheriting Constructors and Destructors
Overriding Methods
Access Control
Using the Scope Resolution Operator
Creating Static Members
Abstract Classes and Methods
Workshop: WebSockets com HTML 5 & PHP - Gustavo CielloTchelinux
Neste workshop serão apresentadas algumas das novidades do HTML 5 através de exemplos. Logo após, será realizado o desenvolvimento de uma aplicação utilizando WebSockets e PHP.
4. Use the AM for posting within scientific collaboration networks (SCNs). For a detailed description of our policy on posting to SCNs, please see our Web Posting Guidelines (https://publishing.aip.org/authors/web-posting-guidelines).
5. Reprint the Version of Record (VOR) in print collections written by the Author, or in the Author’s thesis or dissertation. It is understood and agreed that the thesis or dissertation may be made available electronically on the university’s site or in its repository and that copies may be offered for sale on demand.
6. Reproduce copies of the VOR for courses taught by the Author or offered at the institution where the Author is employed, provided no fee is charged for access to the Work.
7. Use the VOR for internal training and noncommercial business purposes by the Author’s employer.
8. Use the VOR in oral presentations made by the Author, such as at conferences, meetings, seminars, etc., provided those receiving copies are informed that they may not further copy or distribute the Work.
9. Distribute the VOR to colleagues for noncommercial scholarly use, provided those receiving copies are informed that they may not further copy or distribute the Work.
10. Post the VOR to their personal web page or their employer’s web page 12 months after publication by AIP Publishing.
11. Deposit the VOR in an institutional or funder-designated repository 12 months after publication by AIP Publishing.
12. Update a prior posting with the VOR on a noncommercial server such as arXiv, 12 months after publication by AIP Publishing.
Author Warranties
Each Author and Copyright Owner represents and warrants to AIP Publishing the following:
1. The Work is the original independent creation of each Author and does not infringe any copyright or violate any other right of any third party.
2. The Work has not been previously published and is not being considered for publication elsewhere in any form, except as a preprint on a noncommercial server such as arXiv, or in a thesis or dissertation.
3. Written permission has been obtained for any material used from other sources and copies of the permission grants have been supplied to AIP Publishing to be included in the manuscript file.
4. All third-party material for which permission has been obtained has been properly credited within the manuscript.
5. In the event that the Author is subject to university open access policies or other institutional restrictions that conflict with any of the rights or provisions of this License, such Author has obtained the necessary waiver from his or her university or institution.
This License must be signed by the Author(s) and, in the case of a Work Made for Hire, also by the Copyright Owners. One Author/Copyright Owner may sign on behalf of all the contributors/owners only if they all have authorized the signing, approved of the License, and agreed to be bound by it. The signing Author and, in the case of a Work Made for Hire, the signing Copyright Owne
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
2. Reminder… a function
• Reusable piece of code.
• Has its own ‘local scope’.
function my_func($arg1,$arg2) {
<< function statements >>
}
PHP Workshop
2
3. Conceptually, what does a
function represent?
…give the function something (arguments), it does
something with them, and then returns a result…
Action or Method
PHP Workshop
3
4. What is a class?
Conceptually, a class represents an
object, with associated methods
and variables
PHP Workshop
4
5. Class Definition
<?php
class dog {
public $name;
public function bark() {
echo ‘Woof!’; An example class
definition for a dog.
}
The dog object has a
}
single attribute, the
name, and can
?>
perform the action of
barking.
PHP Workshop
5
6. Class Definition
<?php
Define the name
class dog {
of the class.
public $name;
public function bark() {
echo ‘Woof!’;
}
}
?>
PHP Workshop
6
7. Class Definition
<?php
class dog {
var $name
public $name;
public function bark() {
echo ‘Woof!’;
Define an object
}
attribute (variable),
}
the dog’s name.
?>
PHP Workshop
7
8. Define
Class Definition an
object action
<?php
(function), the
class dog {
dog’s bark.
public $name;
public function bark() {
function bark() {
echo ‘Woof!’;
echo ‘Woof!’;
}
}
?>
PHP Workshop
8
9. Class Definition
<?php
class dog {
public $name;
public function bark() {
echo ‘Woof!’;
}
End the class
}
definition
?>
PHP Workshop
9
10. Class Defintion
Similar to defining a function..
The definition does not do anything by
itself. It is a blueprint, or description, of an
object. To do something, you need to use
the class…
PHP Workshop
10
15. Class Usage
Use the name
<?php
variable of this
require(‘dog.class.php’);
instance in an
$puppy = new dog(); echo statement..
$puppy->name = ‘Rover’;
echo “{$puppy->name} says ”;
$puppy->bark();
?>
PHP Workshop
15
18. One dollar and one only…
$puppy->name = ‘Rover’;
The most common mistake is to use more
than one dollar sign when accessing
variables. The following means something
entirely different..
$puppy->$name = ‘Rover’;
PHP Workshop
18
19. Using attributes within the class..
• If you need to use the class variables
within any class actions, use the special
variable $this in the definition:
class dog {
public $name;
public function bark() {
echo $this->name.‘ says Woof!’;
}
}
PHP Workshop
19
20. Constructor methods
• A constructor method is a function that is
automatically executed when the class is
first instantiated.
• Create a constructor by including a
function within the class definition with the
__construct name.
• Remember.. if the constructor requires
arguments, they must be passed when it
is instantiated!
PHP Workshop
20
21. Constructor Example
<?php
class dog {
Constructor function
public $name;
public function __construct($nametext) {
$this->name = $nametext;
}
public function bark() {
echo ‘Woof!’;
}
}
?>
PHP Workshop
21
22. Constructor Example
<?php
…
$puppy = new dog(‘Rover’);
…
?>
Constructor arguments
are passed during the
instantiation of the object.
PHP Workshop
22
23. Class Scope
• Like functions, each instantiated object
has its own local scope.
e.g. if 2 different dog objects are
instantiated, $puppy1 and $puppy2, the
two dog names $puppy1->name and
$puppy2->name are entirely
independent..
PHP Workshop
23
24. Inheritance
• The real power of using classes is the
property of inheritance – creating a
hierarchy of interlinked classes.
dog
parent
children
poodle
PHP Workshop
alsatian
24
25. Inheritance
• The child classes ‘inherit’ all the methods
and variables of the parent class, and can
add extra ones of their own.
e.g. the child classes poodle inherits the
variable ‘name’ and method ‘bark’ from
the dog class, and can add extra ones…
PHP Workshop
25
26. Inheritance example
The American Kennel Club (AKC) recognizes three sizes of poodle - Standard,
Miniature, and Toy…
class poodle extends dog {
public $type;
public function set_type($height) {
if ($height<10) {
$this->type = ‘Toy’;
} elseif ($height>15) {
$this->type = ‘Standard’;
} else {
$this->type = ‘Miniature’;
}
}
}
PHP Workshop
26
27. Inheritance example
The American Kennel Club (AKC) recognizes three sizes of poodle - Standard,
Miniature, and Toy…
class poodle extends dog {
class poodle extends dog {
public $type
public function set_type($height) {
if ($height<10) {
$this->type = ‘Toy’;
} elseif ($height>15) {
$this->type = ‘Standard’;
} else {
$this->type = ‘Miniature’;
}
}
Note the use of the
extends keyword to
indicate that the
poodle class is a child
of the dog class…
}
PHP Workshop
27
28. Inheritance example
…
$puppy = new poodle(‘Oscar’);
$puppy->set_type(12); // 12 inches high!
echo “Poodle is called {$puppy->name}, ”;
echo “of type {$puppy->type}, saying “;
echo $puppy->bark();
…
PHP Workshop
28
29. …a poodle will always ‘Yip!’
• It is possible to over-ride a parent method with a new
method if it is given the same name in the child class..
class poodle extends dog {
…
public function bark() {
echo ‘Yip!’;
}
…
}
PHP Workshop
29
30. Child Constructors?
• If the child class possesses a constructor
function, it is executed and any parent
constructor is ignored.
• If the child class does not have a constructor,
the parent’s constructor is executed.
• If the child and parent does not have a
constructor, the grandparent constructor is
attempted…
• … etc.
PHP Workshop
30
31. Objects within Objects
• It is perfectly possible to include objects within another
object..
class dogtag {
public $words;
}
class dog {
public $name;
public $tag;
}
…
$puppy = new dog;
$puppy->name = “Rover";
$poppy->tag = new dogtag;
$poppy->tag->words = “blah”;
…
public function bark() {
echo "Woof!n";
}
PHP Workshop
31
32. Deleting objects
• So far our objects have not been
destroyed till the end of our scripts..
• Like variables, it is possible to explicitly
destroy an object using the unset()
function.
PHP Workshop
32
33. A copy, or not a copy..
• Entire objects can be passed as
arguments to functions, and can use all
methods/variables within the function.
• Remember however.. like functions the
object is COPIED when passed as an
argument unless you specify the argument
as a reference variable &$variable
PHP Workshop
33
34. Why Object Orientate?
Reason 1
Once you have your head round the concept of
objects, intuitively named object orientated code
becomes easy to understand.
e.g.
$order->display_basket();
$user->card[2]->pay($order);
$order->display_status();
PHP Workshop
34
35. Why Object Orientate?
Reason 2
Existing code becomes easier to maintain.
e.g. If you want to extend the capability of a
piece of code, you can merely edit the
class definitions…
PHP Workshop
35
36. Why Object Orientate?
Reason 3
New code becomes much quicker to write
once you have a suitable class library.
e.g. Need a new object..? Usually can
extend an existing object. A lot of high
quality code is distributed as classes (e.g.
http://pear.php.net).
PHP Workshop
36
37. There is a lot more…
• We have really only touched the edge of
object orientated programming…
http://www.php.net/manual/en/language.oop.php
• … but I don’t want to confuse you too
much!
PHP Workshop
37
38. PHP4 vs. PHP5
• OOP purists will tell you that the object
support in PHP4 is sketchy. They are
right, in that a lot of features are missing.
• PHP5 OOP system has had a big
redesign and is much better.
…but it is worth it to produce OOP
code in either PHP4 or PHP5…
PHP Workshop
38
Editor's Notes
Remind them about functions to start off with.. hopefully they all agree that they are useful.
Say we’ll talk more about the application of OBJECTS and object orientated programming later, for now we are going to learn in practice how to use the things..