Comments (15)
Dreamhost and Bluehost both support PHP 5.4. I'm not against bumping it.
from yii2.
In my opinion it's not very good to increase minimal required PHP version because of one short static helper method does not work. :-)
I have a quick and ugly but working solution of this issue—will try to polish it.
from yii2.
The issue is mainly about the constant SORT_FLAG_CASE
. We should NOT bump up minimal requirement of PHP because of this. We can add a new parameter $caseSensitive
(before $sortFlag
). This parameter should be used in the similar way as $ascending
.
from yii2.
Related issue (multibyte case-insensitive comparison): #26
from yii2.
@qiangxue, it's not the single issue. I've tested the following code under PHP 5.3.3:
$arr = array(
array(
'id'=>99,
'title'=>'test3',
),
array(
'id'=>100,
'title'=>'test2',
),
array(
'id'=>101,
'title'=>'test1',
),
);
ArrayHelper::multisort($arr, 'title');
And got:
Warning: Parameter 1 to array_multisort() expected to be a reference, value given in /home/resurtmkz/www/test/ArrayHelper.php on line 276
from yii2.
Does the unit test pass on your machine? What is line 276 on your side?
from yii2.
Does the unit test pass on your machine?
Unfortunately PEAR and PHPUnit are not installed on that machine at all. I'll try to run unit tests against 5.3.3 soon (during the next day).
What is line 276 on your side?
Yes, sorry. I've changed a bit ArrayHelper.php
file without modifying code behavior. My line 276 is:
call_user_func_array('array_multisort', $args);
from yii2.
I've tried to run unit tests on 5.3.11 and the error described above doesn't occur. This code works good as well.
Actually this is a bug in PHP itself:
- Open PHP change log: http://php.net/ChangeLog-5.php
- Find substring "Version 5.3.11".
- Find substring "Fixed bug #61273".
- https://bugs.php.net/bug.php?id=61273
I would like to propose raising minimal requirements to 5.3.11 (since it was fixed in 5.3.11).
from yii2.
Thanks for your investigation. I added this to #35
Let's make the final decision about the minimal version requirement later.
We may need to consider a workaround if we decide to use a version prior to 5.3.11.
from yii2.
I've just tried 5.3.24 and the error Use of undefined constant SORT_FLAG_CASE - assumed 'SORT_FLAG_CASE'
is there.
from yii2.
@qiangxue would you consider adding more methods to this object? Can we propose?
from yii2.
Yes, you can propose if these aren't duplicating standard PHP ones.
from yii2.
Thanks @samdark
from yii2.
Please help me,i use yii2 advanced,but i uploaded into server with php version 5.3,it is not working,i dont known ,because hositng is sharing,
from yii2.
you have to use PHP 5.4 or higher. Please do not comment on old issues. use the forum to ask further questions. Github is for bug tracking.
from yii2.
Related Issues (20)
- BaseActiveRecord save method behaviour HOT 1
- Setting YII_DEBUG=false in humhub 1.15.2 leads to internal server error HOT 2
- Memory usage leak when long operation HOT 6
- createControllerByID function add cache? HOT 14
- Relational queries populating invalid models when foreign key / linking value is 0 HOT 1
- request` failed for
- asDuration() produce wrong plural form when using russian locale HOT 2
- hasOne or hasMany return null when $link with two bigint element
- YII2 whether support reset-transaction? HOT 1
- PHP Deprecated: Calling session_set_save_handler() in `PHP 8.4`. HOT 4
- If the iframe is nested in another domain name, there is an exception in the Yii2 site at https://, where there is a jump from http:// HOT 3
- Invalid fatal error handling in php 8.3 HOT 11
- Does yii2 support connection pooling using redis? HOT 1
- Wrong `columnQuoteCharacter` default in Schema for sqlite3 HOT 2
- wulan HOT 1
- Logic failed in RegularExpressionValidator
- Validator error handling in php 8.3 HOT 2
- How should I use Yii2 version 2.0.42.1 in my project HOT 3
- RequiredValidator with typed properties HOT 7
- Unable to resolve the request "--" with chroot HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yii2.