Questions tagged [php-5.4]

PHP 5.4 is the successor to PHP 5.3. It was released on March 1, 2012. Use this tag for version-specific issues relating to specifically to PHP 5.4.

PHP 5.4 Changes:

  • Support for traits has been added.
  • Short array syntax has been added, e.g. $a = [1, 2, 3, 4]; or $a = ['one' => 1, 'two' => 2, 'three' => 3, 'four' => 4];.
  • Function array dereferencing has been added, e.g. foo()[0].
  • Closures now support $this.
  • <?= is now always available, regardless of the short_open_tag php.ini option.
  • Class member access on instantiation has been added, e.g. (new Foo)->bar().
  • Class::{expr}() syntax is now supported.
  • Binary number format has been added, e.g. 0b001001101.
  • Improved parse error messages and improved incompatible arguments warnings.
  • The session extension can now track the upload progress of files.
  • Built-in development web server in CLI mode.

See Migrating from PHP 5.3.x to PHP 5.4.x for more information.

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:
402 questions
-2
votes
1 answer

Sort an array multidimension by key php

I have this array : Array ( [26] => Array ( [total_auctions] => 1 [total_price] => 0 ) [24] => Array ( [total_auctions] => 0 [total_price] => 0 ) [25] => Array ( [total_auctions] =>…
Harea Costicla
  • 797
  • 3
  • 9
  • 20
-2
votes
1 answer

return multiple values from database

i am trying to echo two values from database and want to echo that value in separate places in html but when i call that function in html it gives me both value in the same place but i want that value in different places how to do that help…
Sheraz
  • 276
  • 1
  • 5
  • 20
-2
votes
3 answers

Which concepts of OOP are not available in PHP

I searched this alot on net, but unable to find the answer that many people ask in the interview questions or in general question when they talk about PHP.. Which concepts of OOP are not available in PHP? I have heard and read this many many time…
dev90
  • 7,187
  • 15
  • 80
  • 153
-2
votes
2 answers

ltrim function doesn't work as expected ? php

I am using ltrim function. I run this code : echo ltrim("looooooooooooooooooooooooongWord","long"); i expect to get this word : looooooooooooooooooooooooongWord but it prints Word. what's the problem ? Edit: I thought it remove the word long, but…
david
  • 3,310
  • 7
  • 36
  • 59
-2
votes
3 answers

php date month from full name to short name

I have this php script date('dS F Y', strtotime($dateVariable)) The result is this: 01st September 2014 but I need the result as this: 01st Sep 2014 in other words, I need not the full name of the month. is that possible please?
Anastasie Laurent
  • 877
  • 2
  • 14
  • 26
-2
votes
1 answer

How to get dates between given dates in php 5?

Can any one give me a solution for finding dates between given dates without using DATEINTERVAL function of php? i have tried so far: $event_start_on='2013-09-01 01:06:00'; $event_expire_on='2013-10-01 01:06:00'; $getdates=array(); …
anumavu
  • 13
  • 3
-3
votes
1 answer

Does PHP 5.4 supports oracle 12?

Does PHP 5.4 supports oracle 12c. Or is there any way that we can connect to oracle 12c by using an older version of oracle?
SSneha
  • 75
  • 10
-3
votes
4 answers

Logical operators in php

I dont't understand this. If $_GET['action'] is set and action is not "login" or not "messages" I want to doAction(). My non working code: if ( isset($_GET['action']) && ($_GET['action'] !== "login" || $_GET['action'] !== "messages") ) { …
TheG
  • 19
  • 3
-3
votes
2 answers

Nested Class in PHP- Not able to define the type of a class as another class

I have to define the type of a property of my class say Bb as another class Attach. I tried writing it as below-
piyush
  • 976
  • 4
  • 13
  • 28
-4
votes
1 answer

What is the last stable version of php 5.4

Im currently working on php 5.3.13, and im thinking to upgrade my system for woocommerce im wondering what is the stable version in php 5.4? Is it 5.4.44?
AyDee
  • 201
  • 1
  • 5
  • 13
-4
votes
3 answers

PHP 5.4 - Variable defined by string and it's value set to NULL is not defined

Can anyone tell my why the variable defined by string does not exists? $string = 'variable'; ${$string} = NULL; echo $variable; Variable $variable is not defined.
Jazi
  • 6,569
  • 13
  • 60
  • 92
-4
votes
2 answers

Get the city by ip adrresse in php

I have a biig problem with get the city by ip addresse in php, the code work yersteday but now I got an error: Limit Exceed, my code: public function getCityAndCountryByIp($ip){ //get the city $tags =…
Menfis Menfis
  • 63
  • 1
  • 3
  • 11
1 2 3
26
27