473,608 Members | 2,592 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Object Oriented PHP

I am new to PHP, just one day new. But I am otherwise a seasoned
programmer on many other languages like C, VB 6, C#, VB.NET, Win32
platform and have some tiny bit experience in MFC, C++, Python.

All the tutorials I read so far about PHP contain procedural examples.
I haven't yet come accross a tutorial on the object oriented PHP. Could
someone point me to one?

Jun 17 '06 #1
73 4447
Not a tutorial, but an example:
http://www.w-p.dds.nl/tinyunit.htm

Water Cooler v2 wrote:
I am new to PHP, just one day new. But I am otherwise a seasoned
programmer on many other languages like C, VB 6, C#, VB.NET, Win32
platform and have some tiny bit experience in MFC, C++, Python.

All the tutorials I read so far about PHP contain procedural examples.
I haven't yet come accross a tutorial on the object oriented PHP. Could
someone point me to one?

Jun 17 '06 #2
I've seen the C++ scope resolution operator used in some place in PHP
code. I do not recall where I saw it.

What's that (::) for? Does it have the same use as in C++?

Jun 17 '06 #3
NC
Water Cooler v2 wrote:

All the tutorials I read so far about PHP contain procedural examples.
I haven't yet come accross a tutorial on the object oriented PHP. Could
someone point me to one?


Start with the Manual:

http://www.php.net/OOP
http://www.php.net/OOP5

Note that there are differences between PHP 4 and PHP 5 when it comes
to OO syntax.

Cheers,
NC

Jun 17 '06 #4
NC
Water Cooler v2 wrote:

What's that (::) for? Does it have the same use as in C++?


It's all in the Manual:

http://www.php.net/manual/en/keyword...ekudotayim.php
http://www.php.net/manual/en/languag...ekudotayim.php

Cheers,
NC

Jun 17 '06 #5
Thanks very much. :-)

Jun 17 '06 #6

Water Cooler v2 wrote:
Thanks very much. :-)


Here's an OO versus Procedural example of making a MySQLi connection

http://au.php.net/manual/en/function.mysqli-prepare.php

Jun 18 '06 #7
Water Cooler v2 wrote:
Thanks very much. :-)

You can olso read
http://www-128.ibm.com/developerwork...xw01DynamicPHP
http://www.onlamp.com/pub/a/php/2005...erloading.html
The thread "PHP Dynamic Database Code" started by jo******@gmail. com on
Fri, 9 Jun 2006 23:13:21 +0000 (UTC) (from which i have the above urls)
may also be interesting.

Once you have a reasonable understanding of the basics of OOP, you could
take a look at the examples/turorial of phpPeanuts, experiment with it
and dig into its code using the hypercode browsers to try to understand
how the framework works. It's very OO ;-)

Greetings,

Henk Verhoeven,
www.phpPeanuts.org.
Jun 23 '06 #8
NC
427SOHC wrote:

If I haven't worked with OOP much would PHP be a safe
starting point, or is there a better programming language
to start with?


If you haven't worked with OOP before, start by learning OOP in the
language you otherwise know well. Once you understand the basic
concepts (encapsulation, inheritance, polymorphism, etc.), you will be
able to ask intelligent questions about how those concepts are
implemented in other languages.

Also, note that PHP 4 and PHP 5 have different object models; the one
in PHP 5 is more in line with what you find in other languages, while
the one in PHP 4 is simpler, but more restrictive.

Cheers,
NC

Jun 24 '06 #9

"NC" <nc@iname.com > wrote in message
news:11******** **************@ b68g2000cwa.goo glegroups.com.. .
427SOHC wrote:

If I haven't worked with OOP much would PHP be a safe
starting point, or is there a better programming language
to start with?


If you haven't worked with OOP before, start by learning OOP in the
language you otherwise know well. Once you understand the basic
concepts (encapsulation, inheritance, polymorphism, etc.), you will be
able to ask intelligent questions about how those concepts are
implemented in other languages.

Also, note that PHP 4 and PHP 5 have different object models; the one
in PHP 5 is more in line with what you find in other languages, while
the one in PHP 4 is simpler, but more restrictive.


"More restrictive" is a point of view. It is possible to write OO code in
PHP 4 that also runs in PHP 5, as I have proved with my sample application
and later my full-blown framework.

AFAIAC the extra OO features in PHP 5 are nothing more than eye candy as
they do not provide any additional functionality which is worthy of merit.
They were only included to appease the OO purists.

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
Jun 24 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1640
by: Benjamin C. Pierce | last post by:
The Twelth International Workshop on Foundations of Object-Oriented Languges (FOOL 12) Saturday 15 January 2005 Long Beach, California, USA Following POPL 05 The search for sound principles for object-oriented languages has given rise to much work on the theory of programming languages during the past two decades, leading to a better understanding of the key
5
2915
by: Martin | last post by:
When was inheritance intruduced into object oriented programming? More generally, does anyone know or have any sources on when the different features were introduced into object oriented programming?
34
7061
by: yensao | last post by:
Hi, I have a hard time to understand difference and similarities between Relational database model and the Object-Oriented model. Can somebody help me with this? Thank you in advance. Yensao
65
4240
by: Roger Smythe | last post by:
A means for the progressive decomposition a problem space into increasingly simpler component parts such that these component parts represent higher levels of conceptual abstraction, and are completely independent of each other except for their well-defined interfaces. This was an attempt to explain the gist of OOP to programmers accustomed to the structured programming paradigm. I tried to explain OOP in terms of ideals that can be...
14
2924
by: Rookie | last post by:
Is C an object oriented programming language?
100
5217
by: E. Robert Tisdale | last post by:
What is an object? Where did this term come from? Does it have any relation to the objects in "object oriented programming"?
8
1786
by: cppig1995 | last post by:
C++ is not only object-oriented language. I think the description of this group have to be changed. :-) Have fun! ---- cppig1995 (cppig1995@gmail.com) Daejeon Metropolitan City, Republic of Korea 11 years old in Western age.
47
5914
by: Thierry Chappuis | last post by:
Hi, I'm interested in techniques used to program in an object-oriented way using the C ANSI language. I'm studying the GObject library and Laurent Deniau's OOPC framework published on his web site at http://ldeniau.web.cern.ch/ldeniau/html/oopc/oopc.html. The approach is very instructive. I know that I could do much of this stuff with e.g. C++, but the intellectual challenge of implementing these concepts with pure ANSI C is relevant to...
46
3003
by: ajba74 | last post by:
Hi fellows, I am reading some books to learn the C programming language, and sometimes I have the feeling that when somebody becomes a C expert, he must learn a more modern and object-oriented language. When I read things like "... C++ is an evolution of C ..." or "... C is a subset of C++ ..." I tend to believe that I will have to learn C+ + sooner or later. It sounds like C++ is the future and C is the past (and will be no longer...
3
1536
by: notnorwegian | last post by:
i have some confusion over this. sure a class is basically a classification, like for example an animal or flower. and an object/instance of that class is then for example a cat. an object is an instance of a class. that i know, i also know how to program with classes etc. i am just confused about the term object-oriented.
0
8057
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8491
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8142
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8329
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6813
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6010
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4022
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2472
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1580
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.