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

Is it possible to put a phar into a phar?

first things first: my Phars do run. I'm playing around a little bit and I have the following scenario: a Phar for the application (nothing irregular with it) (application-phar) a second phar, for example for a library. (lib-phar) I'd like to put…
pscheit
  • 2,882
  • 27
  • 29
5
votes
3 answers

php include causes unwanted newline

(PHP 5.3.6) I have a php file which contains simply this text - there are no php tags, no trailing newline or extraneous whitespace anywhere:
abc
Now including this from another php file as follows (again,…
iforce2d
  • 8,194
  • 3
  • 29
  • 40
5
votes
4 answers

php super super globals

I was wondering, I have this big array, is it possible to have it only once in memory rather then once per thread? Take the tags here at stackoverflow as example. They barely ever change, why not have a single memory spot for them? And maybe even…
RoboTamer
  • 3,474
  • 2
  • 39
  • 43
5
votes
1 answer

DI container for an object that contains an object that has injected dependency

Using pimple as my DI container, I have been bravely refactoring small classes to rely on DI injection, eliminating the hard-coded dependencies I could see would be easily removed. My methodology for this task is very simple, but I have no clue if…
Stephane Gosselin
  • 9,030
  • 5
  • 42
  • 65
5
votes
4 answers

How do I remove text from the console in PHP?

My goal is to print an updating progress percentage to the console (in both Linux and Windows). Currently I just print out the percentage each 10%, but I would prefer that it updated itself every 1% without filling the screen with percentages. Is it…
Hubro
  • 56,214
  • 69
  • 228
  • 381
5
votes
2 answers

Can I set a time limit for a code block?

Is it possible to start a block of code (maybe just call a function) and if it doesn't execute within a certain time skip it. //give this function 10 seconds to execute $value = mega_function();// could take anything from 1-1000 seconds //if 10…
Moak
  • 12,596
  • 27
  • 111
  • 166
5
votes
2 answers

Is @package required with PHP 5.3 namespaces?

I've switched to PHP 5.3 and the namespaces. It seems like the @package tag is redundant and useless now. Is it still required by phpDoc, or can I ignore this tag now ? Thanks
Matthieu Napoli
  • 48,448
  • 45
  • 173
  • 261
5
votes
1 answer

Synonym Search Using Sphinx

Has somebody written a morphology engine for synonyms on sphinx. Or is the best bet still to create a word forms dictionary which declares all my synonyms. Also how will this affecting stemming. In the documentation it states: stemming is not…
Logan Bailey
  • 7,039
  • 7
  • 36
  • 44
5
votes
2 answers

Is there any compiler/interpreter to execute code for php 5.3?

Is there any online complier/interpreter to execute code for php 5.3? like there is one for php http://codepad.org/ But it does not support php 5.3 features. Can any one help, in this?
Poonam Bhatt
  • 10,154
  • 16
  • 53
  • 72
5
votes
1 answer

Is there transaction support in the new SQLite3 PHP Class?

I found that there is a new SQLite3 class (as of PHP 5.3.3) and started using it in my latest project. http://www.php.net/manual/en/book.sqlite3.php All was well till I needed transactions. Have I overlooked something in the documentation? How could…
user137621
5
votes
5 answers

Using PHP 5.3 ?: operator

With this test page: $page = (int) $_GET['page'] ?: '1'; echo $page; I don't understand the output I'm getting when page is undefined: Request Result ?page=2 2 ?page=3 3 ?page= 1 ? error: Undefined index page Why the error…
Isis
  • 4,608
  • 12
  • 39
  • 61
5
votes
1 answer

Non-deterministic object reference bug in PHP 5.3.X

As of yesterday (perhaps after a recent PHP update?), I'm getting some very strange non-deterministic bugs in php 5.3.3. These appear in our production server in PHP 5.3.2 as well. The errors essentially amount to Fatal error: Uncaught exception…
Karan
  • 1,636
  • 4
  • 19
  • 35
5
votes
3 answers

Function not working on server. Can't use function return value in write context

I'm using this function to check if certain products are in the cart on my woocommerce. This works on my localhost but is giving me a: Can't use function return value in write context on server. function product_is_in_the_cart() { $ids = array(…
MidouCloud
  • 403
  • 1
  • 7
  • 20
5
votes
3 answers

How should I hash passwords in CodeIgniter

I started to use Codeigniter framework and in their new release doc's they say DO NOT use this or any other encryption library for user password storage! Passwords must be hashed instead, and you should do that via PHP’s own Password Hashing…
AAron
  • 368
  • 1
  • 2
  • 11
5
votes
2 answers

How to close window after alertbox get closed inside php

I need to close the window after alertbox, I used the codes which was asked in Stack Question But my alert box is inside a php code, I am getting the alert box but once i close it the window is not getting closed, I am new to php . The codes are…
Zain
  • 285
  • 2
  • 7
  • 23