473,836 Members | 1,455 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 4526
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
1665
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
2930
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
7122
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
4304
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
2942
by: Rookie | last post by:
Is C an object oriented programming language?
100
5322
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
1805
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
5974
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
3042
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
1551
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
10859
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
10602
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,...
1
7795
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
6984
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5829
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4463
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
2
4023
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3116
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.