Questions about PHP, a widely-used general-purpose scripting language that is especially suited for Web development.

learn more… | top users | synonyms

12
votes
9answers
8k views

When do I need to use a framework? [closed]

I am new to web programming and at this time I am learning about PHP. I would like to know when do I need to use a PHP framework such as CakePHP? What are things that this and other similar PHP ...
8
votes
3answers
1k views

what are the best tips for storing images in a database?

Is it appropriate to store the image files in the database? Or it would be better to store only the path of the file in the database, while keeping the file itself on the server? Are there any other ...
10
votes
4answers
917 views

When should I use mock objects?

I've read a lot of things about TDD but I still have doubts. For example, I have these class diagrams: It's a simple example, just to learn about TDD and mock objects. Which test should I write ...
41
votes
4answers
51k views

How can I test PHP skills in a interview? [closed]

My company needs to hire a PHP developer, but nobody has PHP knowledge in my company and we find difficult to test for PHP skills. If it were a C/Java developer I would ask him to write a quick ...
16
votes
8answers
3k views

What would you consider best practice workflow tools for web application (PHP) development? [closed]

I'm really hoping somebody with more experience can edit the question as per my examples of answers: using version control test driven development debugging code (xdebug for php) use of UML diagrams ...
3
votes
2answers
3k views

PHP Interview test. Any advice? [closed]

I am going to be doing a short PHP test/project (20-30 mins) at an interview very soon. The job is at a junior to mid-weight salary (although no specific knowledge level is in the job spec) at a media ...
34
votes
5answers
69k views

When to use PHP or ASP.NET? [closed]

I have worked extensively in developing web applications using PHP and ASP.NET, but one of the questions that I'm constantly asked by customers is whether to move forward with a php website or an ...
28
votes
7answers
17k views

Why is Zend Framework so complicated?

I am web developer and have experience of developing several web applications in PHP. I have an idea of developing a product for myself and decided to use a MVC based framework because I really like ...
26
votes
8answers
32k views

Which certification is the best for PHP? [closed]

What are the best PHP certifications according to the market requirements? Actually, I want to get the PHP certification which has the greatest demand. Also, I want to know more about the future of ...
41
votes
13answers
6k views

Is it considered bad practice to have PHP in your JavaScript

