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

Checking if email exists in the database?

I have this function or method in my class, but it doesn't return number of rows when I insert an email into it. I have tested the mysql connection etc, they all are working. Also note that the email that I am passing through the method already…
Sokhrat Sikar
  • 175
  • 3
  • 4
  • 14
4
votes
1 answer

Magento - Implementing order limits based on custom criterias

I'd like to implement a global order limit on certain products. The point of this is that I want to enable backorders on certain products and define several date periods where there are limits to how many of these individual products that may be…
Vitamin
  • 1,526
  • 1
  • 13
  • 27
4
votes
1 answer

Which PHP 5.3 features and extensions are not compatible with stream wrappers?

I am in the process of migrating a lot of files in a large PHP application from local to remote storage. File operations are being transitioned using PHP stream wrappers as an intermediate solution so that we can easily change calls such as…
user1184088
  • 51
  • 1
  • 5
4
votes
1 answer

Why does this PHP method declaration not recognize the namespace of the type hint?

I'm trying to write a library based on Doctrine Extensions, which provides this interface: namespace Gedmo\Mapping; use Doctrine\Common\Persistence\Mapping\ClassMetadata; interface Driver { public function readExtendedMetadata(ClassMetadata…
Andrew Vit
  • 18,961
  • 6
  • 77
  • 84
4
votes
2 answers

static in php behaves strangly, can't accept functions

This code throws parse error, which I do not understand why. function t(){ return 'g'; } function l(){ static $b = t(); return $b; } l(); The question is, why?
Itay Moav -Malimovka
  • 52,579
  • 61
  • 190
  • 278
4
votes
3 answers

Return a method with variable list of arguments as reference in PHP

I'm trying to return a value from a method as a reference in PHP5.3. I may be going at this the completely wrong way, but I am bringing an older project up to speed with some of the newer 5.3+ features. Below is an example I whipped up to explain…
tamagokun
  • 83
  • 3
4
votes
4 answers

PHP numbers to words SPANISH!

Does anyone know of a free-licence PHP code that would convert numbers to words in spanish? It's needed for my work for generating bills so it needs to be accurate. My knowledge of spanish is practically non-existent, so it would probably be hard to…
jurchiks
  • 1,354
  • 4
  • 25
  • 55
4
votes
1 answer

Where to store translations in cloud applications?

I am currently building an application for an architecture running in the amazon cloud (some webservers w/ php5.3, load balancing, PostgreSQL). A key feature of my (PHP5) application is, that everything (on the frontend) has to be translatable into…
S38
  • 1,332
  • 1
  • 8
  • 4
4
votes
1 answer

Call anonymous function clousuring $this

i'm playing with PHP 5.3 anonymous functions, and try to emulate the prototype based objects like javascript: $obj = PrototypeObject::create(); $obj->word = "World"; $obj->prototype(array( 'say' => function ($ins) { echo "Hello…
Exos
  • 3,958
  • 2
  • 22
  • 30
4
votes
2 answers

why does PHP fopen + fwrite double document?

I am running PHP Version 5.3.4 with Apache/2.2.17 on Windows 7 Ultimate 32bit (IIS disabled). I been looking at the fopen modes and am well aware of what mode does what, but i can't wrap my finger around why the double posting to the txt file with a…
robx
  • 3,093
  • 2
  • 26
  • 29
4
votes
1 answer

Simple try/finally vs. try/catch

With a simple function such as: function hello( $var ) { try { // do something with $var which may or may not throw an exception return $var; } finally { return $var; } } Is there any difference in…
MonkeyZeus
  • 20,375
  • 4
  • 36
  • 77
4
votes
3 answers

unexpected cast to boolean?

Given this input: http://example.com/item.php?room=248&supply_id=18823, the following 2 blocks ought to produce the same result. Why don't they? What am I missing other than coffee? This block gives the expected values: if (isset($_GET['supply_id'])…
dnagirl
  • 20,196
  • 13
  • 80
  • 123
4
votes
1 answer

Create Time slot for booking

I want to create a time slot in which booking should be allowed from 10:00 AM till 07:00 PM. Condition: each service time 60 min & 0 min break. like This, 10:00 AM - 11:00 AM 11:00 AM - 12:00 AM 12:00 AM - 13:00 AM 13:00 AM - 14:00 PM Can you guys…
4
votes
3 answers

add a button to grid view in yii2

i'm a new yii2 developer ! i made a GridView and the code is shown below : $dataProvider, 'filterModel' => $searchModel, 'columns' => [ ['class'…
sass
  • 73
  • 1
  • 2
  • 8
4
votes
3 answers

How can I track user visit in my website?

How can I track user visit in my website?
learner
  • 2,099
  • 6
  • 23
  • 32