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

PHPUnit Mock of MongoCollection class creating a _PHP_Incomplete_Class object

Today I came back to a project I have not touched for a while. It is a Zend Framework 2 project using MongoDB as its database. I decided since it had been a while to update MongoDB to the latest version (2.4) from (2.0), and the driver to the latest…
Etzeitet
  • 1,995
  • 2
  • 18
  • 22
0
votes
1 answer

What are the performance related issues of PHP curl

My client wants to extract the html content of a live webpage and make a copy of the html page in his server. I am thinking of using curl and is there any performance issue linked when I am intending to use curl? Will it use a lot of server…
madi
  • 5,612
  • 5
  • 36
  • 48
0
votes
3 answers

Basic PHP syntax or config?; script doesn't execute on WAMP server

I am trying to write a simple PHP script: A user visits a webpage and registers their email address and a password via a form (no other iinputs required). Their email and password are stored in a database and a random unique 6 digit pin is…
alias51
  • 8,178
  • 22
  • 94
  • 166
0
votes
1 answer

Including GET parameter in routes and frame .html page

I have a form which submits data over as GET Which means, when I do: echo $this->Form->create('Search', array('type'=>'get', 'url'=> array('controller'=>'searches','action'=>'results'))); echo '
Keval Domadia
  • 4,768
  • 1
  • 37
  • 64
0
votes
1 answer

Closure with parameter inside array

I have problem with closure in PHP 5.4 I have array public function check(){ return ['int'=>['filter'=>2], 'min'=>function($val){ return ['int'=>2,'min'=>$val]; } ] } When I use (new Obj())->check()['int']; it works. But I don't know how use min…
110precent
  • 322
  • 4
  • 19
0
votes
1 answer

PHP script does not recognise absent variable

I am writing a little script to upload products from a csv file to my website. I have been having an issue where my if($result) echo "hi"; does echo when the $result is present, but if i put if(!result) or if(empty($result) or if(!isset(result))…
Melbourne2991
  • 11,707
  • 12
  • 44
  • 82
0
votes
1 answer

Debugging Zend project

I have transferred a working zend project to another server. It is a main domain and everything is set up correctly (I think). Header and footer are working good but in the middle content area it displays error messages. Server IP:…
Vasanthan.R.P
  • 1,277
  • 1
  • 19
  • 46
0
votes
1 answer

Typo3 6.0: Install Tool Error Message

In conjunction with the failed installation of an extension (yag), the install tool is no longer available with the following error message: PHP Fatal error: Class '\\tx_install_session' not found in…
Jens Piegsa
  • 7,399
  • 5
  • 58
  • 106
0
votes
1 answer

How to define a general method / catch it all method for an object?

On the same concept for object members, I can define generic __get and __set. How do I do the same for methods? class a{ public method __general(){ } public function b(){} } $r= new a(); $r->b(); //will use existing…
Itay Moav -Malimovka
  • 52,579
  • 61
  • 190
  • 278
0
votes
2 answers

PDO Performance issue

I am using XAMPP running php 5.3 and mysql version 5.5.27 to develop with on my local machine. For a long time I have noticed that page load times where hitting the 2-3 second mark but asumed that as I was using a remote MySQL database to connect to…
carbontwelve
  • 1,090
  • 1
  • 13
  • 24
0
votes
2 answers

xampp 1.8.1, php 5.4 it doesn't want to include/require a file

I have path like this : "C:/xampp/htdocs/root/my-test/defined-values.php" that I want to include like this in my index.php if (is_readable($path)) { require($path); } and it just simple, it doesn't work. I have die('test') at the top of…
user147
  • 1,312
  • 5
  • 22
  • 41
0
votes
2 answers

Getting Upload file in PHP $_REQUEST

I am receiving uploaded file in PHP $_REQUEST Super global , as per my knowledge $_FILES contains all the information of uploaded file and $_REQUEST contains $_POST,$_GET,$_COOKIES. Also I am getting an empty $_FILES array for same request. In PHP…
Ekky
  • 792
  • 4
  • 14
  • 29
0
votes
0 answers

PHP 5 without Suhosin

I'm planning an upgrade from Debian 6 (Squeeze) to 7 (Wheezy), which brings along php 5.4 and omits Suhosin. Rightly or wrongly, Suhosin gives me a sense of security, because it lets me know about (some) hack attempts. e.g. I notice that my site…
artfulrobot
  • 20,637
  • 11
  • 55
  • 81
0
votes
1 answer

php array to sqlite3 DB

*I'm trying to put a local array values $productname into a sqlite3 table , the array looks like this: [0] usb 16gb [1] monitor 16" [2] dual batteries [3] multi blender pro and so on* // Prepare INSERT statement into sqlite3 $insert = "INSERT…
user2436729
  • 37
  • 2
  • 6
0
votes
1 answer

Connecting to MS SQL Server in PHP

I'm running a WAMP stack and and trying to connect to an SQL Server instance with PHP's PDO. I've downloaded the PHP drivers for MS SQL from here and added **php_pdo_sqlsrv_54_ts.dll** into PHP's extension folder. Then added…
Rich Jenks
  • 1,723
  • 5
  • 19
  • 32