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
10
votes
5 answers

How can export mysql data in to xml using php

Below code is for export data from mysql table as xml file. I have tried several code but not getting the result. Please check and help me. Currently getting result…
Sarath TS
  • 2,432
  • 6
  • 32
  • 79
10
votes
1 answer

Peculiar Behaviour with PHP (5.3), static inheritance and references

I'm writing a library in PHP 5.3, the bulk of which is a class with several static properties that is extended from by subclasses to allow zero-conf for child classes. Anyway, here's a sample to illustrate the peculiarity I have found:
connec
  • 7,231
  • 3
  • 23
  • 26
9
votes
2 answers

How to convert Emojis to their respective HTML code entities in PHP 5.3?

I need to convert the Emojis (e.g. ) in strings to their respective HTML code entities (e.g. 😀) on a PHP 5.3 site. I need to do this so that user input gets properly stored in a legacy script MySQL Database to later display properly when…
ProgrammerGirl
  • 3,157
  • 7
  • 45
  • 82
9
votes
2 answers

Does the .user.ini file work for subdirectories?

Does the .user.ini file that controls folder specific PHP settings also descend into the subfolders? I was reading a few websites and they suggest that it does (albeit there is not alot of information about it), however I've found that if I run a…
Lock
  • 5,422
  • 14
  • 66
  • 113
9
votes
3 answers

PHP 5.3.10 vs PHP 5.5.3 syntax error unexpected '['

Is it possible that this PHP code line if ($this->greatestId()["num_rows"] > 0) works in PHP 5.5 and returns an error in 5.3?? PHP Parse error: syntax error, unexpected '[' in /var/www/app/AppDAO.php on line 43 How can I change it to work under…
dendini
  • 3,842
  • 9
  • 37
  • 74
9
votes
1 answer

Converting windows-1255 to UTF-8 in PHP 5

I have a page in my website which gets it's main content from an old mainframe. The content encoding from the mainframe is windows-1255 (Hebrew). My website's encoding is UTF-8. At first I used an iframe to display the received answer from the…
Itay Gal
  • 10,706
  • 6
  • 36
  • 75
9
votes
1 answer

PHP DOM: parsing a HTML list into an array?

I have the below HTML string, and I would like to turn it into an array. $string = ' 1 2 3 4 '; Here's my…
Run
  • 54,938
  • 169
  • 450
  • 748
8
votes
1 answer

Nonblocking sockets: Are messages queued?

As I understand, it is possible to create a nonblocking network socket in PHP 5.x. But what happens if a script sends several long messages using the same nonblocking socket as follow: socket_write($socket, $string1, $length); socket_write($socket,…
Mike
  • 1,992
  • 4
  • 31
  • 42
8
votes
2 answers

Magento collection - filter by several fields

Using Magentos collection models, how should I go about adding a query part/filter such as this: WHERE (main_table.x < 1 OR (main_table.x - main_table.y) >= 5) Update I'm now running this: $this->getSelect() ->where('main_table.x < 1') …
Vitamin
  • 1,526
  • 1
  • 13
  • 27
8
votes
1 answer

How to disable slash command syntax in Doxygen

I've run into a problem with PHP 5.3 namespacing and Doxygen comments. Example: /** * Sample Method * * @param string $output * @return \Project\Lib\Rest */ Doxygen gives me the following warnings: warning: Found unknown command…
St. John Johnson
  • 6,590
  • 7
  • 35
  • 56
8
votes
2 answers

PHP 5.3 can't find normalizer_normalize()

I am trying to use the normalizer_normalize() function introduced in PHP 5.3 (says the doc), however I can't use it: $ php -r 'echo normalizer_normalize("tést");' PHP Fatal error: Call to undefined function normalizer_normalize() in Command line…
Matthieu Napoli
  • 48,448
  • 45
  • 173
  • 261
8
votes
3 answers

DDD: how to keep a complex value object immutable?

I'd like to model an Address as a value object. As it is a good practice to make it immutable, I chose not to provide any setter, that might allow to modify it later. A common approach is to pass the data to the constructor; however, when the value…
BenMorel
  • 34,448
  • 50
  • 182
  • 322
8
votes
3 answers

Set PHP version in Netbeans 7 for non-project files

I'm editing a PHP file in Netbeans that is not part of a project. Although I have PHP 5.3 installed, Netbeans complains about my use of a lambda function: "Language feature not compatible with PHP version indicated in project settings". Is there a…
iftheshoefritz
  • 5,829
  • 2
  • 34
  • 41
8
votes
3 answers

PHP namespaces : \My\Namespace or My\Namespace?

My\Namespace \My\Namespace So, which one should I use, I see the php documentation uses mostly My\Namespace. But it is said that \My\Namespace is better, because non ambiguous, whereas My\Namespace could be resolved as…
Matthieu Napoli
  • 48,448
  • 45
  • 173
  • 261
8
votes
3 answers

PHP type hinting error?

I just got this Fatal Error Catchable fatal error: Argument 1 passed to File::__construct() must be an instance of integer, integer given, called in /home/radu/php_projects/audio_player/index.php on line 9 and defined in…
Michael
  • 4,786
  • 11
  • 45
  • 68
1 2
3
86 87