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
1
vote
3 answers

PHP File Upload Not Submitting

I'm having an issue with a file upload where it's not uploading. When uploading a 7mb video the $_FILES['video']['tmp_name'] is empty and when I upload a 15mb file the form doesn't actually "submit", really just refreshes. Here is my code to handle…
user1890328
  • 1,222
  • 1
  • 13
  • 21
1
vote
1 answer

if statement causes function not to run

I have the following statement in my class and within a function. Now when wrap this around an if statement the $this->setDayData(15, "test content = " .$list_day . "
"); doesn't work, but if i remove the if statement and just keep that in…
Brad Hazelnut
  • 1,603
  • 5
  • 21
  • 33
1
vote
0 answers

How to determine if a Closure is statically defined for Closure::bindTo

Ideally I would like to bind a statically declared closure to an object instance. But this has been asked and seems not to be possible? Failing that, I would like to determine if a closure is statically defined or not, to know if I can bindTo() or…
ChrisNY
  • 3,917
  • 4
  • 27
  • 31
1
vote
1 answer

Possible reasons for "mysql server has gone away" error (php 5.4, mysqlnd)

We recently upgraded one of our webservers from PHP 5.3 (Debian Squeeze package, using libmysqlclient and APC) to PHP 5.4 (Debian Wheezy, Dotdeb package, using mysqlnd, Opcache and APCu). After working fine for almost one day, we experienced "mysql…
ak2
  • 457
  • 1
  • 5
  • 17
1
vote
1 answer

PDF displayed as PHP page losing Signature Certificates

I have a workflow that requires a PDF to be opened in a new window (not save as) that needs to be downloadable with all of the properties on it (including Signature Certificates). If I host the PDF on the server, I can link to that and it does this…
Andrew
  • 4,443
  • 5
  • 33
  • 75
1
vote
1 answer

PHP errors : No display & No log

I checked which php.ini is used with phpinfo(), so I'm editing the right php config file. In that php.ini file (and in phpinfo() details) I have display_errors at On and error_reporting at E_ALL. BUT when I have a PHP error, most of the time I find…
Bonswouar
  • 1,521
  • 2
  • 17
  • 37
1
vote
1 answer

Cannot convert new database connection to older one

I need to convert this new database connectivity and retrive information from database to older fashion for my project. I have done the connection according to older fashion way PHP 4.0 but i need to use this PDO connectivity code to older database…
user3659737
  • 31
  • 1
  • 8
1
vote
1 answer

CakePHP 2.3 not compatible with PHP 5.3?

The Migration Guide 2.0 of CakePHP says that CakePHP 2.x supports PHP Version 5.2.8 and above. My Provider skips PHP 5.3 and supports only 5.4 and 5.5. With 5.4 and 5.5 my CakePHP Project doesn't run. :-( I thought my own code is not propper. But I…
FishWave
  • 308
  • 2
  • 16
1
vote
0 answers

Can not connect to FTP when php on remote server, but connects when php is on localhost

I am pretty new to php, just learning how to upload to server via ftp. I have a file for connecting to ftp, it displays no error when it is on my localhost, but when i upload the file onto the remote server, it gave me an error straight away that it…
Benyaman
  • 451
  • 2
  • 10
  • 25
1
vote
2 answers

What is difference between invoking method with reflection class and normal way in php

http://net.tutsplus.com/tutorials/php/reflection-in-php/ // Nettuts.php class Nettuts { function publishNextArticle($editor) { $editor->setNextArticle('135523'); $editor->publish(); // first call to publish() $reflector = new…
fdsgds
  • 129
  • 6
1
vote
1 answer

SQLite3 with php 5.4 no db file created

my problem it's quite simple. I'm trying to make a script for dump information from one table in firebird to another in SQLite. I'm able to do all the process but what I'm not able to do is to create a persistent sqlite database. I launch this…
reverendocabron
  • 189
  • 1
  • 10
1
vote
2 answers

Where to get php_memcached.dll file for wamp server

halo i am really confused in the installation of memcached on my windows system. and then on my php side i couldn't find any php_memcached.dll file for php5.4.16 version. after a long searching i found a file for here php_memcache.dll [not…
tradebel123
  • 435
  • 1
  • 5
  • 20
1
vote
1 answer

PHP split csv line into multidimensional array

I am looking for a way to split a csv line into the keys of a multidimensional php array a,b,c becomes $some_array['a']['b']['c'] = true; a,b,d,e becomes $some_array['a']['b']['d']['e'] = true;
Nick Maroulis
  • 486
  • 9
  • 28
1
vote
2 answers

Syntax error while using yield with PHP5.4

I was trying to get yield working and I copied and pasted the following code from http://php.net/manual/en/language.generators.syntax.php into an empty file and got the error Parse error: syntax error, unexpected '$i' (T_VARIABLE) in [FILENAME] I'm…
Derwent
  • 606
  • 1
  • 5
  • 13
1
vote
0 answers

PHP gethostbyaddr: does not return computer name from the live server?

I want to get the computer name that access a page. So this question has been asked. I tested on my localhast, $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']); echo $hostname; I get my computer name, such as, lau-pc But when I run this code on…
Run
  • 54,938
  • 169
  • 450
  • 748