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
0
votes
1 answer

Installing PHP 5.4 on Ubuntu

So i need to install PHP 5.4 on ubuntu-16.04-server-amd64. Some other threads suggest sudo add-apt-repository ppa:ondrej/php5-oldstable sudo apt-get update sudo apt-get install -y php5 But these do not work as the error comes on update. Reading…
VIPC
  • 39
  • 2
  • 7
0
votes
1 answer

Php errors on ec2 server that doesn't appear on my old server

While moving my website from my old server to an ec2 micro instance I'm getting stack errors from php that didn't appear on my old server...I have checked my php version and it's the same on both (5.4.45). Looking at my the ec2 instance log I get…
0
votes
4 answers

Get the intersect of tables

I have a question. So I have this array : $a_list_id = array( 0 => 1234 1 => 739 3 => 538 ); And this array : $a_users = array( 0 => array( id => 15627, name => test ), 1 => array( id => 1234, …
user7424312
  • 137
  • 3
  • 10
0
votes
0 answers

PHP 5.4 array throwing syntax error

I have the following PHP method in a class: function pullMsg() { $msgOut = []; if (count($this->msgQin) > 0) { $msg = array_pop($this->msgQin); $msgArr = explode('::', msg); $msgOut['sender'] = msgArr[0]; …
Dick Kennedy
  • 153
  • 2
  • 13
0
votes
2 answers

Php 5.4 upgrade to 5.6 : GET variables issues

I created a little website from scratch with Mysql database, PHP Sessions etc... on my local WAMP with PHP 5.4. When uploading the website files to my online host - which is running PHP 5.6 - I have issues with all the GET variables, it seems to not…
Paolito75
  • 558
  • 1
  • 11
  • 33
0
votes
1 answer

Returning first x items from array : 3

Suppose I have this array : Array ( [0] => Array ( [id] => 100828698 [token] => 123 ) [1] => Array ( [id] => 100828698 [token] => fdsfsdfsd ) [2] => Array ( [id] => 100829014 …
Harea Costicla
  • 797
  • 3
  • 9
  • 20
0
votes
0 answers

update from php 5.4.x to 5.5.38 still can't use doctrine/common

My system is using ubuntu 12.10 and apache 2.2.22 and using doctrince 2.4. I updated my Php from 5.4.x to 5.5.38. But i still countered this error: Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) in…
Haruji Burke
  • 449
  • 1
  • 4
  • 17
0
votes
0 answers

When curl transfer large data the curl module, error "transfer closed with outstanding read data remaining"

Currently I have an issue to prepare fix it. The error: transfer closed with outstanding read data remaining context : php 5.4
Chauncery
  • 111
  • 2
  • 6
0
votes
1 answer

Refreshing the page i can't get the POST value

I have one form in that i select state and city after i click search button ,in test.php i got value but i refresh the test.php page means i am not getting that time,i am getting error like this Notice: Undefined index: state in…
Kani R
  • 193
  • 2
  • 14
0
votes
1 answer

How to interchange Key/Value in PHP?

I've an array in the following format. [records] => Array ( [7] => Array ( [available] => No ) [8] => Array ( [available] => No ) …
harry
  • 1,410
  • 3
  • 12
  • 31
0
votes
1 answer

Modifying / Adding extra stuff to PDO bindParam()?

does anyone know by any chance if there is a clean way (or any way at all) to change PDO's bindParam? We're implementing extra security measures for our websites (filters for inputs) and so far it seems that the best way to add it to every single…
vatnoise
  • 21
  • 4
0
votes
2 answers

string concatenation with constants

I have only PHP 5.4 available at my current hoster and I always get errors with class constants in my code. Apparently, it's not allowed to define array constants. I changed the constant to a static variable to make it work. Now I get this syntax…
user1563232
  • 361
  • 3
  • 17
0
votes
1 answer

PHP Fileinfo extension at php.ini does not exist, PHP 5.4

I searched alot on how to enable php_fileinfo extension, but here in my php.ini file and it doesn't contain any php_fileinfo thing, I'm using PHP 5.4 on a dedicated windows server. Should I add a extention = php_fileinfo.dll, will it work?
Akmal Arzhang
  • 357
  • 4
  • 14
0
votes
1 answer

How to show month ago in PHP

$logintime value 1 year finished means, it will showing 1 years ago, but suppose 2 months only finished means I want to show 2 months ago, but my code showing like 60 days ago, I don't know where I did mistake, remaining hour, minutes this are…
Mani M
  • 69
  • 1
  • 8
0
votes
1 answer

regexp or strcmp to take some word in string

I'm pretty new in php and come here from C++ so there is no stl library with their strings and so on. I'm looking for explodes and implodes, want to realize such a check like i have relative path or file name, and want to check is it contains some…
Vitaly Protasov
  • 161
  • 1
  • 10