Questions tagged [php-5.3]

PHP 5.3 (now past End of Life) is the successor to PHP 5.2. It was released on June 30, 2009. Use this tag for version-specific issues relating to specifically to PHP 5.3.

The last version of PHP 5.3 was 5.3.29, which was released on 14-Aug-2014. This version has reached its end of life and will no longer receive any updates.

PHP 5.3 caused many headaches for legacy software as a number of mechanisms PHP had relied on were deprecated (most notably register_globals and safe_mode). Many string search related functions were deprecated too, such as split() and ereg(). Much code written before PHP 5 (and some during) makes use of both these, and therefore a lot of older code base needed updating.

See https://php.net/manual/en/migration53.deprecated.php for a full list.

Information

  • If you want to talk about PHP or if you have a question, you can come to Chat Room 11: PHP.
  • For global question on PHP, please use the generic tag:
1291 questions
224
votes
6 answers

How to fix error with xml2-config not found when installing PHP from sources?

When I try to install php 5.3 stable from source on Ubuntu (downloading compressed installation file from http://www.php.net/downloads.php) and I run ./configure I get this error: configure: error: xml2-config not found. Please check your libxml2…
TroodoN-Mike
  • 15,687
  • 15
  • 55
  • 78
201
votes
5 answers

What is the difference between self::$bar and static::$bar in PHP?

What is the difference between using self and static in the example below? class Foo { protected static $bar = 1234; public static function instance() { echo self::$bar; echo "\n"; echo static::$bar; …
cwd
  • 53,018
  • 53
  • 161
  • 198
95
votes
3 answers

What does 'P' stand for in the DateInterval format?

Consider the following example quoted from php manual for DateTime sub(new DateInterval('P10D')); echo $date->format('Y-m-d') . "\n"; ?> 'D' is for days, what does the 'P' stand for in that…
Shrinath
  • 7,888
  • 13
  • 48
  • 85
87
votes
3 answers

What is ?: in PHP 5.3?

Possible Duplicate: What are the PHP operators “?” and “:” called and what do they do? From http://twitto.org/
JasonDavis
  • 48,204
  • 100
  • 318
  • 537
50
votes
3 answers

curl posting with header application/x-www-form-urlencoded

$post_data="dispnumber=567567567&extension=6"; $url="http://xxxxxxxx.xxx/xx/xx"; I need to post this $post_data using cURL php with header application/x-www-form-urlencoded i am new for curl any one help this out.
Saravanan M P
  • 561
  • 1
  • 7
  • 12
45
votes
7 answers

How to fix the session_register() deprecated issue?

How to fix the session_register() deprecated problem in PHP 5.3
DEVOPS
  • 18,190
  • 34
  • 95
  • 118
37
votes
10 answers

PHP Composer behind http proxy

I use composer on a network where the only way to access the internet is using HTTP or socks proxy. I have http_proxy and https_proxy environment variables. When compose tries to access HTTPS URLs I get this: file could not be downloaded: failed to…
Robert Dolca
  • 750
  • 2
  • 8
  • 15
36
votes
1 answer

LogicException vs. RuntimeException

I was wondering if there was a rule saying when to use which Exception in PHP... When do I have to throw a LogicException and when a RuntimeException? For example when it comes to exceptions like PageNotFoundException, from which exception class…
Nedec
  • 836
  • 10
  • 15
36
votes
1 answer

Self Executing functions in PHP5.3?

I was trying to borrow some programing paradigms from JS to PHP (just for fun). Is there a way of doing: $a = (function(){ return 'a'; })(); I was thinking that with the combination of use this can be a nice way to hide variables JS style $a =…
AriehGlazer
  • 2,220
  • 8
  • 26
  • 29
24
votes
1 answer

2 php.ini files

I have found that: When I type the following on terminal: php -i | grep php.ini I get the output: The Loaded Configuration file is @ /etc/php5/cli/php.ini However, from phpinfo(), I get to see: The loaded ini file is @…
Hrishikesh Choudhari
  • 11,617
  • 18
  • 61
  • 74
22
votes
5 answers

About PHP underscore naming convention (as in "_method" or "_property")

This is a sort of general inquiry I've been wondering about. I've noticed a lot of this through other people's code, and never really knew the actual reason, just followed the trends, so here goes. How come some methods and properties are named with…
Swader
  • 11,387
  • 14
  • 50
  • 84
22
votes
5 answers

Is there any replacement for PHPDocumentor that supports PHP 5.3?

Some of the new PHP 5.3 features, including namespaces and anonymous functions, are not compatible with PHPDocumentor, even with the latest release. For example, it just raises an error when it encounters "a function with no name", i.e. a closure.…
Ignas R
  • 3,314
  • 2
  • 23
  • 27
20
votes
7 answers

Notice: Undefined property - how do I avoid that message in PHP?

Hello I am making this call: $parts = $structure->parts; Now $structure only has parts under special circumstances, so the call returns me null. Thats fine with me, I have a if($parts) {...} later in my code. Unfortunately after the code finished…
EOB
  • 2,975
  • 17
  • 43
  • 70
19
votes
1 answer

Parse error: syntax error, unexpected '[' with php 5.3

My script is working really fine on my xampp. Now I tried to upload it on the server, but it spat directly a Parse error: syntax error, unexpected '[' in my face. :( The line which its mocking about is this one: $item =…
Owl
  • 689
  • 5
  • 15
  • 29
17
votes
1 answer

PHP forward_static_call vs call_user_func

What is the difference between forward_static_call and call_user_func And the same question applies to forward_static_call_array and call_user_func_array
Petah
  • 45,477
  • 28
  • 157
  • 213
1
2 3
86 87