小编dan*_*nil的帖子

函数uasort在PHP 5.5和PHP 7.0中的不同行为

在将PHP版本从5.5更改为7.0后,我遇到了Magento 1.8的奇怪行为.这种奇怪的行为是由于工作职能的改变uasort.

源代码:

<?php

$arr = [
    "nominal" => [
        "before" => ["subtotal", "grand_total"],
        "after" => [],
        "_code" => "nominal"
    ],
    "subtotal" => [
        "after" => ["nominal"],
        "before" => ["grand_total", "shipping", "freeshipping", "tax_subtotal", "discount", "tax", "weee"],
        "_code" => "subtotal"
    ],
    "shipping" => [
        "after" => ["subtotal", "freeshipping", "tax_subtotal", "nominal", "weee"],
        "before" => ["grand_total", "discount", "tax_shipping", "tax"],
        "_code" => "shipping"
    ],
    "grand_total" => [
        "after" => ["subtotal", "nominal", "shipping", "freeshipping", "tax_subtotal", "discount", "tax"],
        "before" => [],
        "_code" => "grand_total" …
Run Code Online (Sandbox Code Playgroud)

php magento php-5.5 php-7

11
推荐指数
1
解决办法
3536
查看次数

标签 统计

magento ×1

php ×1

php-5.5 ×1

php-7 ×1