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

Call an url to retrieve a list

I have a question. I need to get data from this url /wd/biling.php?get&id=1.I now that this url return the liste serialize. I tried to retrieve by using $data= file_get_contents('/wd/biling.php?get&id=1'); but I have the error : Failed to…
Harea Costicla
  • 797
  • 3
  • 9
  • 20
0
votes
0 answers

My PHP Build Working on XAMPP, but not on website

I've built a CMS in PHP and so far only ran it on my local server which is using XAMPP 3.2.2 at the moment. Everything worked fine until I uploaded it on my webserver (at Arvixe). Here I get the error on the index page. Parse error: syntax error,…
0
votes
1 answer

Direct access class member access with clone

As of PHP 5.4 we can use this kind of syntax: $oYesterday = (new \DateTime())->modify('-1 day'); So we don't have to create a temp variable. I was wondering why it doesn't work with clone, it leads to a parse error: $oDayBefore = (clone…
COil
  • 7,201
  • 2
  • 50
  • 98
0
votes
0 answers

Symfony2 slow page loads despite quick initialization/query/render time?

I'm working on a Symfony2 project that is experiencing a slow load time for one particular page. The page in question does run a pretty large query that includes 16 joins, and I was expecting that to be the culprit. And maybe it is, and I am just…
94638857
  • 111
  • 9
0
votes
3 answers

Make a PHP variable the value of a form Input

I want to make a PHP variable the value of a hidden form input. The form is inside of my PHP (I'm echoing the form), and nothing that I have tried works. Here's my code: echo '
Name:…
user5824608
  • 45
  • 2
  • 7
0
votes
1 answer

How to enable ZTS and install pthreads with php5.4 in centos 7?

I am using Centos7 with php version 5.4.45 but I m unable to configure pthread. Please help me out with some steps to install, configure and compile the pthread library. Thanks in advance.
Rohit
  • 1
  • 2
0
votes
3 answers

Generate a .csv file with php using foreach and while

I tried to generate a .csv file, but I get this file empty. So my code is : $fileName = 'Users_' . date('d-m-Y') . '.csv'; $fh = fopen($fileName, "w"); fputcsv($fh, array('EMAIL', 'NAME','SURNAME'), ";"); foreach ($aDataBases as $database) { …
Harea Costicla
  • 797
  • 3
  • 9
  • 20
0
votes
0 answers

php HTTP File Upload variables are not always readable

In PHP (Version 5.4.39-0+deb7u2) I upload files. This went smooth for about 3 years, until today. After hours of testing I noticed that the $_FILES['Filedata']['name'] array is not readable when: the filename is written by a Mac OSX system when the…
Joost
  • 418
  • 5
  • 17
0
votes
0 answers

PHP Warning: PHP Startup: Unable to load dynamic library ... Cannot allocate memory

I get this error after using simple commands like php -i or php -v. PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20100525/imagick.so' - libtiff.so.3: failed to map segment from shared…
Boy
  • 1,182
  • 2
  • 11
  • 28
0
votes
0 answers

ImageMagick ver-6.7.6 "-virtual-pixel transparent" is not working in my Live Server

I have stuck in a issue regarding imageMagick command - "-virtual-pixel transparent" is not working on my Live Server, while the version of imageMagick is 6.7.6 The same command is running on my local server where I am having ImageMagick version…
Amit Dwivedi
  • 313
  • 2
  • 12
0
votes
2 answers

PHP Warning: json_encode(): Invalid UTF-8 sequence in argument with GBP (£) pound symbol

Can anyone advise why I get the following error: PHP Warning: json_encode(): Invalid UTF-8 sequence in argument When json_encode'ing the following array (output to the Apache error log): Array\n(\n [currency] => GBP\n [currency_symbol] =>…
crmpicco
  • 16,605
  • 26
  • 134
  • 210
0
votes
1 answer

Providing remote worker directories on Gearman Manager

I am using GearmanManager to control my workers on gearman. I have got it working with workers on the same machine as gearman manager. However I would like to connect to workers on remote hosts. How can I do that?
kosta
  • 4,302
  • 10
  • 50
  • 104
0
votes
1 answer

Installing Gearman Manager on Amazon Linux

I have been trying gearman and it seems to be working very well. I would like to use GearmanManager to run my workers. Most of the other references I see have a install.sh script to install it. However this script doesnt seem to be present right…
kosta
  • 4,302
  • 10
  • 50
  • 104
0
votes
1 answer

symfony2.3 bad credentials in production mode OVH

i know the question is repeated but the scenario that i'm going to describe is (very) strange : register a new user update the profile reconnect but bad credentials the bundle works normally in dev mode, but stack in prod mode using…
Mirlo
  • 625
  • 9
  • 26
0
votes
1 answer

installing intl entension on php5.4.4

I am trying to install intl extension on php 5.4.4 having centos, I have a zip file which I downloaded from http://isolherbal.com/nha/playground_clone/webservices/test_webservices I downloaded version 3.0.0 But from here I do not know where to go…
Arpita
  • 1,386
  • 1
  • 15
  • 35