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
2
votes
3 answers

Trying to install the GMP extension on Docker / php:5.3

I'm trying to test some PHP code on PHP 5.3 with the GMP extension installed. Here's my Dockerfile: FROM php:5.3 RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010 AA8E81B4331F7F50 9D6D8F6BC857C906 \ && apt-get update…
neubert
  • 15,947
  • 24
  • 120
  • 212
2
votes
2 answers

PHP namespace organisation, naming

I am facing the following problem : I have a namespace Exception\*, which contains several types of exceptions. I have a namespace Exception\User\*, which contains a specific kind of exceptions (Forbidden, LoggedOut...). Where do I put the User…
Matthieu Napoli
  • 48,448
  • 45
  • 173
  • 261
2
votes
4 answers

Using OR operator when defining property in class

I am making an abstract class to ease up handling of properties. Now I want to set some constant options to a property using the binary OR ( | ) operator. class VarType { // Variable types const MIXED = 0; const STRING =…
ANisus
  • 74,460
  • 29
  • 162
  • 158
2
votes
1 answer

Zend Optimizer is it work a try?

I have a server: Intel Processor: Intel® Xeon® X3450, 4x2x2.66 GHz RAM memory: 8GB ECC DDRIII The per day visitors: 100k unique 400k clicks Basically, 20 domains run from a single script. I do quite often update the script. Daily. I was…
Gajus
  • 69,002
  • 70
  • 275
  • 438
2
votes
1 answer

Dynamically Loading Namespaced Classes

I'm working on a Data Mapper framework for PHP that will use Namespaces and rely exclusively on PHP5.3. In order to allow others to use the framework and extend its inner components as needed, I'd like to support a form of dynamic autoloading that…
Noah Goodrich
  • 24,875
  • 14
  • 66
  • 96
2
votes
2 answers

PHP lambda functions and scope

The below function takes an array and checks to see if its keys and values match the specified datatypes. I seem to be having some problems with the internal lambda functions that were previously working. I'm running PHP v5.3.6. They last worked…
dnagirl
  • 20,196
  • 13
  • 80
  • 123
2
votes
2 answers

Can I bring back old __tostring() behaviour in PHP 5.3?

I've got to move a web site (custom-written (not by me), so just updating a CMS is not an option) to a PHP 5.3 server. The code complains:: Fatal error: Method cDate::__tostring() cannot take arguments in ...\lib.datetime.php on line 183 I've…
Ivan
  • 63,011
  • 101
  • 250
  • 382
2
votes
5 answers

parsing string into array {{navigation({"class": "navigation", "id": "navigation"})}} part 2

Let simplify the question: All I need is to explode() string by a comma between brackets. The problem is that elements selected by comma can have a comma in itself, thus simple exploding won't work. I am not asking how to decode JSON. The number of…
Gajus
  • 69,002
  • 70
  • 275
  • 438
2
votes
1 answer

Why is the last method with same name of the namespaced class not considered a constructor in PHP 5.3.3?

The history of PHP says that the older versions of PHP use the class name as a method for a constructor for the same class. The PHP 5.3.3 documentation says that: Methods with the same name as the last element of a namespaced class name will no…
user9058188
2
votes
3 answers

filter_var_array() multidimensional array

Any ideas why this does not work? $_POST = array('edit' => array('name' => 'test')); die(var_dump( filter_var_array($_POST, array( 'edit["name"]' => FILTER_SANITIZE_STRING, 'edit[name]' => FILTER_SANITIZE_STRING, )), …
Gajus
  • 69,002
  • 70
  • 275
  • 438
2
votes
2 answers

PHP: dynamically get name of a class that extends the current class

I have an abstract class and an extending class: abstract class MyAbstract { public function getName(){echo static::class;} } class MyExtends extends MyAbstract {} I would like to dynamically get the name of any extending class when getName()…
BeetleJuice
  • 39,516
  • 19
  • 105
  • 165
2
votes
2 answers

Need help with php5.3 static inheritance

Having a little trouble with this static 'inheritance' in php 5.3 I need to test if a static function exists in static class but I need to test it from inside a parent static class. I know in php 5.3 I can use the 'static' keyword to sort of…
Dmitri
  • 34,780
  • 9
  • 39
  • 55
2
votes
2 answers

PHP XMPP bot performance

Hey guys. I need to write xmpp bot which will be receiving and sending about 2000 messages per hour (24/7 work time) and working with MongoDB (select, update queries). Is it bad idea to write it on php? What about performance if i'll use php 5.3?
VitalyP
  • 1,867
  • 6
  • 22
  • 31
2
votes
1 answer

How to list all domains in forest?

In Active Directory Users And Computers it is easy to just select Find =>Entire Directory to search a username. If I don't feed this API (PHP AD LDAP 4.04) the correct account_suffix,base_dn,domain_controllers it will not return ANY information on…
Kellen Stuart
  • 7,775
  • 7
  • 59
  • 82
2
votes
1 answer

Why two level of break has been removed in PHP7.1 and what could be it's alternate solution?

I was migrating production code from PHP5.3 to PHP7.1, code had break 2; inside nested two level of while loop inside if condition, I got below error: PHP Fatal error: Cannot 'break' 2 levels Why two level of break has been removed in PHP7.1 and…
Ramratan Gupta
  • 1,056
  • 3
  • 17
  • 39