So many times on this site I see people trying to do things like this : <script type="text/javascript"> $(document).ready(function(){ $('<?php echo $divID ?>').click(funtion(){ ...
13
votes
4answers
16k views

Why did Facebook use C++ beside PHP?

What is the main reason that made Facebook need to use C++ beside PHP? I am wondering if I make a website with alot of vistors would I need to use C++ as well?
21
votes
9answers
9k views

Should I build my own CMS or rely on a pre-built one? [closed]

Related: As a beginning programmer, should I favor building my own libraries over using 3rd-party libraries? As an intermediate to advanced level PHP web-developer and a young one at that ...
24
votes
3answers
8k views

How to build completely modular web applications [closed]

In the coming months we're going to begin a project where we take a system we've built for a client (v1) and rebuild it from scratch. Our goal with v2 is to make it modular, so that this specific ...
7
votes
5answers
2k views

PHP, HTML, Javascript and writing good practices

I realized I have to write down a convention specification about HTML, JavaScript and PHP coding for me and my team. In web development, just like in C++, I'm definitely a fan of indentation and ...
15
votes
7answers
2k views

Is it possible to effectively develop PHP applications on Windows that will be deployed on servers running Linux?

Is it fine to code PHP on Windows and host it later on a server running Linux? Can there be any problems in the migration of such a project? I would think that there really can't be any problems, ...
7
votes
3answers
2k views

OOP oriented PHP app source code samples and advice

The day I have been dreading has arrived. I never felt OOP or good software design was important(I knew they were important, but I thought I could manage without them.). However having read otherwise ...
5
votes
3answers
522 views

How do I determine which language/framework is best for our web-based project?

I'm in the early stages of development for a web application that has three developers (myself included) working on it. The project is, at its core, a web-based database that will be used by around ...
3
votes
1answer
916 views

Is “PHP and MySQL Web Development, 4th ed.” an outdated book to learn from?

I want to get into web stuff, and thought of going with PHP+MySQL. I have experience in C#, C++, desktop graphics, but no web stuff besides HTML, CSS which I started learning 2 months ago. On SO ...
18
votes
5answers
7k views

What best practices should be employed in a PHP login script?

I am wanting to re-write my login scripts for clients websites to make them more secure. I want to know what best practices I can implement into this. Password protected control panels are in their ...
12
votes
5answers
7k views

Naming classes, methods, functions and variables

There are 3 important naming conventions: with_underscores PascalCased camelCased Other variants are not important because they are not commonly used. For variables it seems that the one with ...
5
votes
5answers
906 views

Which open-source license is right for my project?

I am trying to choose the right license for a project that I would like to release as open-source later this year but I am unsure as to what the most appropriate license would be. I was originally ...
37
votes
11answers
2k views

Why isn't protection against SQL injection a high priority?

On Stack Overflow, I see a lot of PHP code in questions and answers that have MySQL queries that are highly vulnerable to SQL injection attacks, despite basic workarounds being widely available for ...
10
votes
2answers
647 views

What is a good way to familiarize myself with PHP, coming from an ASP.NET background?

Currently, I'm very comfortable with building tools/web apps in an ASP.NET environment. I'm not really looking to leave tbh, as I really like C#, ASP.NET, MVC 3, Visual Studio, etc. However, right ...
10
votes
2answers
756 views

How can I use my coding skills for good?

By this autumn my two small websites should be generating around a total of $1200 a month with minimal/zero input which is enough to for me to live on comfortably enough. Rather than embark on ...
1
vote
3answers
382 views

Familiarizing with the Zend Framework in one week

You are conversant with the ZF? How would you go about getting familiar with it in one week? What would be your suggested schedule?
10
votes
4answers
2k views

In MVC, can/should basic data retrieval from the Model be done in the View?

Given the concept of 'skinny controllers, fat models' and the general acceptance that Views can directly call on Models when requiring data for output, should one consider handling the 'get and ...
8
votes
1answer
2k views

What is Zend's relationship with PHP?

What exactly is Zend's relationship to PHP? I don't mean the framework but the company itself. Are they the gatekeepers or guardians of sort? I've just been reading up on PHP, and other than ...
4
votes
4answers
1k views

When is it necessary to use ORM tools?

I was raised in a part of web developmentland where the creation of websites is mostly synonymous with Wordpress, FTP, Joomla, and procedural code, instead of things like TDD, A/B testing, Doctrine, ...
10
votes
3answers
2k views

Is the term 'Front-End' synonymous with 'Client-Side'? If so, is this always the case?

As a relatively new (self-taught) web developer, I've heard the terms front-end, client-side, back-end, and server-side quite often. To me, front-end and back-end were always synonymous with ...
9
votes
7answers
2k views

Joomla or development from scratch? [closed]

As someone who has very little experience in it, I would like to know what makes you think that Joomla can fulfill all you requirements?. What makes you choose it over development from scratch (or ...
7
votes
3answers
5k views

Going from PHP to Java

Having been programming in PHP for a year, I now want to start learning Java. I am in a Windows environment. I want to develop a GUI with Java that would query a MySQL database. I know I would use ...
3
votes
2answers
852 views

Why do ruby and python seem to have more community contribution than PHP? [closed]

In a recent blog post by Roy Osherove, it is pointed out that his switch from primarily .Net development to ruby development has seen a huge difference in community involvement and really enjoys it. ...
2
votes
3answers
2k views

OO PHP static keyword, should I use it?

I'm writing script for fb and I have 3 objects that I'll be using through all classes. I'm wondering if there is any advantage in using the static keyword except I don't have to create an instance ...
11
votes
4answers
730 views

Is it OK to introduce methods that are used only during unit tests?

Recently I was TDDing a factory method. The method was to create either a plain object, or an object wrapped in a decorator. The decorated object could be of one of several types all extending ...
9
votes
9answers
2k views

My university doesn't provide php courses because it is an “easy” programming language?

I've met a student from the computer science department and I discovered that they only teach java and aspx. I asked him why they didn't teach php since it is the top one programming language on the ...
7
votes
2answers
6k views

What is a Developer in Test?

I was recently talking with a recruiter who wants to put me at a company for a position of Developer in Test. He essentially made it sound like a position where you get to fiddle with new programming ...
4
votes
3answers
1k views

For a large website developed in PHP, is it necessary to have a framework? [closed]

I am wondering if it is necessary to have a framework or if it is a must-have if I plan to make a large website. Large website could mean a lot of things: in other words, multiple dynamic web pages ...
3
votes
6answers
684 views

When to use a API/Library and when to write your own?

I am working on a large website and having been thinking a lot about when I should be using a 3rd party API/Library and when I should be writing my own implementation from scratch. There is no Library ...
3
votes
4answers
2k views

PHP, structural or OOP based language? [closed]

I would like to discuss why is PHP called a structural language? what are the OO concepts that cannot be implemented using PHP?
0
votes
3answers
3k views

The best possible way to implement Business Rules in PHP

I'm planning to write an e-commerce app using PHP & MySQL with lots & lots of custom rules. Say for example, I want to have a rule like "Give Customer X, a 10% a discount for Product Y if he ...
9
votes
5answers
954 views

Advantages to Multiple Methods over Switch

I received a code review from a senior developer today asking "By the way, what is your objection to dispatching functions by way of a switch statement?" I have read in many places about how pumping ...
6
votes
3answers
433 views

Need for a framework [duplicate]

This is slightly different to most questions (trying to avoid duplicates) When would you consider not using a framework (i'm talking PHP here for websites) when does one choose pure html/css/jquery ...
3
votes
2answers
638 views

What are the different meanings of 'fixture'?

I have some difficulty understanding the concept of "fixture". I know what a test suite is, a test case, a test run, but what exactly is a "fixture"? A parameterized test case? It seems to me that ...
2
votes
1answer
95 views

What are possible/useful implementations when extending exceptions?

I have seen a lot of exceptions - custom or integrated in the language (PHP) itself that have no differences but their class name. When extending default exceptions to use within your own code, are ...
1
vote
3answers
286 views

Using static in PHP

I have a few functions in PHP that read data from functions in a class readUsername(int userId){ $reader = getReader(); return $reader->getname(userId); } readUserAddress(){ $reader = ...
1
vote
2answers
4k views

Can PHP be used for desktop application development?

I want to know whether it is possible to develop desktop applications using the PHP language. In my case, I have never developed one with it. If it possible, please give me referral link or detailed ...
-2
votes
2answers
235 views

Securing PHP source code from illegal copy [closed]

my IT boss asks what is the best way to secure the PHP source code against illegal copy of the code once it is deployed to clients. Is there a PHP compiler that will make the final codes unreadable? ...
8
votes
3answers
11k views

PHP web application architecture/design [closed]

I've been thrown head-first into a new job developing web applications in PHP. I'm by no means new to PHP, but I haven't developed large-scale applications before. I'm wondering how to structure my ...
28
votes
6answers
12k views

Should I choose Doctrine 2 or Propel 1.5/1.6, and why? [closed]

I'd like to hear from those who have used Doctrine 2 (or later) and Propel 1.5 (or later). Most comparisons between these two object relational mappers are based on old versions -- Doctrine 1 versus ...
32
votes
6answers
15k views

Why does Facebook convert PHP code to C++? [closed]

I read that Facebook started out in PHP, and then to gain speed, they now compile PHP as C++ code. If that's the case why don't they: Just program in c++? Surely there must be SOME errors/bugs when ...