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)
- Abstract type is incorrect for primary keys while loading column schema HOT 7
- Improper loading of column schema for PgSQL HOT 3
- MaskedInput HOT 4
- Data providers perform unnecessary COUNT queries that negatively affect performance HOT 18
- foreach() argument must be of type array|object, bool given HOT 1
- Bug: DataProvider total count is incorrect HOT 4
- Where is a 2.0.50.1 bugfix release? HOT 2
- ActiveForm: Validation delay is applied in non `validateOnType` scenarios
- update links
- update to 2.0.50 error HOT 1
- BC break: \yii\data\ActiveDataProvider throws yii\base\InvalidConfigException depending on array config keys order HOT 1
- SqlDataProvider makes error, if used with pagination
- Model:loadMultiple() method not working in update records HOT 1
- Regression in FileValidator since Yii 2.0.50 when validating required files HOT 4
- Model modification data failed HOT 3
- BaseActiveRecord save method - php docs do not state possible throwing of exception HOT 2
- CompositeAuth does not respect the $user of authMehods HOT 12
- ActiveDataProvider::prepareModels: wrong queries when using union subqueries and pagination HOT 7
- fileCache expire not set HOT 2
- Auto calculated width in GridView columns doesn't take care of placeholder text in search columns HOT 8
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.